static void test_io_channel_setup_sync(SocketAddressLegacy *listen_addr,

                                       SocketAddressLegacy *connect_addr,

                                       QIOChannel **src,

                                       QIOChannel **dst)

{

    QIOChannelSocket *lioc;



    lioc = qio_channel_socket_new();

    qio_channel_socket_listen_sync(lioc, listen_addr, &error_abort);



    if (listen_addr->type == SOCKET_ADDRESS_LEGACY_KIND_INET) {

        SocketAddressLegacy *laddr = qio_channel_socket_get_local_address(

            lioc, &error_abort);



        g_free(connect_addr->u.inet.data->port);

        connect_addr->u.inet.data->port = g_strdup(laddr->u.inet.data->port);



        qapi_free_SocketAddressLegacy(laddr);

    }



    *src = QIO_CHANNEL(qio_channel_socket_new());

    qio_channel_socket_connect_sync(

        QIO_CHANNEL_SOCKET(*src), connect_addr, &error_abort);

    qio_channel_set_delay(*src, false);



    qio_channel_wait(QIO_CHANNEL(lioc), G_IO_IN);

    *dst = QIO_CHANNEL(qio_channel_socket_accept(lioc, &error_abort));

    g_assert(*dst);



    test_io_channel_set_socket_bufs(*src, *dst);



    object_unref(OBJECT(lioc));

}

static void test_io_channel_setup_sync(SocketAddressLegacy *listen_addr,

                                       SocketAddressLegacy *connect_addr,

                                       QIOChannel **src,

                                       QIOChannel **dst)

{

    QIOChannelSocket *lioc;



    lioc = qio_channel_socket_new();

    qio_channel_socket_listen_sync(lioc, listen_addr, &error_abort);



    if (listen_addr->type == SOCKET_ADDRESS_LEGACY_KIND_INET) {

        SocketAddressLegacy *laddr = qio_channel_socket_get_local_address(

            lioc, &error_abort);



        g_free(connect_addr->u.inet.data->port);

        connect_addr->u.inet.data->port = g_strdup(laddr->u.inet.data->port);



        qapi_free_SocketAddressLegacy(laddr);

    }



    *src = QIO_CHANNEL(qio_channel_socket_new());

    qio_channel_socket_connect_sync(

        QIO_CHANNEL_SOCKET(*src), connect_addr, &error_abort);

    qio_channel_set_delay(*src, false);



    qio_channel_wait(QIO_CHANNEL(lioc), G_IO_IN);

    *dst = QIO_CHANNEL(qio_channel_socket_accept(lioc, &error_abort));

    g_assert(*dst);



    test_io_channel_set_socket_bufs(*src, *dst);



    object_unref(OBJECT(lioc));

}

static void FUNC_0(SocketAddressLegacy *VAR_0,

                                       SocketAddressLegacy *VAR_1,

                                       QIOChannel **VAR_2,

                                       QIOChannel **VAR_3)

{

    QIOChannelSocket *lioc;



    lioc = qio_channel_socket_new();

    qio_channel_socket_listen_sync(lioc, VAR_0, &error_abort);



    if (VAR_0->type == SOCKET_ADDRESS_LEGACY_KIND_INET) {

        SocketAddressLegacy *laddr = qio_channel_socket_get_local_address(

            lioc, &error_abort);



        g_free(VAR_1->u.inet.data->port);

        VAR_1->u.inet.data->port = g_strdup(laddr->u.inet.data->port);



        qapi_free_SocketAddressLegacy(laddr);

    }



    *VAR_2 = QIO_CHANNEL(qio_channel_socket_new());

    qio_channel_socket_connect_sync(

        QIO_CHANNEL_SOCKET(*VAR_2), VAR_1, &error_abort);

    qio_channel_set_delay(*VAR_2, false);



    qio_channel_wait(QIO_CHANNEL(lioc), G_IO_IN);

    *VAR_3 = QIO_CHANNEL(qio_channel_socket_accept(lioc, &error_abort));

    g_assert(*VAR_3);



    test_io_channel_set_socket_bufs(*VAR_2, *VAR_3);



    object_unref(OBJECT(lioc));

}

static void FUNC_0(SocketAddressLegacy *VAR_0,
SocketAddressLegacy *VAR_1,
QIOChannel **VAR_2,
QIOChannel **VAR_3)
{ QIOChannelSocket *lioc; lioc = qio_channel_socket_new(); qio_channel_socket_listen_sync(lioc, VAR_0, &error_abort); if (VAR_0->type == SOCKET_ADDRESS_LEGACY_KIND_INET) { SocketAddressLegacy *laddr = qio_channel_socket_get_local_address(
lioc, &error_abort); g_free(VAR_1->u.inet.data->port); VAR_1->u.inet.data->port = g_strdup(laddr->u.inet.data->port); qapi_free_SocketAddressLegacy(laddr); } *VAR_2 = QIO_CHANNEL(qio_channel_socket_new()); qio_channel_socket_connect_sync(
QIO_CHANNEL_SOCKET(*VAR_2), VAR_1, &error_abort); qio_channel_set_delay(*VAR_2, false); qio_channel_wait(QIO_CHANNEL(lioc), G_IO_IN); *VAR_3 = QIO_CHANNEL(qio_channel_socket_accept(lioc, &error_abort)); g_assert(*VAR_3); test_io_channel_set_socket_bufs(*VAR_2, *VAR_3); object_unref(OBJECT(lioc)); }