static int xen_pt_cmd_reg_read(XenPCIPassthroughState *s, XenPTReg *cfg_entry,

                               uint16_t *value, uint16_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint16_t valid_emu_mask = 0;

    uint16_t emu_mask = reg->emu_mask;



    if (s->is_virtfn) {

        emu_mask |= PCI_COMMAND_MEMORY;

    }



    /* emulate word register */

    valid_emu_mask = emu_mask & valid_mask;

    *value = XEN_PT_MERGE_VALUE(*value, cfg_entry->data, ~valid_emu_mask);



    return 0;

}

static int xen_pt_cmd_reg_read(XenPCIPassthroughState *s, XenPTReg *cfg_entry,

                               uint16_t *value, uint16_t valid_mask)

{

    XenPTRegInfo *reg = cfg_entry->reg;

    uint16_t valid_emu_mask = 0;

    uint16_t emu_mask = reg->emu_mask;



    if (s->is_virtfn) {

        emu_mask |= PCI_COMMAND_MEMORY;

    }



    

    valid_emu_mask = emu_mask & valid_mask;

    *value = XEN_PT_MERGE_VALUE(*value, cfg_entry->data, ~valid_emu_mask);



    return 0;

}

static int xen_pt_cmd_reg_read(XenPCIPassthroughState *s, XenPTReg *cfg_entry,                                uint16_t *value, uint16_t valid_mask)     XenPTRegInfo *reg = cfg_entry->reg;     uint16_t valid_emu_mask = 0;     uint16_t emu_mask = reg->emu_mask;     if (s->is_virtfn) {         emu_mask |= PCI_COMMAND_MEMORY;     valid_emu_mask = emu_mask & valid_mask;     *value = XEN_PT_MERGE_VALUE(*value, cfg_entry->data, ~valid_emu_mask);     return 0;     uint16_t emu_mask = reg->emu_mask;     if (s->is_virtfn) {         emu_mask |= PCI_COMMAND_MEMORY;
static int FUNC_0(XenPCIPassthroughState *VAR_0, XenPTReg *VAR_1,

                               uint16_t *VAR_2, uint16_t VAR_3)

{

    XenPTRegInfo *reg = VAR_1->reg;

    uint16_t valid_emu_mask = 0;

    uint16_t emu_mask = reg->emu_mask;



    if (VAR_0->is_virtfn) {

        emu_mask |= PCI_COMMAND_MEMORY;

    }



    

    valid_emu_mask = emu_mask & VAR_3;

    *VAR_2 = XEN_PT_MERGE_VALUE(*VAR_2, VAR_1->data, ~valid_emu_mask);



    return 0;

}

static int FUNC_0(XenPCIPassthroughState *VAR_0, XenPTReg *VAR_1,
uint16_t *VAR_2, uint16_t VAR_3)
{ XenPTRegInfo *reg = VAR_1->reg; uint16_t valid_emu_mask = 0; uint16_t emu_mask = reg->emu_mask; if (VAR_0->is_virtfn) { emu_mask |= PCI_COMMAND_MEMORY; } valid_emu_mask = emu_mask & VAR_3; *VAR_2 = XEN_PT_MERGE_VALUE(*VAR_2, VAR_1->data, ~valid_emu_mask); return 0; }