static int kvm_s390_register_io_adapter(S390FLICState *fs, uint32_t id,

                                        uint8_t isc, bool swap,

                                        bool is_maskable)

{

    struct kvm_s390_io_adapter adapter = {

        .id = id,

        .isc = isc,

        .maskable = is_maskable,

        .swap = swap,

    };

    KVMS390FLICState *flic = KVM_S390_FLIC(fs);

    int r, ret;

    struct kvm_device_attr attr = {

        .group = KVM_DEV_FLIC_ADAPTER_REGISTER,

        .addr = (uint64_t)&adapter,

    };



    if (!kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING)) {

        /* nothing to do */

        return 0;

    }



    r = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &attr);



    ret = r ? -errno : 0;

    return ret;

}

static int kvm_s390_register_io_adapter(S390FLICState *fs, uint32_t id,

                                        uint8_t isc, bool swap,

                                        bool is_maskable)

{

    struct kvm_s390_io_adapter adapter = {

        .id = id,

        .isc = isc,

        .maskable = is_maskable,

        .swap = swap,

    };

    KVMS390FLICState *flic = KVM_S390_FLIC(fs);

    int r, ret;

    struct kvm_device_attr attr = {

        .group = KVM_DEV_FLIC_ADAPTER_REGISTER,

        .addr = (uint64_t)&adapter,

    };



    if (!kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING)) {

        

        return 0;

    }



    r = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &attr);



    ret = r ? -errno : 0;

    return ret;

}

static int FUNC_0(S390FLICState *VAR_0, uint32_t VAR_1,

                                        uint8_t VAR_2, bool VAR_3,

                                        bool VAR_4)

{

    struct kvm_s390_io_adapter VAR_5 = {

        .VAR_1 = VAR_1,

        .VAR_2 = VAR_2,

        .maskable = VAR_4,

        .VAR_3 = VAR_3,

    };

    KVMS390FLICState *flic = KVM_S390_FLIC(VAR_0);

    int VAR_6, VAR_7;

    struct kvm_device_attr VAR_8 = {

        .group = KVM_DEV_FLIC_ADAPTER_REGISTER,

        .addr = (uint64_t)&VAR_5,

    };



    if (!kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING)) {

        

        return 0;

    }



    VAR_6 = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &VAR_8);



    VAR_7 = VAR_6 ? -errno : 0;

    return VAR_7;

}

static int FUNC_0(S390FLICState *VAR_0, uint32_t VAR_1,
uint8_t VAR_2, bool VAR_3,
bool VAR_4)
{ struct kvm_s390_io_adapter VAR_5 = { .VAR_1 = VAR_1,
.VAR_2 = VAR_2,
.maskable = VAR_4,
.VAR_3 = VAR_3,
}; KVMS390FLICState *flic = KVM_S390_FLIC(VAR_0); int VAR_6, VAR_7; struct kvm_device_attr VAR_8 = { .group = KVM_DEV_FLIC_ADAPTER_REGISTER,
.addr = (uint64_t)&VAR_5,
}; if (!kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING)) { return 0; } VAR_6 = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &VAR_8); VAR_7 = VAR_6 ? -errno : 0; return VAR_7; }