int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data)

{

    if (s->buf_end - s->buf_ptr >= size && !s->write_flag) {

        *data = s->buf_ptr;

        s->buf_ptr += size;

        return size;

    } else {

        *data = buf;

        return avio_read(s, buf, size);

    }

}

int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data)

{

    if (s->buf_end - s->buf_ptr >= size && !s->write_flag) {

        *data = s->buf_ptr;

        s->buf_ptr += size;

        return size;

    } else {

        *data = buf;

        return avio_read(s, buf, size);

    }

}

int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data)
int FUNC_0(AVIOContext *VAR_0, unsigned char *VAR_1, int VAR_2, unsigned char **VAR_3)

{

    if (VAR_0->buf_end - VAR_0->buf_ptr >= VAR_2 && !VAR_0->write_flag) {

        *VAR_3 = VAR_0->buf_ptr;

        VAR_0->buf_ptr += VAR_2;

        return VAR_2;

    } else {

        *VAR_3 = VAR_1;

        return avio_read(VAR_0, VAR_1, VAR_2);

    }

}

int FUNC_0(AVIOContext *VAR_0, unsigned char *VAR_1, int VAR_2, unsigned char **VAR_3)
{ if (VAR_0->buf_end - VAR_0->buf_ptr >= VAR_2 && !VAR_0->write_flag) { *VAR_3 = VAR_0->buf_ptr; VAR_0->buf_ptr += VAR_2; return VAR_2; } else { *VAR_3 = VAR_1; return avio_read(VAR_0, VAR_1, VAR_2); } }