static int qemu_savevm_state(Monitor *mon, QEMUFile *f)

{

    int ret;



    if (qemu_savevm_state_blocked(mon)) {

        ret = -EINVAL;

        goto out;

    }



    ret = qemu_savevm_state_begin(f, 0, 0);

    if (ret < 0)

        goto out;



    do {

        ret = qemu_savevm_state_iterate(f);

        if (ret < 0)

            goto out;

    } while (ret == 0);



    ret = qemu_savevm_state_complete(f);



out:

    if (ret == 0) {

        ret = qemu_file_get_error(f);

    }



    return ret;

}

static int qemu_savevm_state(Monitor *mon, QEMUFile *f)

{

    int ret;



    if (qemu_savevm_state_blocked(mon)) {

        ret = -EINVAL;

        goto out;

    }



    ret = qemu_savevm_state_begin(f, 0, 0);

    if (ret < 0)

        goto out;



    do {

        ret = qemu_savevm_state_iterate(f);

        if (ret < 0)

            goto out;

    } while (ret == 0);



    ret = qemu_savevm_state_complete(f);



out:

    if (ret == 0) {

        ret = qemu_file_get_error(f);

    }



    return ret;

}

static int FUNC_0(Monitor *VAR_0, QEMUFile *VAR_1)

{

    int VAR_2;



    if (qemu_savevm_state_blocked(VAR_0)) {

        VAR_2 = -EINVAL;

        goto out;

    }



    VAR_2 = qemu_savevm_state_begin(VAR_1, 0, 0);

    if (VAR_2 < 0)

        goto out;



    do {

        VAR_2 = qemu_savevm_state_iterate(VAR_1);

        if (VAR_2 < 0)

            goto out;

    } while (VAR_2 == 0);



    VAR_2 = qemu_savevm_state_complete(VAR_1);



out:

    if (VAR_2 == 0) {

        VAR_2 = qemu_file_get_error(VAR_1);

    }



    return VAR_2;

}

static int FUNC_0(Monitor *VAR_0, QEMUFile *VAR_1)
{ int VAR_2; if (qemu_savevm_state_blocked(VAR_0)) { VAR_2 = -EINVAL; goto out; } VAR_2 = qemu_savevm_state_begin(VAR_1, 0, 0); if (VAR_2 < 0)
goto out; do { VAR_2 = qemu_savevm_state_iterate(VAR_1); if (VAR_2 < 0)
goto out; } while (VAR_2 == 0); VAR_2 = qemu_savevm_state_complete(VAR_1); out:
if (VAR_2 == 0) { VAR_2 = qemu_file_get_error(VAR_1); } return VAR_2; }