static void qmp_output_add_obj(QmpOutputVisitor *qov, const char *name,

                               QObject *value)

{

    QStackEntry *e = QTAILQ_FIRST(&qov->stack);

    QObject *cur = e ? e->value : NULL;



    if (!cur) {

        /* FIXME we should require the user to reset the visitor, rather

         * than throwing away the previous root */

        qobject_decref(qov->root);

        qov->root = value;

    } else {

        switch (qobject_type(cur)) {

        case QTYPE_QDICT:

            assert(name);

            qdict_put_obj(qobject_to_qdict(cur), name, value);

            break;

        case QTYPE_QLIST:

            qlist_append_obj(qobject_to_qlist(cur), value);

            break;

        default:

            g_assert_not_reached();

        }

    }

}

static void qmp_output_add_obj(QmpOutputVisitor *qov, const char *name,

                               QObject *value)

{

    QStackEntry *e = QTAILQ_FIRST(&qov->stack);

    QObject *cur = e ? e->value : NULL;



    if (!cur) {

        



        qobject_decref(qov->root);

        qov->root = value;

    } else {

        switch (qobject_type(cur)) {

        case QTYPE_QDICT:

            assert(name);

            qdict_put_obj(qobject_to_qdict(cur), name, value);

            break;

        case QTYPE_QLIST:

            qlist_append_obj(qobject_to_qlist(cur), value);

            break;

        default:

            g_assert_not_reached();

        }

    }

}

static void FUNC_0(QmpOutputVisitor *VAR_0, const char *VAR_1,

                               QObject *VAR_2)

{

    QStackEntry *e = QTAILQ_FIRST(&VAR_0->stack);

    QObject *cur = e ? e->VAR_2 : NULL;



    if (!cur) {

        



        qobject_decref(VAR_0->root);

        VAR_0->root = VAR_2;

    } else {

        switch (qobject_type(cur)) {

        case QTYPE_QDICT:

            assert(VAR_1);

            qdict_put_obj(qobject_to_qdict(cur), VAR_1, VAR_2);

            break;

        case QTYPE_QLIST:

            qlist_append_obj(qobject_to_qlist(cur), VAR_2);

            break;

        default:

            g_assert_not_reached();

        }

    }

}

static void FUNC_0(QmpOutputVisitor *VAR_0, const char *VAR_1,
QObject *VAR_2)
{ QStackEntry *e = QTAILQ_FIRST(&VAR_0->stack); QObject *cur = e ? e->VAR_2 : NULL; if (!cur) { qobject_decref(VAR_0->root); VAR_0->root = VAR_2; } else { switch (qobject_type(cur)) { case QTYPE_QDICT:
assert(VAR_1); qdict_put_obj(qobject_to_qdict(cur), VAR_1, VAR_2); break; case QTYPE_QLIST:
qlist_append_obj(qobject_to_qlist(cur), VAR_2); break; default:
g_assert_not_reached(); } } }