static int usbredir_get_bufpq(QEMUFile *f, void *priv, size_t unused)

{

    struct endp_data *endp = priv;

    USBRedirDevice *dev = endp->dev;

    struct buf_packet *bufp;

    int i;



    endp->bufpq_size = qemu_get_be32(f);

    for (i = 0; i < endp->bufpq_size; i++) {

        bufp = g_malloc(sizeof(struct buf_packet));

        bufp->len = qemu_get_be32(f);

        bufp->status = qemu_get_be32(f);

        bufp->offset = 0;

        bufp->data = qemu_oom_check(malloc(bufp->len)); /* regular malloc! */

        bufp->free_on_destroy = bufp->data;

        qemu_get_buffer(f, bufp->data, bufp->len);

        QTAILQ_INSERT_TAIL(&endp->bufpq, bufp, next);

        DPRINTF("get_bufpq %d/%d len %d status %d\n", i + 1, endp->bufpq_size,

                bufp->len, bufp->status);

    }

    return 0;

}

static int usbredir_get_bufpq(QEMUFile *f, void *priv, size_t unused)

{

    struct endp_data *endp = priv;

    USBRedirDevice *dev = endp->dev;

    struct buf_packet *bufp;

    int i;



    endp->bufpq_size = qemu_get_be32(f);

    for (i = 0; i < endp->bufpq_size; i++) {

        bufp = g_malloc(sizeof(struct buf_packet));

        bufp->len = qemu_get_be32(f);

        bufp->status = qemu_get_be32(f);

        bufp->offset = 0;

        bufp->data = qemu_oom_check(malloc(bufp->len)); 

        bufp->free_on_destroy = bufp->data;

        qemu_get_buffer(f, bufp->data, bufp->len);

        QTAILQ_INSERT_TAIL(&endp->bufpq, bufp, next);

        DPRINTF("get_bufpq %d/%d len %d status %d\n", i + 1, endp->bufpq_size,

                bufp->len, bufp->status);

    }

    return 0;

}

        bufp = g_malloc(sizeof(struct buf_packet));
static int FUNC_0(QEMUFile *VAR_0, void *VAR_1, size_t VAR_2)

{

    struct endp_data *VAR_3 = VAR_1;

    USBRedirDevice *dev = VAR_3->dev;

    struct buf_packet *VAR_4;

    int VAR_5;



    VAR_3->bufpq_size = qemu_get_be32(VAR_0);

    for (VAR_5 = 0; VAR_5 < VAR_3->bufpq_size; VAR_5++) {

        VAR_4 = g_malloc(sizeof(struct buf_packet));

        VAR_4->len = qemu_get_be32(VAR_0);

        VAR_4->status = qemu_get_be32(VAR_0);

        VAR_4->offset = 0;

        VAR_4->data = qemu_oom_check(malloc(VAR_4->len)); 

        VAR_4->free_on_destroy = VAR_4->data;

        qemu_get_buffer(VAR_0, VAR_4->data, VAR_4->len);

        QTAILQ_INSERT_TAIL(&VAR_3->bufpq, VAR_4, next);

        DPRINTF("get_bufpq %d/%d len %d status %d\n", VAR_5 + 1, VAR_3->bufpq_size,

                VAR_4->len, VAR_4->status);

    }

    return 0;

}

static int FUNC_0(QEMUFile *VAR_0, void *VAR_1, size_t VAR_2)
{ struct endp_data *VAR_3 = VAR_1; USBRedirDevice *dev = VAR_3->dev; struct buf_packet *VAR_4; int VAR_5; VAR_3->bufpq_size = qemu_get_be32(VAR_0); for (VAR_5 = 0; VAR_5 < VAR_3->bufpq_size; VAR_5++) { VAR_4 = g_malloc(sizeof(struct buf_packet)); VAR_4->len = qemu_get_be32(VAR_0); VAR_4->status = qemu_get_be32(VAR_0); VAR_4->offset = 0; VAR_4->data = qemu_oom_check(malloc(VAR_4->len)); VAR_4->free_on_destroy = VAR_4->data; qemu_get_buffer(VAR_0, VAR_4->data, VAR_4->len); QTAILQ_INSERT_TAIL(&VAR_3->bufpq, VAR_4, next); DPRINTF("get_bufpq %d/%d len %d status %d\n", VAR_5 + 1, VAR_3->bufpq_size,
VAR_4->len, VAR_4->status); } return 0; }