LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Shadowsith[P]gtts/gtts.cpp
// Function: gtts::GoogleTTS::help()
void GoogleTTS::help() {
    std::cout << "gtts: plays Google Text-to-Speech speech synthesis with " << 
        "help of Google Translate voice" << std::endl;
    std::cout << "Usage: gtts [language] \"[message]\" ([speed])" << std::endl;
    std::cout << "Example: gtts us \"hello world\" 1.5" << std::endl;
    std::cout << "standard speed is 1.0" << std::endl;
    std::cout << std::endl;
    std::cout << "Options:" << std::endl;    
    std::cout << "-h\t\tshows this help" << std::endl;
    std::cout << "-v\t\tshows program version" << std::endl;
    std::cout << "-l\t\tshows all available languages" << std::endl;
    std::cout << std::endl;
    std::cout << "To speak from text files use: gtts [lang] \"$(cat file.txt)\""
       " ([speed])" << std::endl;
    std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x4fa9(%rip), %rbx      # 0x8fd8
leaq 0x2445(%rip), %rsi      # 0x647b
movq %rbx, %rdi
callq 0x2170
leaq 0x246f(%rip), %rsi      # 0x64b4
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
leaq 0x2477(%rip), %rsi      # 0x64d3
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
leaq 0x248d(%rip), %rsi      # 0x6500
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
leaq 0x2499(%rip), %rsi      # 0x6523
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x20c0
leaq 0x2490(%rip), %rsi      # 0x6539
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
leaq 0x2482(%rip), %rsi      # 0x6542
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
leaq 0x247f(%rip), %rsi      # 0x6556
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
leaq 0x2482(%rip), %rsi      # 0x6570
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x20c0
leaq 0x2485(%rip), %rsi      # 0x6592
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Shadowsith[P]gtts/gtts.cpp
// Function: gtts::GoogleTTS::languages()
void GoogleTTS::languages() {
    std::cout << "Supported languages:" << std::endl;
    int counter = 0;
    for(std::pair<string, string> l : lang_codes) {
        std::cout << l.first  << "\t:\t"<< l.second << std::endl;
    }    
    std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x4e94(%rip), %rdi      # 0x8fd8
leaq 0x248d(%rip), %rsi      # 0x65d8
callq 0x2170
movq %rax, %rdi
callq 0x20c0
movq 0x5039(%rip), %r12      # 0x9198
leaq -0x48(%rbp), %r14
leaq 0x501e(%rip), %rbx      # 0x9188
leaq -0x68(%rbp), %r15
leaq 0x2478(%rip), %r13      # 0x65ed
cmpq %rbx, %r12
je 0x41c9
leaq 0x20(%r12), %rsi
movq %r15, %rdi
callq 0x496e
movq 0x4e4a(%rip), %rdi      # 0x8fd8
movq %r15, %rsi
callq 0x2160
movq %rax, %rdi
movq %r13, %rsi
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2160
movq %rax, %rdi
callq 0x20c0
movq %r15, %rdi
callq 0x49a8
movq %r12, %rdi
callq 0x21b0
movq %rax, %r12
jmp 0x4175
movq 0x4e08(%rip), %rdi      # 0x8fd8
callq 0x20c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x49a8
movq %rbx, %rdi
callq 0x2260
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/main.cpp
// Function: h264_decoder_feed(ymn::h264_decoder&, unsigned char const*, unsigned long)
static void h264_decoder_feed(ymn::h264_decoder& decoder, const uint8_t* data, std::size_t count)
{
//{
//    const uint8_t *p = data;
//    fprintf(stdout, " 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6]);
//}

    if (h264_ofile.is_open())
        h264_ofile.write(reinterpret_cast<const char*>(data), count);

    decoder.feed(data, count);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x1b2cd(%rip), %rdi     # 0x1e288
callq 0x2070
testb %al, %al
je 0x2fd6
leaq 0x1b24d(%rip), %rdi     # 0x1e218
movq %r14, %rsi
movq %rbx, %rdx
callq 0x21c0
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x6d7c
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/./mpeg2ts_parser.hpp
// Function: ymn::mpeg2ts_parser::mpeg2ts_parser(unsigned long)
explicit mpeg2ts_parser(std::size_t capacity) :
        base_parser<uint8_t>(capacity),
        m_state_function(&mpeg2ts_parser::waiting_for_sync),
        m_tspacket_size(0),
        m_transport_rate()
    {
#if defined(DEBUG_PARSERS)
        std::cout << __PRETTY_FUNCTION__ << std::endl;
        std::cout << to_string() << std::endl;
#endif
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x3030
leaq 0x1ab6e(%rip), %rax     # 0x1db68
movq %rax, (%rbx)
leaq 0x34c(%rip), %rax       # 0x3350
movq %rax, 0x108(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rbx)
movl $0x2000, 0x120(%rbx)    # imm = 0x2000
movups %xmm0, 0x128(%rbx)
movups %xmm0, 0x138(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/./flatbuffer.hpp
// Function: ymn::flatbuffer<unsigned char>::flatbuffer(unsigned long)
explicit flatbuffer(std::size_t capacity) :
        m_capacity(capacity),
        m_counters(capacity),
        m_buffer(nullptr)
    {
        m_buffer = new T[m_capacity];

#if defined(DEBUG_FLATBUFFER)
        std::cout << __PRETTY_FUNCTION__ << std::endl;
        std::cout << to_string() << std::endl;
#endif
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, (%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rdi)
andq $0x0, 0x50(%rdi)
movq %rsi, 0x58(%rdi)
orq $-0x1, 0x60(%rdi)
movq %rsi, %rdi
callq 0x2030
movq %rax, 0x80(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/./flatbuffer.hpp
// Function: ymn::flatbuffer<unsigned char>::move()
void move()
    {
        std::size_t x;

        if (m_counters.m_bookmark_idx >= 0) {
            x = m_counters.m_bookmark_idx;
            m_counters.m_bookmark_idx = 0;
        }
        else
            x = m_counters.m_read_idx;

        if (x > 0) {
            std::size_t available_elements = m_counters.m_write_idx - x;
            std::size_t offset = m_counters.m_read_idx - x;

            std::memmove(m_buffer, &m_buffer[x], available_elements * sizeof(T));

            m_counters.m_read_idx = offset;
            m_counters.m_write_idx = available_elements;
            m_counters.m_write_avail = m_capacity - available_elements;
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rsi
testq %rsi, %rsi
js 0x3182
andq $0x0, 0x60(%rbx)
jmp 0x3186
movq 0x40(%rbx), %rsi
testq %rsi, %rsi
je 0x31bd
movq 0x40(%rbx), %r15
movq 0x50(%rbx), %r14
subq %rsi, %r14
subq %rsi, %r15
movq 0x80(%rbx), %rdi
addq %rdi, %rsi
movq %r14, %rdx
callq 0x2240
movq %r15, 0x40(%rbx)
movq %r14, 0x50(%rbx)
movq (%rbx), %rax
subq %r14, %rax
movq %rax, 0x58(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/./flatbuffer.hpp
// Function: ymn::flatbuffer<unsigned char>::write(unsigned char const*, unsigned long)
std::size_t write(const T data[], std::size_t count)
    {
        if (count > m_counters.m_write_avail)
            count = m_counters.m_write_avail;

        memcpy(&m_buffer[m_counters.m_write_idx], data, count * sizeof(T));

        m_counters.m_write_idx   += count;
        m_counters.m_write_avail -= count;
        m_counters.m_read_avail  += count;

        return count;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %r14
movq 0x80(%rdi), %rdi
cmpq %rdx, %r14
cmovaeq %rdx, %r14
addq 0x50(%rbx), %rdi
movq %r14, %rdx
callq 0x20f0
subq %r14, 0x58(%rbx)
movdqu 0x48(%rbx), %xmm0
movq %r14, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
paddq %xmm0, %xmm1
movdqu %xmm1, 0x48(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/./strtointeger.hpp
// Function: ymn::strtointeger_conversion_status_e ymn::strtoui<unsigned short>(char const*, unsigned short&)
inline strtointeger_conversion_status_e strtoui(const char* str, T& value)
{
    if (!std::is_integral<T>::value)
        return strtointeger_conversion_status_e::invalid_argument;

    if (!std::is_unsigned<T>::value)
        return strtointeger_conversion_status_e::invalid_argument;

    strtointeger_conversion_status_e status =
        strtointeger_conversion_status_e::conversion_error;

    do {
        unsigned long long ullv;
        char* endptr;

        if (*str == '\0') { /* string is empty */
            status = strtointeger_conversion_status_e::invalid_argument;
            break;
        }

        errno = 0, ullv = std::strtoull(str, &endptr, 0);

        if (*endptr != '\0') {
            status = strtointeger_conversion_status_e::invalid_argument;
            break; /* string is invalid (has unparsed characters) */
        }

        if ((ERANGE == errno) && (ULLONG_MAX == ullv)) {
            status = strtointeger_conversion_status_e::out_of_range;
            break; /* number in string exceeds 'unsigned long long' range */
        }

        if ((0 == ullv) && (errno != 0)) {
            status = strtointeger_conversion_status_e::conversion_error;
            break; /* no valid conversion was performed */
        }

        T max_unsigned_value = static_cast<T>(~0ULL);

        if (ullv > static_cast<unsigned long long>(max_unsigned_value)) {
            status = strtointeger_conversion_status_e::out_of_range;
            break; /* number in string exceeds 'T' range */
        }

        value = static_cast<T>(ullv);
        status = strtointeger_conversion_status_e::success;
    } while (0);

    return status;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
pushq $0x1
popq %rbx
cmpb $0x0, (%rdi)
je 0x32e3
movq %rsi, %r14
movq %rdi, %r12
callq 0x2040
movq %rax, %r15
andl $0x0, (%rax)
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x21d0
movq (%r13), %rcx
cmpb $0x0, (%rcx)
jne 0x32e3
movl (%r15), %ecx
cmpl $0x22, %ecx
sete %dl
cmpq $-0x1, %rax
sete %sil
pushq $0x2
popq %rbx
testb %sil, %dl
jne 0x32e3
testq %rax, %rax
sete %dl
testl %ecx, %ecx
setne %cl
testb %cl, %dl
jne 0x32e0
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x32e3
movw %ax, (%r14)
xorl %ebx, %ebx
jmp 0x32e3
pushq $0x3
popq %rbx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/mpeg2ts_parser.cpp
// Function: ymn::mpeg2ts_parser::waiting_for_sync()
mpeg2ts_parser_status_e mpeg2ts_parser::waiting_for_sync()
{
    mpeg2ts_parser_status_e status = mpeg2ts_parser_status_e::NOT_SYNCHRONIZED;

    for (std::size_t n = 0; n < mpeg2ts_parser_packet_sizes_elements; ++n) {
        int offset;
        std::size_t packet_size = mpeg2ts_parser_packet_sizes[n];

        if (m_flatbuffer.read_available() < (packet_size * (MPEG2TS_PARSER_FORWARD_SCAN + 1))) {
            status = mpeg2ts_parser_status_e::NEED_BYTES;
            break;
        }

        offset = synchronize(packet_size);
        if (MPEG2TS_PARSER_NO_SYNC_INDICATOR != offset) {
            m_flatbuffer.consume(offset);
            m_state_function = &mpeg2ts_parser::synchronized;
            m_tspacket_size = packet_size;
            status = mpeg2ts_parser_status_e::SYNC_GAINED;
            break;
        }
    }

    if (mpeg2ts_parser_status_e::NOT_SYNCHRONIZED == status)
        m_flatbuffer.consume(MPEG2TS_PARSER_PACKET_SIZE);

    return status;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x88(%rdi), %r15
xorl %r12d, %r12d
leaq 0x111f3(%rip), %r13     # 0x14560
cmpq $0x18, %r12
je 0x33cf
movq (%r12,%r13), %r14
imulq $0xb, %r14, %rax
cmpq %rax, %r15
jb 0x33f1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32f4
addq $0x8, %r12
cmpl $-0x1, %eax
je 0x336d
cltq
cmpq %rax, %r15
cmovbq %r15, %rax
addq %rax, 0x80(%rbx)
subq %rax, %r15
movq %r15, 0x88(%rbx)
leaq 0x49(%rip), %rax        # 0x33fe
movq %rax, 0x108(%rbx)
andq $0x0, 0x110(%rbx)
movq %r14, 0x118(%rbx)
pushq $0x1
jmp 0x33ee
movl $0xbc, %eax
cmpq %rax, %r15
cmovbq %r15, %rax
addq %rax, 0x80(%rbx)
subq %rax, %r15
movq %r15, 0x88(%rbx)
pushq $0x4
popq %rax
jmp 0x33f3
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/mpeg2ts_parser.cpp
// Function: ymn::mpeg2ts_parser::transport_rate::calculate(unsigned char const*)
bool mpeg2ts_parser::transport_rate::calculate(const uint8_t* tsp)
{
    bool status = false;

    if (0 == m_transport_rate) {
        mpeg2ts_pid pid = mpeg2ts_parser_get_pid(tsp);

        if (MPEG2TS_PID_INVALID == m_pcr_pid) {
           if (mpeg2ts_parser_has_pcr(tsp)) { /* 1st pcr */
              m_pcr1 = mpeg2ts_parser_get_pcr(tsp);
              m_pcr_pid = pid;
           }
        }
        else {
           m_no_of_packets++;
           if (pid == m_pcr_pid) {
              if (mpeg2ts_parser_has_pcr(tsp)) { /* 2nd pcr */
                 m_pcr2 = mpeg2ts_parser_get_pcr(tsp);
                 if (m_pcr2 > m_pcr1) {
                     m_transport_rate = m_no_of_packets * 27000000 /
                         (m_pcr2 - m_pcr1);
                     status = true;
                 }
                 else {
                     m_pcr1 = m_pcr2;
                     m_no_of_packets = 0;
                 }
              }
           }
        }
    }
    else
        status = true;

    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movb $0x1, %bl
cmpq $0x0, 0x20(%rdi)
jne 0x3522
movq %rsi, %r15
movq %rdi, %r14
movzbl 0x1(%rsi), %ebp
movzbl 0x2(%rsi), %eax
andl $0x1f, %ebp
shll $0x8, %ebp
orl %eax, %ebp
movl (%rdi), %eax
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x34d5
movq %r15, %rdi
callq 0x352d
testb %al, %al
je 0x3520
movq %r15, %rdi
callq 0x3545
movq %rax, 0x8(%r14)
movl %ebp, (%r14)
jmp 0x3520
movq 0x18(%r14), %r12
incq %r12
movq %r12, 0x18(%r14)
cmpl %eax, %ebp
jne 0x3520
movq %r15, %rdi
callq 0x352d
testb %al, %al
je 0x3520
movq %r15, %rdi
callq 0x3545
movq %rax, 0x10(%r14)
movq %rax, %rcx
subq 0x8(%r14), %rcx
jbe 0x3517
imulq $0x19bfcc0, %r12, %rax  # imm = 0x19BFCC0
xorl %edx, %edx
divq %rcx
movq %rax, 0x20(%r14)
jmp 0x3522
movq %rax, 0x8(%r14)
andq $0x0, 0x18(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::get_structure(ymn::h264_parser_structure_e, int)
const h264_structure* h264_parser::get_structure(h264_parser_structure_e structure, int id)
{
    const h264_structure* retval = nullptr;

    switch (structure) {
        case h264_parser_structure_e::AUD:
            retval = &m_aud;
            break;

        case h264_parser_structure_e::SPS:
            if (id == H264_PARSER_STRUCTURE_ID_RECENT)
                id = m_recent_sps;
            if ((id >= 0) && (id < H264_PARSER_MAX_NUMBER_OF_SPS))
                retval = &m_sps_table[id];
            break;

        case h264_parser_structure_e::PPS:
            if (id == H264_PARSER_STRUCTURE_ID_RECENT)
                id = m_recent_pps;
            if ((id >= 0) && (id < H264_PARSER_MAX_NUMBER_OF_PPS))
                retval = &m_pps_table[id];
            break;

        case h264_parser_structure_e::SEI:
            retval = &m_sei;
            break;

        case h264_parser_structure_e::SLICE_HEADER:
            retval = &m_slice_header;
            break;

        case h264_parser_structure_e::SLICE_DATA:
            retval = &m_slice_data;
            break;

        default:
            return nullptr;
    }

    return retval && retval->is_valid() ? retval : nullptr;
}

// Assembly:
cmpl $0x5, %esi
ja 0x3631
movl %esi, %eax
leaq 0x10fb8(%rip), %rcx     # 0x14578
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x118, %rdi            # imm = 0x118
jmp 0x363b
addq $0x87960, %rdi          # imm = 0x87960
jmp 0x363b
cmpl $-0x1, %edx
jne 0x35e6
movl 0x87930(%rdi), %edx
cmpl $0xff, %edx
ja 0x3631
movl %edx, %eax
imulq $0x718, %rax, %rax      # imm = 0x718
addq %rax, %rdi
addq $0x16130, %rdi          # imm = 0x16130
jmp 0x363b
addq $0x87938, %rdi          # imm = 0x87938
jmp 0x363b
cmpl $-0x1, %edx
jne 0x3617
movl 0x16128(%rdi), %edx
cmpl $0x1f, %edx
ja 0x3631
movl %edx, %eax
imulq $0xb00, %rax, %rax      # imm = 0xB00
addq %rax, %rdi
addq $0x128, %rdi            # imm = 0x128
jmp 0x363b
xorl %eax, %eax
retq
addq $0x882e0, %rdi          # imm = 0x882E0
xorl %eax, %eax
cmpb $0x0, 0x8(%rdi)
cmovneq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::find_nal_unit()
int h264_parser::find_nal_unit()
{
    std::size_t i, limit, available;
    const uint8_t* s;
    const uint8_t* p;

    s = m_flatbuffer.get_bookmark();
    if (NULL == s) {
        if (find_next_start_code()) {
            m_flatbuffer.set_bookmark();
            s = m_flatbuffer.get_bookmark();
        }
        else
            return 0; /* have not found start of a nal unit */
    }

    available = m_flatbuffer.read_available();
    if (available < 3)
        return 0; /* not enough room to find end of a nal unit */

    limit = available - 3;

    p = m_flatbuffer.read_ptr();
    i = 0;
    while ((i <= limit) && ((p[i] != 0x00) || (p[i + 1] != 0x00) || (p[i + 2] > 0x01)))
        i++;

    m_flatbuffer.consume(i);

    if (i > limit)
        return -1; /* have not found end of a nal unit */

    return &p[i] - s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0xa0(%rdi), %rcx
movq 0xc0(%rdi), %rdx
testq %rcx, %rcx
sets %al
testq %rdx, %rdx
sete %sil
orb %al, %sil
cmpb $0x1, %sil
jne 0x3704
movq %rbx, %rdi
callq 0x3646
testb %al, %al
je 0x3714
movq 0x80(%rbx), %rax
movq 0xc0(%rbx), %rdx
movq %rax, 0xa0(%rbx)
leaq (%rdx,%rax), %rsi
xorl %ecx, %ecx
testq %rax, %rax
cmovnsq %rsi, %rcx
jmp 0x3707
addq %rdx, %rcx
movq 0x88(%rbx), %rdi
cmpq $0x3, %rdi
jae 0x3718
xorl %eax, %eax
jmp 0x3773
leaq -0x3(%rdi), %r10
movq 0x80(%rbx), %rsi
leaq -0x2(%rdi), %r8
movq %rsi, %r9
negq %r9
leaq (%rsi,%rdx), %r11
addq $0x2, %r11
xorl %eax, %eax
cmpq %r10, %rax
ja 0x375b
cmpb $0x0, -0x2(%r11,%rax)
jne 0x3753
cmpb $0x0, -0x1(%r11,%rax)
jne 0x3753
cmpb $0x2, (%r11,%rax)
jb 0x3775
incq %rax
decq %r9
jmp 0x3737
addq %rsi, %r8
movq %r8, 0x80(%rbx)
movq $0x2, 0x88(%rbx)
pushq $-0x1
popq %rax
popq %rbx
retq
negq %r9
movq %r9, 0x80(%rbx)
subq %rax, %rdi
movq %rdi, 0x88(%rbx)
addl %edx, %esi
subl %ecx, %esi
addl %esi, %eax
jmp 0x3773
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_list_4x4(ymn::istream<0>&, ymn::h264::scaling_list_nxn<16ul> (&) [6], int)
void h264_parser::parse_scaling_list_4x4(istream_be& s, h264::scaling_list_4x4 (&lists)[SL_4x4_NUM], int list)
{
    do {
        h264::scaling_list_4x4& sl = lists[list];

        if (!s.read_bits(1, sl.scaling_list_present_flag)) {
            s.mark_corrupted();
            break;
        }

        if (sl.scaling_list_present_flag)
            parse_scaling_list(s, sl.scaling_list, h264::scaling_list_default_4x4[list / 3]);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        sl.set_valid(true);
    } while (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movslq %ecx, %r12
shlq $0x5, %r12
leaq (%rdx,%r12), %r15
addq $0xc, %r15
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x5fee
testb %al, %al
je 0x3854
addq %r12, %rbx
cmpl $0x0, (%r15)
je 0x386f
leaq 0x10(%rbx), %r12
pushq $0x3
popq %rcx
movl %ebp, %eax
cltd
idivl %ecx
cltq
shlq $0x4, %rax
leaq 0x1170d(%rip), %rcx     # 0x14f00
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
movb $0x8, %al
xorl %ebp, %ebp
leaq 0x1179a(%rip), %r13     # 0x14fa0
movb $0x8, %r15b
cmpq $0x10, %rbp
je 0x386f
testb %al, %al
je 0x382d
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x644a
testb %al, %al
je 0x386a
movb 0xc(%rsp), %al
addb %r15b, %al
jmp 0x382f
xorl %eax, %eax
testq %rbp, %rbp
jne 0x3838
testb %al, %al
je 0x385b
testb %al, %al
movzbl %al, %ecx
movzbl %r15b, %r15d
cmovnel %ecx, %r15d
movzbl (%rbp,%r13), %ecx
movb %r15b, (%r12,%rcx)
incq %rbp
jmp 0x3809
orb $0x4, 0x20(%r14)
jmp 0x387a
movq 0x10(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, (%r12)
jmp 0x386f
orb $0x4, 0x20(%r14)
cmpl $0x0, 0x20(%r14)
jne 0x387a
movb $0x1, 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_list_8x8(ymn::istream<0>&, ymn::h264::scaling_list_nxn<64ul> (&) [6], int)
void h264_parser::parse_scaling_list_8x8(istream_be& s, h264::scaling_list_8x8 (&lists)[SL_8x8_NUM], int list)
{
    do {
        h264::scaling_list_8x8& sl = lists[list];

        if (!s.read_bits(1, sl.scaling_list_present_flag)) {
            s.mark_corrupted();
            break;
        }

        if (sl.scaling_list_present_flag)
            parse_scaling_list(s, sl.scaling_list, h264::scaling_list_default_8x8[list % 2]);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        sl.set_valid(true);
    } while (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movslq %ecx, %rax
imulq $0x50, %rax, %r12
leaq (%rdx,%r12), %r15
addq $0xc, %r15
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x5fee
testb %al, %al
je 0x394d
addq %r12, %rbx
cmpl $0x0, (%r15)
je 0x3986
leaq 0x10(%rbx), %r12
pushq $0x2
popq %rcx
movl %ebp, %eax
cltd
idivl %ecx
movslq %edx, %rax
shlq $0x6, %rax
leaq 0x11634(%rip), %rcx     # 0x14f20
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
movb $0x8, %al
xorl %ebp, %ebp
leaq 0x116b1(%rip), %r13     # 0x14fb0
movb $0x8, %r15b
cmpq $0x40, %rbp
je 0x3986
testb %al, %al
je 0x3926
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0x644a
testb %al, %al
je 0x3981
movb 0xc(%rsp), %al
addb %r15b, %al
jmp 0x3928
xorl %eax, %eax
testq %rbp, %rbp
jne 0x3931
testb %al, %al
je 0x3954
testb %al, %al
movzbl %al, %ecx
movzbl %r15b, %r15d
cmovnel %ecx, %r15d
movzbl (%rbp,%r13), %ecx
movb %r15b, (%r12,%rcx)
incq %rbp
jmp 0x3902
orb $0x4, 0x20(%r14)
jmp 0x3991
movq 0x10(%rsp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movups %xmm3, 0x30(%r12)
movups %xmm2, 0x20(%r12)
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
jmp 0x3986
orb $0x4, 0x20(%r14)
cmpl $0x0, 0x20(%r14)
jne 0x3991
movb $0x1, 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_matrices_4x4(ymn::istream<0>&, ymn::h264::scaling_matrices&)
void h264_parser::parse_scaling_matrices_4x4(istream_be& s, h264::scaling_matrices& sm)
{
    do {
        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTRA_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTRA_Cb);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTRA_Cr);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTER_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTER_Cb);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_4x4(s, sm.scaling_matrices_4x4, SL_4x4_INTER_Cr);
        if (s.status() != ISTREAM_STATUS_OK)
            break;
    } while (0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
addq $0x10, %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x3792
cmpl $0x0, 0x20(%r14)
jne 0x3a13
pushq $0x1
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3792
cmpl $0x0, 0x20(%r14)
jne 0x3a13
pushq $0x2
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3792
cmpl $0x0, 0x20(%r14)
jne 0x3a13
pushq $0x3
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3792
cmpl $0x0, 0x20(%r14)
jne 0x3a13
pushq $0x4
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3792
cmpl $0x0, 0x20(%r14)
je 0x3a1b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x5
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3792
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_matrices_8x8(ymn::istream<0>&, ymn::h264::scaling_matrices&, unsigned int)
void h264_parser::parse_scaling_matrices_8x8(istream_be& s, h264::scaling_matrices& sm, uint32_t chroma_format_idc)
{
    do {
        parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTRA_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTER_Y);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        if (3 == chroma_format_idc) {
            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTRA_Cb);
            if (s.status() != ISTREAM_STATUS_OK)
                break;

            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTER_Cb);
            if (s.status() != ISTREAM_STATUS_OK)
                break;

            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTRA_Cr);
            if (s.status() != ISTREAM_STATUS_OK)
                break;

            parse_scaling_list_8x8(s, sm.scaling_matrices_8x8, SL_8x8_INTER_Cr);
            if (s.status() != ISTREAM_STATUS_OK)
                break;
        }
    } while (0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
addq $0xd0, %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x388a
cmpl $0x0, 0x20(%r14)
je 0x3a59
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x1
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x388a
cmpl $0x3, %ebp
jne 0x3a54
cmpl $0x0, 0x20(%r14)
jne 0x3a54
pushq $0x2
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x388a
cmpl $0x0, 0x20(%r14)
jne 0x3a54
pushq $0x3
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x388a
cmpl $0x0, 0x20(%r14)
jne 0x3a54
pushq $0x4
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x388a
cmpl $0x0, 0x20(%r14)
jne 0x3a54
pushq $0x5
popq %rcx
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x388a
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_scaling_matrices(ymn::istream<0>&, ymn::h264::scaling_matrices&, bool, unsigned int)
bool h264_parser::parse_scaling_matrices(istream_be& s, h264::scaling_matrices& sm, bool parse8x8, uint32_t chroma_format_idc)
{
    bool retval = false;

    do {
        parse_scaling_matrices_4x4(s, sm);
        if (s.status() != ISTREAM_STATUS_OK)
            break;

        if (parse8x8) {
            parse_scaling_matrices_8x8(s, sm, chroma_format_idc);
            if (s.status() != ISTREAM_STATUS_OK)
                break;
        }

        sm.set_valid(true);
        retval = true;
    } while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, %r14
callq 0x39a0
cmpl $0x0, 0x20(%r14)
je 0x3ae7
xorl %eax, %eax
jmp 0x3b06
testb %r15b, %r15b
je 0x3b00
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x3a30
cmpl $0x0, 0x20(%r14)
jne 0x3ae3
movb $0x1, 0x8(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_hrd_parameters(ymn::istream<0>&, ymn::h264::hrd_parameters&)
bool h264_parser::parse_hrd_parameters(istream_be& s, h264::hrd_parameters& hrd)
{
    bool retval = false;

    do {
        if (!CHK_EXPR(s.read_exp_golomb_u(hrd.cpb_cnt_minus1), std::cout) ||
            !CHK_STRUCT_RANGE(hrd, cpb_cnt_minus1, 0U, 31U, std::cout)) {
            s.mark_corrupted();
            break;
        }

        s.read_bits(4, hrd.bit_rate_scale);
        s.read_bits(4, hrd.cpb_size_scale);

        for (uint32_t schedSelIdx = 0;
            (schedSelIdx <= hrd.cpb_cnt_minus1) && (s.status() == ISTREAM_STATUS_OK);
           ++schedSelIdx) {
            s.read_exp_golomb_u(hrd.bit_rate_value_minus1[schedSelIdx]);
            s.read_exp_golomb_u(hrd.cpb_size_value_minus1[schedSelIdx]);
            s.read_bits(1, hrd.cbr_flag[schedSelIdx]);
        }

        s.read_bits(5, hrd.initial_cpb_removal_delay_length_minus1);
        s.read_bits(5, hrd.cpb_removal_delay_length_minus1);
        s.read_bits(5, hrd.dpb_output_delay_length_minus1);
        s.read_bits(5, hrd.time_offset_length);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        hrd.set_valid(true);
        retval = true;
    } while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0xc(%rdx), %r13
movq %rsi, %rdi
movq %r13, %rsi
callq 0x6160
movzbl %al, %esi
leaq 0x10b56(%rip), %rdi     # 0x14695
movq 0x1a47a(%rip), %rdx     # 0x1dfc0
callq 0x6109
testb %al, %al
je 0x3c00
movl (%r13), %esi
leaq 0x10b5f(%rip), %rdi     # 0x146bd
movq 0x1a45b(%rip), %r8      # 0x1dfc0
xorl %r12d, %r12d
pushq $0x1f
popq %rcx
xorl %edx, %edx
callq 0x61f6
testb %al, %al
je 0x3c00
leaq 0x10(%rbx), %rdx
pushq $0x4
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x5fee
leaq 0x14(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x5fee
leaq 0x18(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rax
addq $0x98, %rbx
movq %rax, 0x8(%rsp)
leaq 0x118(%rax), %rbp
cmpl (%r13), %r12d
ja 0x3c16
cmpl $0x0, 0x20(%r14)
jne 0x3c16
movl %r12d, %r15d
movq 0x10(%rsp), %rax
leaq (%rax,%r15,4), %rsi
movq %r14, %rdi
callq 0x6160
leaq (%rbx,%r15,4), %rsi
movq %r14, %rdi
callq 0x6160
leaq (,%r15,4), %rdx
addq %rbp, %rdx
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x5fee
incl %r12d
jmp 0x3bb8
orb $0x4, 0x20(%r14)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rbx
leaq 0x198(%rbx), %rdx
pushq $0x5
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x5fee
leaq 0x19c(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x5fee
leaq 0x1a0(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x5fee
leaq 0x1a4(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x5fee
cmpl $0x0, 0x20(%r14)
jne 0x3c05
movb $0x1, 0x8(%rbx)
movb $0x1, %al
jmp 0x3c07
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_ref_pic_list_modification(ymn::istream<0>&, ymn::h264::ref_pic_list_modification&)
bool h264_parser::parse_ref_pic_list_modification(istream_be& s, h264::ref_pic_list_modification& rplm)
{
    bool retval = false;

    do {
        s.read_bits(1, rplm.ref_pic_list_modification_flag_lx);
        if (rplm.ref_pic_list_modification_flag_lx) {
            size_t i = 0;
            uint32_t modification_of_pic_nums_idc;
            uint32_t abs_diff_pic_num_minus1;
            uint32_t long_term_pic_num;

            do {
                s.read_exp_golomb_u(modification_of_pic_nums_idc);

                if (modification_of_pic_nums_idc == 0 || modification_of_pic_nums_idc == 1)
                    s.read_exp_golomb_u(abs_diff_pic_num_minus1);
                else
                if (modification_of_pic_nums_idc == 2)
                    s.read_exp_golomb_u(long_term_pic_num);

                if (i < TABLE_ELEMENTS(rplm.m)) {
                    rplm.m[i].modification_of_pic_nums_idc = modification_of_pic_nums_idc;
                    if (modification_of_pic_nums_idc == 0 || modification_of_pic_nums_idc == 1)
                        rplm.m[i].u.abs_diff_pic_num_minus1 = abs_diff_pic_num_minus1;
                    else
                    if (modification_of_pic_nums_idc == 2)
                        rplm.m[i].u.long_term_pic_num = long_term_pic_num;
                }

                i++;
            } while ((s.status() == ISTREAM_STATUS_OK) && (modification_of_pic_nums_idc != 3));
        }

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        rplm.set_valid(true);
        retval = true;
    }while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
addq $0xc, %rdx
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x5fee
cmpl $0x0, 0xc(%rbx)
je 0x3f98
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
leaq 0x14(%rsp), %r13
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
movq %r15, %rsi
callq 0x6160
movl 0xc(%rsp), %eax
movq %r13, %rsi
cmpl $0x2, %eax
jb 0x3f5b
movq %rbp, %rsi
jne 0x3f67
movq %r14, %rdi
callq 0x6160
movl 0xc(%rsp), %eax
cmpq $0x3, %r12
ja 0x3f86
movl %eax, 0x10(%rbx,%r12,8)
movq %r13, %rcx
cmpl $0x2, %eax
jb 0x3f7f
movq %rbp, %rcx
jne 0x3f86
movl (%rcx), %ecx
movl %ecx, 0x14(%rbx,%r12,8)
movl 0x20(%r14), %ecx
testl %ecx, %ecx
jne 0x3f9c
incq %r12
cmpl $0x3, %eax
jne 0x3f3f
jmp 0x3f9c
movl 0x20(%r14), %ecx
testl %ecx, %ecx
jne 0x3fa4
movb $0x1, 0x8(%rbx)
testl %ecx, %ecx
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_pred_weight_table(ymn::istream<0>&, ymn::h264::pred_weight_table&)
bool h264_parser::parse_pred_weight_table(istream_be& s, h264::pred_weight_table& pwt)
{
    bool retval = false;

    do {
        s.read_exp_golomb_u(pwt.luma_log2_weight_denom);
        if (pwt.chroma_components_present)
            s.read_exp_golomb_u(pwt.chroma_log2_weight_denom);

        h264_parser_parse_pred_weight_table_lx(s, pwt.l0, pwt.num_ref_idx_l0_active_minus1, pwt.chroma_components_present);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        if (h264::slice_type_e::B == pwt.slice_type)
            h264_parser_parse_pred_weight_table_lx(s, pwt.l1, pwt.num_ref_idx_l1_active_minus1, pwt.chroma_components_present);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        pwt.set_valid(true);
        retval = true;
    } while (0);

    return retval;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x14(%rdx), %rsi
movq %r14, %rdi
callq 0x6160
cmpb $0x1, 0x10(%rbx)
jne 0x3fe5
leaq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x6160
movb 0x10(%rbx), %al
jmp 0x3fe7
xorl %eax, %eax
leaq 0x20(%rbx), %rsi
movl 0x1c(%rbx), %edx
movzbl %al, %ecx
andl $0x1, %ecx
movq %r14, %rdi
callq 0x403b
cmpl $0x0, 0x20(%r14)
je 0x4007
xorl %eax, %eax
jmp 0x4033
cmpl $0x1, 0xc(%rbx)
jne 0x402d
leaq 0x424(%rbx), %rsi
movl 0x420(%rbx), %edx
movzbl 0x10(%rbx), %ecx
movq %r14, %rdi
callq 0x403b
cmpl $0x0, 0x20(%r14)
jne 0x4003
movb $0x1, 0x8(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: h264_parser_parse_pred_weight_table_lx(ymn::istream<0>&, ymn::h264::pred_weight_table::lx&, unsigned int, bool)
static void h264_parser_parse_pred_weight_table_lx(
    istream_be& s, h264::pred_weight_table::lx& lx, uint32_t num_ref_idx_lx_active_minus1, bool chroma_components_present)
{
    for (uint32_t i = 0;
        (i <= num_ref_idx_lx_active_minus1) && (s.status() == ISTREAM_STATUS_OK);
       ++i) {
        s.read_bits(1, lx.luma_weight_lx_flag[i]);
        if (lx.luma_weight_lx_flag[i]) {
            s.read_exp_golomb_s(lx.luma_weight_lx[i]);
            s.read_exp_golomb_s(lx.luma_offset_lx[i]);
        }
        if (chroma_components_present) {
            s.read_bits(1, lx.chroma_weight_lx_flag[i]);
            if (lx.chroma_weight_lx_flag[i]) {
                s.read_exp_golomb_s(lx.chroma_weight_lx[i][0]);
                s.read_exp_golomb_s(lx.chroma_offset_lx[i][0]);
                s.read_exp_golomb_s(lx.chroma_weight_lx[i][1]);
                s.read_exp_golomb_s(lx.chroma_offset_lx[i][1]);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, 0x4(%rsp)
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x80(%rsi), %rax
movq %rax, 0x30(%rsp)
leaq 0x100(%rsi), %rax
movq %rax, 0x28(%rsp)
leaq 0x180(%rsi), %rax
movq %rax, 0x20(%rsp)
leaq 0x200(%rsi), %rax
movq %rax, 0x18(%rsp)
leaq 0x300(%rsi), %rax
movq %rax, 0x10(%rsp)
xorl %r12d, %r12d
movq %rsi, 0x8(%rsp)
cmpl %ebp, %r12d
ja 0x4179
cmpl $0x0, 0x20(%r15)
jne 0x4179
movl %r12d, %ebx
leaq (%r14,%rbx,4), %r13
movq %r15, %rdi
pushq $0x1
popq %rsi
movq %r13, %rdx
callq 0x5fee
cmpl $0x0, (%r13)
je 0x40eb
movq 0x30(%rsp), %rax
leaq (%rax,%rbx,4), %rsi
movq %r15, %rdi
callq 0x644a
movq 0x28(%rsp), %rax
leaq (%rax,%rbx,4), %rsi
movq %r15, %rdi
callq 0x644a
cmpb $0x0, 0x4(%rsp)
je 0x4171
movq 0x20(%rsp), %rax
leaq (%rax,%rbx,4), %r13
movq %r15, %rdi
pushq $0x1
popq %rsi
movq %r13, %rdx
callq 0x5fee
cmpl $0x0, (%r13)
je 0x4171
movq 0x18(%rsp), %r13
leaq (,%rbx,8), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x644a
movl %ebp, %r14d
movq 0x10(%rsp), %rbp
leaq (,%rbx,8), %rsi
addq %rbp, %rsi
movq %r15, %rdi
callq 0x644a
leaq 0x4(,%rbx,8), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x644a
leaq 0x4(,%rbx,8), %rsi
addq %rbp, %rsi
movl %r14d, %ebp
movq 0x8(%rsp), %r14
movq %r15, %rdi
callq 0x644a
incl %r12d
jmp 0x4099
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_dec_ref_pic_marking_idr(ymn::istream<0>&, ymn::h264::dec_ref_pic_marking_idr&)
bool h264_parser::parse_dec_ref_pic_marking_idr(istream_be& s, h264::dec_ref_pic_marking_idr& drpm)
{
    bool retval = false;

    do {
        s.read_bits(1, drpm.no_output_of_prior_pics_flag);
        s.read_bits(1, drpm.long_term_reference_flag);

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        drpm.set_valid(true);
        retval = true;
    } while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
addq $0xc, %rdx
pushq $0x1
popq %rbp
movq %rsi, %rdi
movl %ebp, %esi
callq 0x5fee
leaq 0x10(%rbx), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x5fee
movl 0x20(%r14), %eax
testl %eax, %eax
jne 0x41bd
movb $0x1, 0x8(%rbx)
testl %eax, %eax
sete %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_aud(ymn::istream<0>&)
h264_parser_status_e h264_parser::parse_aud(istream_be& s)
{
    h264_parser_status_e retval = h264_parser_status_e::NAL_UNIT_CORRUPTED;

    do {
        h264::aud& aud = m_aud;
        aud.reset();

        if (!CHK_EXPR(s.read_bits(3, aud.primary_pic_type), std::cout) ||
            !CHK_STRUCT_RANGE(aud, primary_pic_type, 0U, 7U, std::cout)) {
            s.mark_corrupted();
            break;
        }

        if (s.status() != ISTREAM_STATUS_OK)
            break;

        aud.set_valid(true);
        retval = h264_parser_status_e::AUD_PARSED;
    } while (0);

    return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movb $0x0, 0x120(%rdi)
leaq 0x124(%rdi), %r12
pushq $0x3
popq %rbx
movq %rsi, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x5fee
movzbl %al, %esi
leaq 0x10392(%rip), %rdi     # 0x146d0
movq 0x19c7b(%rip), %rdx     # 0x1dfc0
callq 0x6109
testb %al, %al
je 0x437f
movl (%r12), %esi
leaq 0x1039c(%rip), %rdi     # 0x146f5
movq 0x19c60(%rip), %r8      # 0x1dfc0
pushq $0x7
popq %rcx
xorl %edx, %edx
callq 0x61f6
testb %al, %al
je 0x437f
cmpl $0x0, 0x20(%r15)
jne 0x4384
movb $0x1, 0x120(%r14)
jmp 0x4387
orb $0x4, 0x20(%r15)
pushq $0x2
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_sei(ymn::istream<0>&)
h264_parser_status_e h264_parser::parse_sei(istream_be& s)
{
    h264_parser_status_e retval = h264_parser_status_e::NAL_UNIT_CORRUPTED;

    do {
        bool status;
        uint8_t last;

        h264::sei& sei = m_sei;
        sei.reset();

        sei.payload_type = 0;
        sei.payload_size = 0;

        while ((true == (status = s.read_u8(last))) && 0xff == last)
            sei.payload_type += 255;

        if (status)
            sei.payload_type += last;
        else
            break;

        while ((true == (status = s.read_u8(last))) && 0xff == last)
            sei.payload_size += 255;

        if (status)
            sei.payload_size += last;
        else
            break;

        uint32_t i = 0;
        while ((i < sei.payload_size) && (i < sizeof(sei.payload_data)) && (true == (status = s.read_u8(sei.payload_data[i]))))
            ++i;

        if (!status)
            break;

        sei.set_valid(true);
        retval = h264_parser_status_e::SEI_PARSED;
    } while (0);

    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, 0x87940(%rdi)
andq $0x0, 0x87944(%rdi)
leaq 0xf(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x692a
movb 0xf(%rsp), %cl
testb %al, %al
je 0x5420
cmpb $-0x1, %cl
jne 0x5420
addl $0xff, 0x87944(%rbx)
jmp 0x53fc
pushq $0x2
popq %rbp
testb %al, %al
je 0x54a0
movzbl %cl, %eax
addl %eax, 0x87944(%rbx)
leaq 0xf(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x692a
movb 0xf(%rsp), %cl
testb %al, %al
je 0x5459
cmpb $-0x1, %cl
jne 0x5459
addl $0xff, 0x87948(%rbx)
jmp 0x5435
testb %al, %al
je 0x54a0
movzbl %cl, %eax
addl %eax, 0x87948(%rbx)
leaq 0x8794c(%rbx), %r15
xorl %r12d, %r12d
cmpq $0xf, %r12
ja 0x5496
movl 0x87948(%rbx), %eax
cmpq %rax, %r12
jae 0x5496
leaq (%r15,%r12), %rsi
movq %r14, %rdi
callq 0x692a
incq %r12
testb %al, %al
jne 0x5470
jmp 0x54a0
movb $0x1, 0x87940(%rbx)
pushq $0x6
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_nal_unit(ymn::istream<0>&)
h264_parser_status_e h264_parser::parse_nal_unit(istream_be& s)
{
    uint8_t nal_header;
    uint32_t nal_ref_idc;
    uint32_t nal_unit_type;
    bool status;

    status = s.read_u8(nal_header);
    if (!status)
        return h264_parser_status_e::NAL_UNIT_CORRUPTED;

    nal_ref_idc = (nal_header & 0x60) >> 5;
    nal_unit_type = nal_header & 0x1f;

    std::cout << std::endl;
    std::cout << "nal_unit_type: " << nal_unit_type;
    std::cout << " '" << ymn::to_string(static_cast<nal_unit_type_e>(nal_unit_type)) << "'";
    std::cout << " size: " << s.size();
    std::cout << std::endl;

    switch (static_cast<nal_unit_type_e>(nal_unit_type)) {
        case nal_unit_type_e::AUD:
            return parse_aud(s);

        case nal_unit_type_e::SPS:
            return parse_sps(s);

        case nal_unit_type_e::PPS:
            return parse_pps(s);

        case nal_unit_type_e::SEI:
            return parse_sei(s);

        case nal_unit_type_e::CODED_SLICE_NON_IDR_PICTURE:
        case nal_unit_type_e::CODED_SLICE_IDR_PICTURE:
            return parse_slice_header(s, nal_ref_idc, nal_unit_type);

        default:
            break;
    }

    return h264_parser_status_e::NAL_UNIT_SKIPPED;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7(%rsp), %rsi
movq %rbx, %rdi
callq 0x692a
testb %al, %al
je 0x5e71
movzbl 0x7(%rsp), %r15d
movl %r15d, %r12d
andl $0x1f, %r12d
movq 0x18200(%rip), %r13     # 0x1dfc0
movq %r13, %rdi
callq 0x20b0
leaq 0xee56(%rip), %rsi      # 0x14c25
movq %r13, %rdi
callq 0x2120
movq %rax, %rdi
movq %r12, %rsi
callq 0x20e0
leaq 0x12942(%rip), %rsi     # 0x1872b
movq %r13, %rdi
callq 0x2120
movq %rax, %rbp
movl %r12d, %edi
callq 0x3594
movq %rbp, %rdi
movq %rax, %rsi
callq 0x2120
leaq 0x1291e(%rip), %rsi     # 0x1872c
movq %rax, %rdi
callq 0x2120
leaq 0xee18(%rip), %rsi      # 0x14c35
movq %r13, %rdi
callq 0x2120
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x20e0
movq %r13, %rdi
callq 0x20b0
pushq $0x1
popq %rax
leal -0x1(%r12), %ecx
cmpl $0x8, %ecx
ja 0x5e74
leaq 0xe75f(%rip), %rdx      # 0x145ac
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x5, %r15d
andl $0x3, %r15d
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0x54b0
jmp 0x5e74
pushq $0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x53d6
jmp 0x5e74
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4308
jmp 0x5e74
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4396
jmp 0x5e74
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4ac6
jmp 0x5e74
nop
// File: /workspace/github_cpp_makefile_star2_O2/lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::parse_byte_stream_nal_units()
h264_parser_status_e h264_parser::parse_byte_stream_nal_units()
{
    h264_parser_status_e status = h264_parser_status_e::NEED_BYTES;
    int num_bytes_in_nal_unit;

    if ((num_bytes_in_nal_unit = find_nal_unit()) > 0) {
        int rbsp_size;
        uint8_t* rbsp_buf;
        const uint8_t* p = m_flatbuffer.get_bookmark();

        rbsp_buf = new uint8_t[num_bytes_in_nal_unit];
        rbsp_size = h264_parser_nal_to_rbsp(rbsp_buf, num_bytes_in_nal_unit, p, num_bytes_in_nal_unit);

        if (rbsp_size > 0) {
            istream_be s(rbsp_buf, rbsp_size);

            status = parse_nal_unit(s);
        }
        else
            status = h264_parser_status_e::NAL_UNIT_CORRUPTED;

        delete [] rbsp_buf;
        m_flatbuffer.clear_bookmark();
    }

    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
callq 0x36ac
testl %eax, %eax
jle 0x5f6a
movq 0xa0(%rbx), %rcx
movq 0xc0(%rbx), %r12
addq %rcx, %r12
xorl %r13d, %r13d
testq %rcx, %rcx
cmovsq %r13, %r12
movl %eax, %r15d
movq %r15, %rdi
callq 0x2030
movq %rax, %r14
leaq -0x1(%r15), %rax
pushq $0x2
popq %rbp
pushq $0x2
popq %rcx
xorl %esi, %esi
xorl %edx, %edx
xorl %edi, %edi
cmpq %r15, %rsi
jae 0x5f6e
cmpq $0x2, %rdi
jne 0x5f4b
cmpb $0x3, (%r12,%rsi)
jb 0x5fcd
jne 0x5f48
cmpq %rax, %rsi
jae 0x5f3c
cmpb $0x3, 0x1(%r12,%rsi)
ja 0x5fcd
cmpq %rax, %rsi
je 0x5f6e
incq %rsi
xorl %edi, %edi
jmp 0x5f4b
movq %rcx, %rdi
cmpq %rdx, %r15
je 0x5fcd
movb (%r12,%rsi), %r8b
movb %r8b, (%r14,%rdx)
incq %rdi
testb %r8b, %r8b
cmovneq %r13, %rdi
incq %rsi
incq %rdx
jmp 0x5f13
xorl %ebp, %ebp
jmp 0x5fdd
testl %edx, %edx
jle 0x5fcd
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x679e
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x5fa5
movq %rsp, %rdi
pushq $0x3
popq %rdx
movq %rdi, %rsi
callq *%rax
leaq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5d86
movl %eax, %ebp
movq 0x38(%r15), %rax
testq %rax, %rax
je 0x5fcd
leaq 0x48(%rsp), %rdi
pushq $0x3
popq %rdx
movq %rdi, %rsi
callq *%rax
movq %r14, %rdi
callq 0x21b0
orq $-0x1, 0xa0(%rbx)
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq