static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,

                                  bool assign, uint32_t size, bool datamatch)

{

    int ret;

    struct kvm_ioeventfd iofd;



    iofd.datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0;

    iofd.addr = addr;

    iofd.len = size;

    iofd.flags = 0;

    iofd.fd = fd;



    if (!kvm_enabled()) {

        return -ENOSYS;

    }



    if (datamatch) {

        iofd.flags |= KVM_IOEVENTFD_FLAG_DATAMATCH;

    }

    if (!assign) {

        iofd.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    }



    ret = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &iofd);



    if (ret < 0) {

        return -errno;

    }



    return 0;

}

static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val,

                                  bool assign, uint32_t size, bool datamatch)

{

    int ret;

    struct kvm_ioeventfd iofd;



    iofd.datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0;

    iofd.addr = addr;

    iofd.len = size;

    iofd.flags = 0;

    iofd.fd = fd;



    if (!kvm_enabled()) {

        return -ENOSYS;

    }



    if (datamatch) {

        iofd.flags |= KVM_IOEVENTFD_FLAG_DATAMATCH;

    }

    if (!assign) {

        iofd.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    }



    ret = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &iofd);



    if (ret < 0) {

        return -errno;

    }



    return 0;

}

    struct kvm_ioeventfd iofd;     iofd.datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0;     iofd.addr = addr;     iofd.len = size;     iofd.flags = 0;     iofd.fd = fd;
static int FUNC_0(int VAR_0, hwaddr VAR_1, uint32_t VAR_2,

                                  bool VAR_3, uint32_t VAR_4, bool VAR_5)

{

    int VAR_6;

    struct kvm_ioeventfd VAR_7;



    VAR_7.VAR_5 = VAR_5 ? adjust_ioeventfd_endianness(VAR_2, VAR_4) : 0;

    VAR_7.VAR_1 = VAR_1;

    VAR_7.len = VAR_4;

    VAR_7.flags = 0;

    VAR_7.VAR_0 = VAR_0;



    if (!kvm_enabled()) {

        return -ENOSYS;

    }



    if (VAR_5) {

        VAR_7.flags |= KVM_IOEVENTFD_FLAG_DATAMATCH;

    }

    if (!VAR_3) {

        VAR_7.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    }



    VAR_6 = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &VAR_7);



    if (VAR_6 < 0) {

        return -errno;

    }



    return 0;

}

static int FUNC_0(int VAR_0, hwaddr VAR_1, uint32_t VAR_2,
bool VAR_3, uint32_t VAR_4, bool VAR_5)
{ int VAR_6; struct kvm_ioeventfd VAR_7; VAR_7.VAR_5 = VAR_5 ? adjust_ioeventfd_endianness(VAR_2, VAR_4) : 0; VAR_7.VAR_1 = VAR_1; VAR_7.len = VAR_4; VAR_7.flags = 0; VAR_7.VAR_0 = VAR_0; if (!kvm_enabled()) { return -ENOSYS; } if (VAR_5) { VAR_7.flags |= KVM_IOEVENTFD_FLAG_DATAMATCH; } if (!VAR_3) { VAR_7.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN; } VAR_6 = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &VAR_7); if (VAR_6 < 0) { return -errno; } return 0; }