int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)

{

    struct kvm_ioeventfd kick = {

        .datamatch = val,

        .addr = addr,

        .len = 2,

        .flags = KVM_IOEVENTFD_FLAG_DATAMATCH | KVM_IOEVENTFD_FLAG_PIO,

        .fd = fd,

    };

    int r;

    if (!kvm_enabled())

        return -ENOSYS;

    if (!assign)

        kick.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    r = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &kick);

    if (r < 0)

        return r;

    return 0;

}

int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)

{

    struct kvm_ioeventfd kick = {

        .datamatch = val,

        .addr = addr,

        .len = 2,

        .flags = KVM_IOEVENTFD_FLAG_DATAMATCH | KVM_IOEVENTFD_FLAG_PIO,

        .fd = fd,

    };

    int r;

    if (!kvm_enabled())

        return -ENOSYS;

    if (!assign)

        kick.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    r = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &kick);

    if (r < 0)

        return r;

    return 0;

}

int FUNC_0(int VAR_0, uint16_t VAR_1, uint16_t VAR_2, bool VAR_3)

{

    struct kvm_ioeventfd VAR_4 = {

        .datamatch = VAR_2,

        .VAR_1 = VAR_1,

        .len = 2,

        .flags = KVM_IOEVENTFD_FLAG_DATAMATCH | KVM_IOEVENTFD_FLAG_PIO,

        .VAR_0 = VAR_0,

    };

    int VAR_5;

    if (!kvm_enabled())

        return -ENOSYS;

    if (!VAR_3)

        VAR_4.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN;

    VAR_5 = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &VAR_4);

    if (VAR_5 < 0)

        return VAR_5;

    return 0;

}

int FUNC_0(int VAR_0, uint16_t VAR_1, uint16_t VAR_2, bool VAR_3)
{ struct kvm_ioeventfd VAR_4 = { .datamatch = VAR_2,
.VAR_1 = VAR_1,
.len = 2,
.flags = KVM_IOEVENTFD_FLAG_DATAMATCH | KVM_IOEVENTFD_FLAG_PIO,
.VAR_0 = VAR_0,
}; int VAR_5; if (!kvm_enabled())
return -ENOSYS; if (!VAR_3)
VAR_4.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN; VAR_5 = kvm_vm_ioctl(kvm_state, KVM_IOEVENTFD, &VAR_4); if (VAR_5 < 0)
return VAR_5; return 0; }