static void *vmstate_base_addr(void *opaque, VMStateField *field, bool alloc)

{

    void *base_addr = opaque + field->offset;



    if (field->flags & VMS_POINTER) {

        if (alloc && (field->flags & VMS_ALLOC)) {

            gsize size = 0;

            if (field->flags & VMS_VBUFFER) {

                size = vmstate_size(opaque, field);

            } else {

                int n_elems = vmstate_n_elems(opaque, field);

                if (n_elems) {

                    size = n_elems * field->size;

                }

            }

            if (size) {

                *((void **)base_addr + field->start) = g_malloc(size);

            }

        }

        base_addr = *(void **)base_addr + field->start;

    }



    return base_addr;

}

static void *vmstate_base_addr(void *opaque, VMStateField *field, bool alloc)

{

    void *base_addr = opaque + field->offset;



    if (field->flags & VMS_POINTER) {

        if (alloc && (field->flags & VMS_ALLOC)) {

            gsize size = 0;

            if (field->flags & VMS_VBUFFER) {

                size = vmstate_size(opaque, field);

            } else {

                int n_elems = vmstate_n_elems(opaque, field);

                if (n_elems) {

                    size = n_elems * field->size;

                }

            }

            if (size) {

                *((void **)base_addr + field->start) = g_malloc(size);

            }

        }

        base_addr = *(void **)base_addr + field->start;

    }



    return base_addr;

}

static void *FUNC_0(void *VAR_0, VMStateField *VAR_1, bool VAR_2)

{

    void *VAR_3 = VAR_0 + VAR_1->offset;



    if (VAR_1->flags & VMS_POINTER) {

        if (VAR_2 && (VAR_1->flags & VMS_ALLOC)) {

            gsize size = 0;

            if (VAR_1->flags & VMS_VBUFFER) {

                size = vmstate_size(VAR_0, VAR_1);

            } else {

                int VAR_4 = vmstate_n_elems(VAR_0, VAR_1);

                if (VAR_4) {

                    size = VAR_4 * VAR_1->size;

                }

            }

            if (size) {

                *((void **)VAR_3 + VAR_1->start) = g_malloc(size);

            }

        }

        VAR_3 = *(void **)VAR_3 + VAR_1->start;

    }



    return VAR_3;

}

static void *FUNC_0(void *VAR_0, VMStateField *VAR_1, bool VAR_2)
{ void *VAR_3 = VAR_0 + VAR_1->offset; if (VAR_1->flags & VMS_POINTER) { if (VAR_2 && (VAR_1->flags & VMS_ALLOC)) { gsize size = 0; if (VAR_1->flags & VMS_VBUFFER) { size = vmstate_size(VAR_0, VAR_1); } else { int VAR_4 = vmstate_n_elems(VAR_0, VAR_1); if (VAR_4) { size = VAR_4 * VAR_1->size; } } if (size) { *((void **)VAR_3 + VAR_1->start) = g_malloc(size); } } VAR_3 = *(void **)VAR_3 + VAR_1->start; } return VAR_3; }