static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, const char *name,

                                  void *opaque, Error **errp)

{

    X86CPU *cpu = X86_CPU(obj);

    DeviceState *dev = DEVICE(obj);

    const int64_t min = 0;

    const int64_t max = UINT32_MAX;

    Error *error = NULL;

    int64_t value;



    if (dev->realized) {

        error_setg(errp, "Attempt to set property '%s' on '%s' after "

                   "it was realized", name, object_get_typename(obj));

        return;

    }



    visit_type_int(v, name, &value, &error);

    if (error) {

        error_propagate(errp, error);

        return;

    }

    if (value < min || value > max) {

        error_setg(errp, "Property %s.%s doesn't take value %" PRId64

                   " (minimum: %" PRId64 ", maximum: %" PRId64 ")" ,

                   object_get_typename(obj), name, value, min, max);

        return;

    }



    if ((value != cpu->apic_id) && cpu_exists(value)) {

        error_setg(errp, "CPU with APIC ID %" PRIi64 " exists", value);

        return;

    }

    cpu->apic_id = value;

}

static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, const char *name,

                                  void *opaque, Error **errp)

{

    X86CPU *cpu = X86_CPU(obj);

    DeviceState *dev = DEVICE(obj);

    const int64_t min = 0;

    const int64_t max = UINT32_MAX;

    Error *error = NULL;

    int64_t value;



    if (dev->realized) {

        error_setg(errp, "Attempt to set property '%s' on '%s' after "

                   "it was realized", name, object_get_typename(obj));

        return;

    }



    visit_type_int(v, name, &value, &error);

    if (error) {

        error_propagate(errp, error);

        return;

    }

    if (value < min || value > max) {

        error_setg(errp, "Property %s.%s doesn't take value %" PRId64

                   " (minimum: %" PRId64 ", maximum: %" PRId64 ")" ,

                   object_get_typename(obj), name, value, min, max);

        return;

    }



    if ((value != cpu->apic_id) && cpu_exists(value)) {

        error_setg(errp, "CPU with APIC ID %" PRIi64 " exists", value);

        return;

    }

    cpu->apic_id = value;

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, const char *VAR_2,

                                  void *VAR_3, Error **VAR_4)

{

    X86CPU *cpu = X86_CPU(VAR_0);

    DeviceState *dev = DEVICE(VAR_0);

    const int64_t VAR_5 = 0;

    const int64_t VAR_6 = UINT32_MAX;

    Error *error = NULL;

    int64_t value;



    if (dev->realized) {

        error_setg(VAR_4, "Attempt to set property '%s' on '%s' after "

                   "it was realized", VAR_2, object_get_typename(VAR_0));

        return;

    }



    visit_type_int(VAR_1, VAR_2, &value, &error);

    if (error) {

        error_propagate(VAR_4, error);

        return;

    }

    if (value < VAR_5 || value > VAR_6) {

        error_setg(VAR_4, "Property %s.%s doesn't take value %" PRId64

                   " (minimum: %" PRId64 ", maximum: %" PRId64 ")" ,

                   object_get_typename(VAR_0), VAR_2, value, VAR_5, VAR_6);

        return;

    }



    if ((value != cpu->apic_id) && cpu_exists(value)) {

        error_setg(VAR_4, "CPU with APIC ID %" PRIi64 " exists", value);

        return;

    }

    cpu->apic_id = value;

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, const char *VAR_2,
void *VAR_3, Error **VAR_4)
{ X86CPU *cpu = X86_CPU(VAR_0); DeviceState *dev = DEVICE(VAR_0); const int64_t VAR_5 = 0; const int64_t VAR_6 = UINT32_MAX; Error *error = NULL; int64_t value; if (dev->realized) { error_setg(VAR_4, "Attempt to set property '%s' on '%s' after "
"it was realized", VAR_2, object_get_typename(VAR_0)); return; } visit_type_int(VAR_1, VAR_2, &value, &error); if (error) { error_propagate(VAR_4, error); return; } if (value < VAR_5 || value > VAR_6) { error_setg(VAR_4, "Property %s.%s doesn't take value %" PRId64
" (minimum: %" PRId64 ", maximum: %" PRId64 ")" ,
object_get_typename(VAR_0), VAR_2, value, VAR_5, VAR_6); return; } if ((value != cpu->apic_id) && cpu_exists(value)) { error_setg(VAR_4, "CPU with APIC ID %" PRIi64 " exists", value); return; } cpu->apic_id = value; }