static int drop_sync(QIOChannel *ioc, size_t size, Error **errp)

{

    ssize_t ret = 0;

    char small[1024];

    char *buffer;



    buffer = sizeof(small) >= size ? small : g_malloc(MIN(65536, size));

    while (size > 0) {

        ssize_t count = MIN(65536, size);

        ret = read_sync(ioc, buffer, MIN(65536, size), errp);



        if (ret < 0) {

            goto cleanup;

        }

        size -= count;

    }



 cleanup:

    if (buffer != small) {

        g_free(buffer);

    }

    return ret;

}

static int drop_sync(QIOChannel *ioc, size_t size, Error **errp)

{

    ssize_t ret = 0;

    char small[1024];

    char *buffer;



    buffer = sizeof(small) >= size ? small : g_malloc(MIN(65536, size));

    while (size > 0) {

        ssize_t count = MIN(65536, size);

        ret = read_sync(ioc, buffer, MIN(65536, size), errp);



        if (ret < 0) {

            goto cleanup;

        }

        size -= count;

    }



 cleanup:

    if (buffer != small) {

        g_free(buffer);

    }

    return ret;

}

static int FUNC_0(QIOChannel *VAR_0, size_t VAR_1, Error **VAR_2)

{

    ssize_t ret = 0;

    char VAR_3[1024];

    char *VAR_4;



    VAR_4 = sizeof(VAR_3) >= VAR_1 ? VAR_3 : g_malloc(MIN(65536, VAR_1));

    while (VAR_1 > 0) {

        ssize_t count = MIN(65536, VAR_1);

        ret = read_sync(VAR_0, VAR_4, MIN(65536, VAR_1), VAR_2);



        if (ret < 0) {

            goto cleanup;

        }

        VAR_1 -= count;

    }



 cleanup:

    if (VAR_4 != VAR_3) {

        g_free(VAR_4);

    }

    return ret;

}

static int FUNC_0(QIOChannel *VAR_0, size_t VAR_1, Error **VAR_2)
{ ssize_t ret = 0; char VAR_3[1024]; char *VAR_4; VAR_4 = sizeof(VAR_3) >= VAR_1 ? VAR_3 : g_malloc(MIN(65536, VAR_1)); while (VAR_1 > 0) { ssize_t count = MIN(65536, VAR_1); ret = read_sync(VAR_0, VAR_4, MIN(65536, VAR_1), VAR_2); if (ret < 0) { goto cleanup; } VAR_1 -= count; } cleanup:
if (VAR_4 != VAR_3) { g_free(VAR_4); } return ret; }