static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){
    AVFormatContext *s= nut->avf;
    ByteIOContext *bc = s->pb;
    int64_t end, tmp;
    nut->last_syncpoint_pos= url_ftell(bc)-8;
    end= get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE);
    end += url_ftell(bc);
    tmp= ff_get_v(bc);
    *back_ptr= nut->last_syncpoint_pos - 16*ff_get_v(bc);
    if(*back_ptr < 0)
        return -1;
    ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp / nut->time_base_count);
    if(skip_reserved(bc, end) || get_checksum(bc)){
        av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n");
        return -1;
    }
    *ts= tmp / s->nb_streams * av_q2d(nut->time_base[tmp % s->nb_streams])*AV_TIME_BASE;
    ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts);
    return 0;
}
['static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr){\n    AVFormatContext *s= nut->avf;\n    ByteIOContext *bc = s->pb;\n    int64_t end, tmp;\n    nut->last_syncpoint_pos= url_ftell(bc)-8;\n    end= get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE);\n    end += url_ftell(bc);\n    tmp= ff_get_v(bc);\n    *back_ptr= nut->last_syncpoint_pos - 16*ff_get_v(bc);\n    if(*back_ptr < 0)\n        return -1;\n    ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp / nut->time_base_count);\n    if(skip_reserved(bc, end) || get_checksum(bc)){\n        av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\\n");\n        return -1;\n    }\n    *ts= tmp / s->nb_streams * av_q2d(nut->time_base[tmp % s->nb_streams])*AV_TIME_BASE;\n    ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts);\n    return 0;\n}', 'offset_t url_ftell(ByteIOContext *s)\n{\n    return url_fseek(s, 0, SEEK_CUR);\n}', 'offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)\n{\n    offset_t offset1;\n    offset_t pos;\n    if(!s)\n        return AVERROR(EINVAL);\n    pos = s->pos - (s->write_flag ? 0 : (s->buf_end - s->buffer));\n    if (whence != SEEK_CUR && whence != SEEK_SET)\n        return AVERROR(EINVAL);\n    if (whence == SEEK_CUR) {\n        offset1 = pos + (s->buf_ptr - s->buffer);\n        if (offset == 0)\n            return offset1;\n        offset += offset1;\n    }\n    offset1 = offset - pos;\n    if (!s->must_flush &&\n        offset1 >= 0 && offset1 < (s->buf_end - s->buffer)) {\n        s->buf_ptr = s->buffer + offset1;\n    } else if(s->is_streamed && !s->write_flag &&\n              offset1 >= 0 && offset1 < (s->buf_end - s->buffer) + (1<<16)){\n        while(s->pos < offset && !s->eof_reached)\n            fill_buffer(s);\n        if (s->eof_reached)\n            return AVERROR(EPIPE);\n        s->buf_ptr = s->buf_end + offset - s->pos;\n    } else {\n        offset_t res = AVERROR(EPIPE);\n#if defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK)\n        if (s->write_flag) {\n            flush_buffer(s);\n            s->must_flush = 1;\n        } else\n#endif\n        {\n            s->buf_end = s->buffer;\n        }\n        s->buf_ptr = s->buffer;\n        if (!s->seek || (res = s->seek(s->opaque, offset, SEEK_SET)) < 0)\n            return res;\n        s->pos = offset;\n    }\n    s->eof_reached = 0;\n    return offset;\n}', 'uint64_t ff_get_v(ByteIOContext *bc){\n    uint64_t val = 0;\n    int tmp;\n    do{\n        tmp = get_byte(bc);\n        val= (val<<7) + (tmp&127);\n    }while(tmp&128);\n    return val;\n}']