int register_savevm(const char *idstr,

                    int instance_id,

                    int version_id,

                    SaveStateHandler *save_state,

                    LoadStateHandler *load_state,

                    void *opaque)

{

    SaveStateEntry *se, **pse;



    se = qemu_malloc(sizeof(SaveStateEntry));

    if (!se)

        return -1;

    pstrcpy(se->idstr, sizeof(se->idstr), idstr);

    se->instance_id = (instance_id == -1) ? 0 : instance_id;

    se->version_id = version_id;

    se->save_state = save_state;

    se->load_state = load_state;

    se->opaque = opaque;

    se->next = NULL;



    /* add at the end of list */

    pse = &first_se;

    while (*pse != NULL) {

        if (instance_id == -1

                && strcmp(se->idstr, (*pse)->idstr) == 0

                && se->instance_id <= (*pse)->instance_id)

            se->instance_id = (*pse)->instance_id + 1;

        pse = &(*pse)->next;

    }

    *pse = se;

    return 0;

}

int register_savevm(const char *idstr,

                    int instance_id,

                    int version_id,

                    SaveStateHandler *save_state,

                    LoadStateHandler *load_state,

                    void *opaque)

{

    SaveStateEntry *se, **pse;



    se = qemu_malloc(sizeof(SaveStateEntry));

    if (!se)

        return -1;

    pstrcpy(se->idstr, sizeof(se->idstr), idstr);

    se->instance_id = (instance_id == -1) ? 0 : instance_id;

    se->version_id = version_id;

    se->save_state = save_state;

    se->load_state = load_state;

    se->opaque = opaque;

    se->next = NULL;



    

    pse = &first_se;

    while (*pse != NULL) {

        if (instance_id == -1

                && strcmp(se->idstr, (*pse)->idstr) == 0

                && se->instance_id <= (*pse)->instance_id)

            se->instance_id = (*pse)->instance_id + 1;

        pse = &(*pse)->next;

    }

    *pse = se;

    return 0;

}

int register_savevm(const char *idstr,                     int instance_id,                     int version_id,                     SaveStateHandler *save_state,                     LoadStateHandler *load_state,                     void *opaque)
int FUNC_0(const char *VAR_0,

                    int VAR_1,

                    int VAR_2,

                    SaveStateHandler *VAR_3,

                    LoadStateHandler *VAR_4,

                    void *VAR_5)

{

    SaveStateEntry *se, **pse;



    se = qemu_malloc(sizeof(SaveStateEntry));

    if (!se)

        return -1;

    pstrcpy(se->VAR_0, sizeof(se->VAR_0), VAR_0);

    se->VAR_1 = (VAR_1 == -1) ? 0 : VAR_1;

    se->VAR_2 = VAR_2;

    se->VAR_3 = VAR_3;

    se->VAR_4 = VAR_4;

    se->VAR_5 = VAR_5;

    se->next = NULL;



    

    pse = &first_se;

    while (*pse != NULL) {

        if (VAR_1 == -1

                && strcmp(se->VAR_0, (*pse)->VAR_0) == 0

                && se->VAR_1 <= (*pse)->VAR_1)

            se->VAR_1 = (*pse)->VAR_1 + 1;

        pse = &(*pse)->next;

    }

    *pse = se;

    return 0;

}

int FUNC_0(const char *VAR_0,
int VAR_1,
int VAR_2,
SaveStateHandler *VAR_3,
LoadStateHandler *VAR_4,
void *VAR_5)
{ SaveStateEntry *se, **pse; se = qemu_malloc(sizeof(SaveStateEntry)); if (!se)
return -1; pstrcpy(se->VAR_0, sizeof(se->VAR_0), VAR_0); se->VAR_1 = (VAR_1 == -1) ? 0 : VAR_1; se->VAR_2 = VAR_2; se->VAR_3 = VAR_3; se->VAR_4 = VAR_4; se->VAR_5 = VAR_5; se->next = NULL; pse = &first_se; while (*pse != NULL) { if (VAR_1 == -1
&& strcmp(se->VAR_0, (*pse)->VAR_0) == 0
&& se->VAR_1 <= (*pse)->VAR_1)
se->VAR_1 = (*pse)->VAR_1 + 1; pse = &(*pse)->next; } *pse = se; return 0; }