LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: lukasz-wiecaszek[P]h264iframedecoder/./aud.hpp
// Function: ymn::h264::aud::to_string[abi:cxx11]() const
inline std::string aud::to_string() const
{
    std::ostringstream stream;

    stream << "aud (access unit delimiter):" << std::endl;
    stream << P1_INFO(primary_pic_type, primary_pic_type_to_string(primary_pic_type));

    return stream.str();
}

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x1b0(%rsp)
movq %rsi, 0x1a8(%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x2230
leaq 0x30(%rsp), %rdi
leaq 0x1ed99(%rip), %rsi     # 0x23220
callq 0x2140
movq %rax, %rdi
movq 0x29b12(%rip), %rsi     # 0x2dfa8
callq 0x2180
movl $0x2, %edi
callq 0x45f0
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %esi
leaq 0x30(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
leaq 0x23cd1(%rip), %rsi     # 0x28192
callq 0x2140
movq %rax, (%rsp)
movl $0x2e, %edi
callq 0x45f0
movq (%rsp), %rdi
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %esi
callq 0x21b0
movq %rax, %rdi
leaq 0x121(%rip), %rsi       # 0x4610
callq 0x20a0
movq %rax, %rdi
leaq 0x20dce(%rip), %rsi     # 0x252cc
callq 0x2140
movq %rax, %rdi
leaq 0x1fe39(%rip), %rsi     # 0x24346
callq 0x2140
movq %rax, %rdi
leaq 0x1ed21(%rip), %rsi     # 0x2323d
callq 0x2140
movq %rax, %rdi
leaq 0x105(%rip), %rsi       # 0x4630
callq 0x20a0
movq %rax, %rdi
movq 0x8(%rsp), %rax
movl 0xc(%rax), %esi
callq 0x2220
movq %rax, %rdi
leaq 0x1ecf6(%rip), %rsi     # 0x23240
callq 0x2140
movq %rax, %rdi
leaq 0xf7(%rip), %rsi        # 0x4650
callq 0x20a0
movq %rax, %rdi
movq 0x8(%rsp), %rax
movl 0xc(%rax), %esi
callq 0x2220
movq %rax, %rdi
leaq 0x1fe45(%rip), %rsi     # 0x243bd
callq 0x2140
movq %rax, %rdi
leaq 0x1fdbf(%rip), %rsi     # 0x24346
callq 0x2140
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rsp)
movl 0xc(%rax), %edi
callq 0x2610
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x2140
movq %rax, %rdi
movq 0x299f0(%rip), %rsi     # 0x2dfa8
callq 0x2180
movq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2170
leaq 0x30(%rsp), %rdi
callq 0x2080
movq 0x20(%rsp), %rax
addq $0x1b8, %rsp            # imm = 0x1B8
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: lukasz-wiecaszek[P]h264iframedecoder/./dec_ref_pic_marking.hpp
// Function: ymn::h264::dec_ref_pic_marking_idr::to_string[abi:cxx11]() const
inline std::string dec_ref_pic_marking_idr::to_string() const
{
    std::ostringstream stream;

    stream << "  decoded reference picture marking (idr):" << std::endl;
    stream << P2(no_output_of_prior_pics_flag);
    stream << P2(long_term_reference_flag);

    return stream.str();
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x1c0(%rsp)
movq %rsi, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x2230
leaq 0x40(%rsp), %rdi
leaq 0x1652d(%rip), %rsi     # 0x23f94
callq 0x2140
movq %rax, %rdi
movq 0x20532(%rip), %rsi     # 0x2dfa8
callq 0x2180
movl $0x4, %edi
callq 0x45f0
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
leaq 0x1a6f1(%rip), %rsi     # 0x28192
callq 0x2140
movq %rax, 0x8(%rsp)
movl $0x2c, %edi
callq 0x45f0
movq 0x8(%rsp), %rdi
movl %eax, 0x38(%rsp)
movl 0x38(%rsp), %esi
callq 0x21b0
movq %rax, %rdi
leaq -0x94c1(%rip), %rsi     # 0x4610
callq 0x20a0
movq %rax, %rdi
leaq 0x164df(%rip), %rsi     # 0x23fbf
callq 0x2140
movq %rax, %rdi
leaq 0x16857(%rip), %rsi     # 0x24346
callq 0x2140
movq %rax, %rdi
leaq 0x1573f(%rip), %rsi     # 0x2323d
callq 0x2140
movq %rax, %rdi
leaq -0x94dd(%rip), %rsi     # 0x4630
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movl 0xc(%rax), %esi
callq 0x2220
movq %rax, %rdi
leaq 0x15714(%rip), %rsi     # 0x23240
callq 0x2140
movq %rax, %rdi
leaq -0x94eb(%rip), %rsi     # 0x4650
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movl 0xc(%rax), %esi
callq 0x2220
movq %rax, %rdi
leaq 0x16863(%rip), %rsi     # 0x243bd
callq 0x2140
movq %rax, %rdi
movq 0x2043f(%rip), %rsi     # 0x2dfa8
callq 0x2180
movl $0x4, %edi
callq 0x45f0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
leaq 0x1a5fe(%rip), %rsi     # 0x28192
callq 0x2140
movq %rax, 0x10(%rsp)
movl $0x2c, %edi
callq 0x45f0
movq 0x10(%rsp), %rdi
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %esi
callq 0x21b0
movq %rax, %rdi
leaq -0x95b4(%rip), %rsi     # 0x4610
callq 0x20a0
movq %rax, %rdi
leaq 0x16409(%rip), %rsi     # 0x23fdc
callq 0x2140
movq %rax, %rdi
leaq 0x16764(%rip), %rsi     # 0x24346
callq 0x2140
movq %rax, %rdi
leaq 0x1564c(%rip), %rsi     # 0x2323d
callq 0x2140
movq %rax, %rdi
leaq -0x95d0(%rip), %rsi     # 0x4630
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x2220
movq %rax, %rdi
leaq 0x15621(%rip), %rsi     # 0x23240
callq 0x2140
movq %rax, %rdi
leaq -0x95de(%rip), %rsi     # 0x4650
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movl 0x10(%rax), %esi
callq 0x2220
movq %rax, %rdi
leaq 0x16770(%rip), %rsi     # 0x243bd
callq 0x2140
movq %rax, %rdi
movq 0x2034c(%rip), %rsi     # 0x2dfa8
callq 0x2180
movq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x2170
leaq 0x40(%rsp), %rdi
callq 0x2080
movq 0x28(%rsp), %rax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
nopw (%rax,%rax)
// File: lukasz-wiecaszek[P]h264iframedecoder/./slice_data.hpp
// Function: ymn::h264::slice_data::to_string[abi:cxx11]() const
inline std::string slice_data::to_string() const
{
    std::ostringstream stream;

    stream << "slice_data:" << std::endl;

    stream << P1(size);
    stream << P1(bit_pos);

    return stream.str();
}

// Assembly:
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x1c0(%rsp)
movq %rsi, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x2230
leaq 0x40(%rsp), %rdi
leaq 0x13bbe(%rip), %rsi     # 0x242b5
callq 0x2140
movq %rax, %rdi
movq 0x1d8a2(%rip), %rsi     # 0x2dfa8
callq 0x2180
movl $0x2, %edi
callq 0x45f0
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
leaq 0x17a61(%rip), %rsi     # 0x28192
callq 0x2140
movq %rax, 0x8(%rsp)
movl $0x2e, %edi
callq 0x45f0
movq 0x8(%rsp), %rdi
movl %eax, 0x38(%rsp)
movl 0x38(%rsp), %esi
callq 0x21b0
movq %rax, %rdi
leaq -0xc151(%rip), %rsi     # 0x4610
callq 0x20a0
movq %rax, %rdi
leaq 0x13565(%rip), %rsi     # 0x23cd5
callq 0x2140
movq %rax, %rdi
leaq 0x13bc7(%rip), %rsi     # 0x24346
callq 0x2140
movq %rax, %rdi
leaq 0x12aaf(%rip), %rsi     # 0x2323d
callq 0x2140
movq %rax, %rdi
leaq -0xc16d(%rip), %rsi     # 0x4630
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x2070
movq %rax, %rdi
leaq 0x12a83(%rip), %rsi     # 0x23240
callq 0x2140
movq %rax, %rdi
leaq -0xc17c(%rip), %rsi     # 0x4650
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rsi
callq 0x2070
movq %rax, %rdi
leaq 0x13bd1(%rip), %rsi     # 0x243bd
callq 0x2140
movq %rax, %rdi
movq 0x1d7ad(%rip), %rsi     # 0x2dfa8
callq 0x2180
movl $0x2, %edi
callq 0x45f0
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %esi
leaq 0x40(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
leaq 0x1796c(%rip), %rsi     # 0x28192
callq 0x2140
movq %rax, 0x10(%rsp)
movl $0x2e, %edi
callq 0x45f0
movq 0x10(%rsp), %rdi
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %esi
callq 0x21b0
movq %rax, %rdi
leaq -0xc246(%rip), %rsi     # 0x4610
callq 0x20a0
movq %rax, %rdi
leaq 0x13a5c(%rip), %rsi     # 0x242c1
callq 0x2140
movq %rax, %rdi
leaq 0x13ad2(%rip), %rsi     # 0x24346
callq 0x2140
movq %rax, %rdi
leaq 0x129ba(%rip), %rsi     # 0x2323d
callq 0x2140
movq %rax, %rdi
leaq -0xc262(%rip), %rsi     # 0x4630
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x2070
movq %rax, %rdi
leaq 0x1298e(%rip), %rsi     # 0x23240
callq 0x2140
movq %rax, %rdi
leaq -0xc271(%rip), %rsi     # 0x4650
callq 0x20a0
movq %rax, %rdi
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rsi
callq 0x2070
movq %rax, %rdi
leaq 0x13adc(%rip), %rsi     # 0x243bd
callq 0x2140
movq %rax, %rdi
movq 0x1d6b8(%rip), %rsi     # 0x2dfa8
callq 0x2180
movq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x2170
leaq 0x40(%rsp), %rdi
callq 0x2080
movq 0x28(%rsp), %rax
addq $0x1c8, %rsp            # imm = 0x1C8
retq
nopl (%rax,%rax)
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rsp), %rsi
callq 0x10b40
movq (%rsp), %rdi
leaq 0x1d2e4(%rip), %rax     # 0x2dc80
movq %rax, (%rdi)
leaq 0xa2a(%rip), %rax       # 0x113d0
movq %rax, 0x108(%rdi)
movq $0x0, 0x110(%rdi)
movq $0x0, 0x118(%rdi)
addq $0x120, %rdi            # imm = 0x120
callq 0x10b90
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, (%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rdi)
addq $0x40, %rdi
movq 0x8(%rsp), %rsi
callq 0x10d00
movq (%rsp), %rax
movq $0x0, 0x80(%rax)
movq (%rax), %rdi
callq 0x2030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x80(%rax)
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: lukasz-wiecaszek[P]h264iframedecoder/./flatbuffer.hpp
// Function: ymn::flatbuffer<unsigned char>::counters::reset(unsigned long)
void reset(std::size_t capacity)
        {
            m_read_idx = 0;
            m_read_avail = 0;
            m_write_idx = 0;
            m_write_avail = capacity;
            m_bookmark_idx = -1;
        }

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq -0x10(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq $-0x1, 0x20(%rax)
retq
nopl (%rax,%rax)
// File: lukasz-wiecaszek[P]h264iframedecoder/./mpeg2ts_parser.hpp
// Function: ymn::mpeg2ts_parser::reset()
void reset()
    {
        base_parser::reset();
        m_state_function = &mpeg2ts_parser::waiting_for_sync;
        m_tspacket_size = 0;
        m_transport_rate.reset();
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x10fd0
movq 0x8(%rsp), %rdi
leaq 0x59c(%rip), %rax       # 0x113d0
movq %rax, 0x108(%rdi)
movq $0x0, 0x110(%rdi)
movq $0x0, 0x118(%rdi)
addq $0x120, %rdi            # imm = 0x120
callq 0x11010
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, 0x60(%rax)
jl 0x10eb0
movq (%rsp), %rax
movq 0x60(%rax), %rcx
movq %rcx, 0x18(%rsp)
movq $0x0, 0x60(%rax)
jmp 0x10ebd
movq (%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jbe 0x10f28
movq (%rsp), %rax
movq 0x50(%rax), %rcx
subq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq 0x40(%rax), %rcx
subq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x80(%rax), %rdi
movq 0x80(%rax), %rsi
addq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
shlq $0x0, %rdx
callq 0x2290
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x40(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x50(%rax)
movq (%rax), %rcx
subq 0x10(%rsp), %rcx
movq %rcx, 0x58(%rax)
addq $0x28, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x58(%rcx), %rax
jbe 0x10f66
movq 0x8(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsp), %rax
movq 0x80(%rax), %rdi
addq 0x50(%rax), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
shlq $0x0, %rdx
callq 0x2110
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
addq 0x50(%rax), %rcx
movq %rcx, 0x50(%rax)
movq 0x10(%rsp), %rdx
movq 0x58(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x58(%rax)
movq 0x10(%rsp), %rcx
addq 0x48(%rax), %rcx
movq %rcx, 0x48(%rax)
movq 0x10(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: lukasz-wiecaszek[P]h264iframedecoder/./mpeg2ts_parser.hpp
// Function: ymn::mpeg2ts_parser::transport_rate::reset()
void reset()
        {
            m_pcr_pid = MPEG2TS_PID_INVALID;
            m_pcr1 = 0;
            m_pcr2 = 0;
            m_no_of_packets = 0;
            m_transport_rate = 0;
        }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
leaq 0xc(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
callq 0x109e0
movq (%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
addq $0x18, %rsp
retq
// File: lukasz-wiecaszek[P]h264iframedecoder/./flatbuffer.hpp
// Function: ymn::flatbuffer<unsigned char>::consume(unsigned long)
std::size_t consume(std::size_t count)
    {
        if (count > m_counters.m_read_avail)
            count = m_counters.m_read_avail;

        m_counters.m_read_idx   += count;
        m_counters.m_read_avail -= count;

        return count;
    }

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rcx
movq %rcx, -0x18(%rsp)
movq -0x10(%rsp), %rax
cmpq 0x48(%rcx), %rax
jbe 0x111bd
movq -0x18(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x10(%rsp)
movq -0x18(%rsp), %rax
movq -0x10(%rsp), %rcx
addq 0x40(%rax), %rcx
movq %rcx, 0x40(%rax)
movq -0x10(%rsp), %rdx
movq 0x48(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x48(%rax)
movq -0x10(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
nop
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl $0x3, 0x24(%rsp)
movq 0x30(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x11220
movl $0x1, 0x24(%rsp)
jmp 0x112d6
callq 0x2040
movl $0x0, (%rax)
movq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x2210
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x11258
movl $0x1, 0x24(%rsp)
jmp 0x112d6
callq 0x2040
movq %rax, %rcx
movl $0x22, %eax
cmpl (%rcx), %eax
jne 0x11281
movq $-0x1, %rax
cmpq 0x18(%rsp), %rax
jne 0x11281
movl $0x2, 0x24(%rsp)
jmp 0x112d6
xorl %eax, %eax
cmpq 0x18(%rsp), %rax
jne 0x1129e
callq 0x2040
cmpl $0x0, (%rax)
je 0x1129e
movl $0x3, 0x24(%rsp)
jmp 0x112d6
movw $0xffff, 0xe(%rsp)      # imm = 0xFFFF
movq 0x18(%rsp), %rax
movzwl 0xe(%rsp), %ecx
cmpq %rcx, %rax
jbe 0x112be
movl $0x2, 0x24(%rsp)
jmp 0x112d6
movq 0x18(%rsp), %rax
movw %ax, %cx
movq 0x28(%rsp), %rax
movw %cx, (%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: lukasz-wiecaszek[P]h264iframedecoder/mpeg2ts_parser.cpp
// Function: ymn::mpeg2ts_parser::synchronize(unsigned long)
int mpeg2ts_parser::synchronize(const std::size_t tspacket_size)
{
    int offset;
    std::size_t i, j;
    const uint8_t *p;

    offset = MPEG2TS_PARSER_NO_SYNC_INDICATOR;
    p = m_flatbuffer.read_ptr();

    for (i = 0;
        ((i < tspacket_size) && (MPEG2TS_PARSER_NO_SYNC_INDICATOR == offset));
        ++i) {
        if (p[i] != MPEG2TS_PARSER_SYNC_BYTE) continue;
        offset = static_cast<int>(i);
        for (j = 1; j <= MPEG2TS_PARSER_FORWARD_SCAN; ++j) {
            if (p[j * tspacket_size + offset] != MPEG2TS_PARSER_SYNC_BYTE) {
                offset = MPEG2TS_PARSER_NO_SYNC_INDICATOR;
                break;
            }
        }
    }

    return offset;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
addq $0x40, %rdi
callq 0x11170
movq %rax, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpq 0x28(%rsp), %rcx
movb %al, 0x7(%rsp)
jae 0x11334
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x24(%rsp), %eax
sete %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x11341
jmp 0x113c2
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x47, %eax
je 0x11356
jmp 0x113af
movq 0x18(%rsp), %rax
movl %eax, 0x24(%rsp)
movq $0x1, 0x10(%rsp)
cmpq $0xa, 0x10(%rsp)
ja 0x113ad
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
imulq 0x28(%rsp), %rcx
movslq 0x24(%rsp), %rdx
addq %rdx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x47, %eax
je 0x1139b
movl $0xffffffff, 0x24(%rsp) # imm = 0xFFFFFFFF
jmp 0x113ad
jmp 0x1139d
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x11368
jmp 0x113af
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x11312
movl 0x24(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x4, 0x2c(%rsp)
movq $0x0, 0x20(%rsp)
cmpq $0x3, 0x20(%rsp)
jae 0x114b2
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rcx
leaq 0x13c6f(%rip), %rax     # 0x25080
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
addq $0x40, %rdi
callq 0x11830
imulq $0xb, 0x10(%rsp), %rcx
cmpq %rcx, %rax
jae 0x11438
movl $0x0, 0x2c(%rsp)
jmp 0x114b2
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x112e0
movl %eax, 0x1c(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x1c(%rsp), %eax
je 0x1149d
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
movslq 0x1c(%rsp), %rsi
callq 0x11190
movq 0x8(%rsp), %rax
leaq 0x6b(%rip), %rcx        # 0x114e0
movq %rcx, 0x108(%rax)
movq $0x0, 0x110(%rax)
movq 0x10(%rsp), %rcx
movq %rcx, 0x118(%rax)
movl $0x1, 0x2c(%rsp)
jmp 0x114b2
jmp 0x1149f
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x113f4
movl $0x4, %eax
cmpl 0x2c(%rsp), %eax
jne 0x114d0
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
movl $0xbc, %esi
callq 0x11190
movl 0x2c(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax)
// File: lukasz-wiecaszek[P]h264iframedecoder/mpeg2ts_parser.cpp
// Function: ymn::mpeg2ts_parser::synchronized()
mpeg2ts_parser_status_e mpeg2ts_parser::synchronized()
{
    if (m_flatbuffer.read_available() < m_tspacket_size)
        return mpeg2ts_parser_status_e::NEED_BYTES;

    mpeg2ts_parser_status_e status = mpeg2ts_parser_status_e::SYNCHRONIZED;

    const uint8_t *tsp = m_flatbuffer.read_ptr();
    if (MPEG2TS_PARSER_SYNC_BYTE == *tsp) {
        if (!m_transport_rate.is_valid())
            if (m_transport_rate.calculate(tsp))
                status = mpeg2ts_parser_status_e::TRANSPORT_RATE_DETECTED;
    }
    else {
        m_state_function = &mpeg2ts_parser::waiting_for_sync;
        m_tspacket_size = 0;
        m_transport_rate.reset();
        status = mpeg2ts_parser_status_e::SYNC_LOST;
    }

    return status;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
addq $0x40, %rdi
callq 0x11830
movq (%rsp), %rcx
cmpq 0x118(%rcx), %rax
jae 0x11515
movl $0x0, 0x24(%rsp)
jmp 0x115bf
movq (%rsp), %rdi
movl $0x2, 0x14(%rsp)
addq $0x40, %rdi
callq 0x11170
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movzbl (%rax), %ecx
movl $0x47, %eax
cmpl %ecx, %eax
jne 0x1157b
movq (%rsp), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x11840
testb $0x1, %al
jne 0x11579
movq (%rsp), %rdi
addq $0x120, %rdi            # imm = 0x120
movq 0x8(%rsp), %rsi
callq 0x115d0
testb $0x1, %al
jne 0x1156f
jmp 0x11577
movl $0x5, 0x14(%rsp)
jmp 0x11579
jmp 0x115b7
movq (%rsp), %rdi
leaq -0x1b6(%rip), %rax      # 0x113d0
movq %rax, 0x108(%rdi)
movq $0x0, 0x110(%rdi)
movq $0x0, 0x118(%rdi)
addq $0x120, %rdi            # imm = 0x120
callq 0x11010
movl $0x3, 0x14(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movb $0x0, 0x17(%rsp)
xorl %eax, %eax
cmpq 0x20(%rcx), %rax
jne 0x116f7
movq 0x18(%rsp), %rdi
callq 0x11710
movq 0x8(%rsp), %rdi
movl %eax, 0x10(%rsp)
callq 0x11160
movl %eax, %ecx
movl $0x2000, %eax           # imm = 0x2000
cmpl %ecx, %eax
jne 0x1164d
movq 0x18(%rsp), %rdi
callq 0x11750
testb $0x1, %al
jne 0x1162c
jmp 0x11648
movq 0x18(%rsp), %rdi
callq 0x117a0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0x10(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x116f5
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
leaq 0x10(%rsp), %rdi
callq 0x11160
movq 0x8(%rsp), %rdi
movl %eax, 0x4(%rsp)
callq 0x11160
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jne 0x116f3
movq 0x18(%rsp), %rdi
callq 0x11750
testb $0x1, %al
jne 0x11690
jmp 0x116f1
movq 0x18(%rsp), %rdi
callq 0x117a0
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movq 0x10(%rcx), %rax
cmpq 0x8(%rcx), %rax
jbe 0x116da
movq 0x8(%rsp), %rdx
imulq $0x19bfcc0, 0x18(%rdx), %rax # imm = 0x19BFCC0
movq 0x10(%rdx), %rcx
subq 0x8(%rdx), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x20(%rax)
movb $0x1, 0x17(%rsp)
jmp 0x116ef
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rcx
movq %rcx, 0x8(%rax)
movq $0x0, 0x18(%rax)
jmp 0x116f1
jmp 0x116f3
jmp 0x116f5
jmp 0x116fc
movb $0x1, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: 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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movl 0x24(%rsp), %eax
movq %rax, 0x10(%rsp)
subq $0x5, %rax
ja 0x12427
movq 0x10(%rsp), %rax
leaq 0x12ee9(%rip), %rcx     # 0x2522c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rsp), %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, 0x18(%rsp)
jmp 0x12432
cmpl $-0x1, 0x20(%rsp)
jne 0x12377
movq 0x8(%rsp), %rax
movl 0x16128(%rax), %eax
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
jl 0x123a4
cmpl $0x20, 0x20(%rsp)
jge 0x123a4
movq 0x8(%rsp), %rax
addq $0x128, %rax            # imm = 0x128
movslq 0x20(%rsp), %rcx
imulq $0xb00, %rcx, %rcx      # imm = 0xB00
addq %rcx, %rax
movq %rax, 0x18(%rsp)
jmp 0x12432
cmpl $-0x1, 0x20(%rsp)
jne 0x123bf
movq 0x8(%rsp), %rax
movl 0x87930(%rax), %eax
movl %eax, 0x20(%rsp)
cmpl $0x0, 0x20(%rsp)
jl 0x123ef
cmpl $0x100, 0x20(%rsp)      # imm = 0x100
jge 0x123ef
movq 0x8(%rsp), %rax
addq $0x16130, %rax          # imm = 0x16130
movslq 0x20(%rsp), %rcx
imulq $0x718, %rcx, %rcx      # imm = 0x718
addq %rcx, %rax
movq %rax, 0x18(%rsp)
jmp 0x12432
movq 0x8(%rsp), %rax
addq $0x87938, %rax          # imm = 0x87938
movq %rax, 0x18(%rsp)
jmp 0x12432
movq 0x8(%rsp), %rax
addq $0x87960, %rax          # imm = 0x87960
movq %rax, 0x18(%rsp)
jmp 0x12432
movq 0x8(%rsp), %rax
addq $0x882e0, %rax          # imm = 0x882E0
movq %rax, 0x18(%rsp)
jmp 0x12432
movq $0x0, 0x30(%rsp)
jmp 0x12466
cmpq $0x0, 0x18(%rsp)
je 0x12455
movq 0x18(%rsp), %rdi
callq 0x16ec0
testb $0x1, %al
jne 0x1244a
jmp 0x12455
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
jmp 0x1245d
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x1245d
movq (%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
// File: lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: ymn::h264_parser::find_next_start_code()
bool h264_parser::find_next_start_code()
{
    std::size_t i, limit, available;
    const uint8_t* p;

    available = m_flatbuffer.read_available();
    if (available < 3 /* start code prefix size */)
        return 0; /* not enough room to find start 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++;

    if (i > limit)
        return false; /* have not found start of a nal unit */

    /* let's skip 3 bytes of start_code_prefix */
    i += 3;
    m_flatbuffer.consume(i);

    return true;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x10(%rsp)
addq $0x40, %rdi
callq 0x11830
movq %rax, 0x20(%rsp)
cmpq $0x3, 0x20(%rsp)
jae 0x124a3
movb $0x0, 0x47(%rsp)
jmp 0x12586
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rax
subq $0x3, %rax
movq %rax, 0x28(%rsp)
addq $0x40, %rdi
callq 0x11170
movq %rax, 0x18(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rcx
xorl %eax, %eax
cmpq 0x28(%rsp), %rcx
movb %al, 0xf(%rsp)
ja 0x12533
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0xe(%rsp)
jne 0x1252b
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl 0x1(%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0xe(%rsp)
jne 0x1252b
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl 0x2(%rax,%rcx), %eax
cmpl $0x1, %eax
setne %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x1253d
jmp 0x1254d
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x124cd
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jbe 0x12560
movb $0x0, 0x47(%rsp)
jmp 0x12586
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rax
addq $0x3, %rax
movq %rax, 0x30(%rsp)
addq $0x40, %rdi
movq 0x30(%rsp), %rsi
callq 0x11190
movb $0x1, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x40, %rdi
callq 0x16ed0
movq %rax, 0x18(%rsp)
xorl %eax, %eax
cmpq 0x18(%rsp), %rax
jne 0x1260c
movq 0x8(%rsp), %rdi
callq 0x12470
testb $0x1, %al
jne 0x125da
jmp 0x125fd
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
callq 0x16f10
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
callq 0x16ed0
movq %rax, 0x18(%rsp)
jmp 0x1260a
movl $0x0, 0x44(%rsp)
jmp 0x1271d
jmp 0x1260c
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
callq 0x11830
movq %rax, 0x20(%rsp)
cmpq $0x3, 0x20(%rsp)
jae 0x12634
movl $0x0, 0x44(%rsp)
jmp 0x1271d
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rax
subq $0x3, %rax
movq %rax, 0x28(%rsp)
addq $0x40, %rdi
callq 0x11170
movq %rax, 0x10(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rcx
xorl %eax, %eax
cmpq 0x28(%rsp), %rcx
movb %al, 0x7(%rsp)
ja 0x126c4
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl (%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0x6(%rsp)
jne 0x126bc
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl 0x1(%rax,%rcx), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0x6(%rsp)
jne 0x126bc
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movzbl 0x2(%rax,%rcx), %eax
cmpl $0x1, %eax
setg %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x126ce
jmp 0x126de
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x1265e
movq 0x8(%rsp), %rdi
addq $0x40, %rdi
movq 0x30(%rsp), %rsi
callq 0x11190
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jbe 0x12707
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x1271d
movq 0x10(%rsp), %rax
addq 0x30(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rcx, %rax
movl %eax, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
movq (%rsp), %rdx
addq $0xc, %rdx
movl $0x1, %esi
callq 0x16f30
testb $0x1, %al
jne 0x12783
movq 0x18(%rsp), %rdi
callq 0x17130
jmp 0x127da
movq (%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x127bb
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
addq $0x10, %rsi
movl 0xc(%rsp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
cltq
leaq 0x13161(%rip), %rdx     # 0x25910
shlq $0x4, %rax
addq %rax, %rdx
callq 0x127e0
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x127cc
jmp 0x127da
movq (%rsp), %rdi
movl $0x1, %esi
callq 0x17160
addq $0x28, %rsp
retq
nop
// File: lukasz-wiecaszek[P]h264iframedecoder/h264_parser.cpp
// Function: void parse_scaling_list<16ul>(ymn::istream<0>&, unsigned char (&) [16ul], unsigned char const (&) [16ul])
static inline void parse_scaling_list(istream_be& s, uint8_t (&coeffs)[N], const uint8_t (&dsl)[N])
{
    int32_t delta_scale;
    uint8_t last = 8, next = 8;

    const uint8_t* const scan = N == 16 ?
      h264::frame_scan_4x4 : h264::frame_scan_8x8;

    for (std::size_t i = 0; i < N; ++i) {
        if (next) {
            if (!s.read_exp_golomb_s(delta_scale)) {
                s.mark_corrupted();
                break;
            }
            next = (last + delta_scale) & 0xff;
        }
        if (!i && !next) {
            /* list is not transmited, we use the (d)efault (s)caling (l)ist (dsl) */
            memcpy(coeffs, dsl, N * sizeof(uint8_t));
            break;
        }
        last = coeffs[scan[i]] = next ? next : last;
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movb $0x8, 0x1b(%rsp)
movb $0x8, 0x1a(%rsp)
leaq 0x131ac(%rip), %rax     # 0x259b0
movq %rax, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
cmpq $0x10, 0x8(%rsp)
jae 0x128ce
cmpb $0x0, 0x1a(%rsp)
je 0x12859
movq 0x30(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x17690
testb $0x1, %al
jne 0x12847
movq 0x30(%rsp), %rdi
callq 0x17130
jmp 0x128ce
movzbl 0x1b(%rsp), %eax
addl 0x1c(%rsp), %eax
andl $0xff, %eax
movb %al, 0x1a(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x12882
cmpb $0x0, 0x1a(%rsp)
jne 0x12882
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x128ce
cmpb $0x0, 0x1a(%rsp)
je 0x12893
movb 0x1a(%rsp), %al
movb %al, 0x7(%rsp)
jmp 0x1289b
movb 0x1b(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
movq 0x28(%rsp), %rcx
movq 0x8(%rsp), %rsi
leaq 0x13100(%rip), %rdx     # 0x259b0
movzbl (%rdx,%rsi), %edx
movb %al, (%rcx,%rdx)
movb %al, 0x1b(%rsp)
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x12812
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movq 0x10(%rsp), %rax
movslq 0xc(%rsp), %rcx
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rdi
movq (%rsp), %rdx
addq $0xc, %rdx
movl $0x1, %esi
callq 0x16f30
testb $0x1, %al
jne 0x12933
movq 0x18(%rsp), %rdi
callq 0x17130
jmp 0x1298b
movq (%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x1296c
movq 0x18(%rsp), %rdi
movq (%rsp), %rsi
addq $0x10, %rsi
movl 0xc(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movslq %edx, %rax
leaq 0x12fd0(%rip), %rdx     # 0x25930
shlq $0x6, %rax
addq %rax, %rdx
callq 0x12990
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x1297d
jmp 0x1298b
movq (%rsp), %rdi
movl $0x1, %esi
callq 0x17160
addq $0x28, %rsp
retq
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x10, %rdx
xorl %ecx, %ecx
callq 0x12730
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12acb
jmp 0x12bb9
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x10, %rdx
movl $0x1, %ecx
callq 0x12730
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12afc
jmp 0x12bb9
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x10, %rdx
movl $0x2, %ecx
callq 0x12730
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12b2d
jmp 0x12bb9
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x10, %rdx
movl $0x3, %ecx
callq 0x12730
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12b5b
jmp 0x12bb9
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x10, %rdx
movl $0x4, %ecx
callq 0x12730
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12b89
jmp 0x12bb9
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0x10, %rdx
movl $0x5, %ecx
callq 0x12730
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12bb7
jmp 0x12bb9
jmp 0x12bb9
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0xd0, %rdx
xorl %ecx, %ecx
callq 0x128e0
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12c10
jmp 0x12d19
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0xd0, %rdx
movl $0x1, %ecx
callq 0x128e0
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12c43
jmp 0x12d19
movl $0x3, %eax
cmpl 0xc(%rsp), %eax
jne 0x12d17
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0xd0, %rdx
movl $0x2, %ecx
callq 0x128e0
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12c85
jmp 0x12d19
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0xd0, %rdx
movl $0x3, %ecx
callq 0x128e0
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12cb5
jmp 0x12d19
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0xd0, %rdx
movl $0x4, %ecx
callq 0x128e0
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12ce5
jmp 0x12d19
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq $0xd0, %rdx
movl $0x5, %ecx
callq 0x128e0
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12d15
jmp 0x12d19
jmp 0x12d17
jmp 0x12d19
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x38, %rsp
movb %cl, %al
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
andb $0x1, %al
movb %al, 0x1f(%rsp)
movl %r8d, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movb $0x0, 0x17(%rsp)
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x12a80
movq 0x28(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12d74
jmp 0x12dba
testb $0x1, 0x1f(%rsp)
je 0x12da6
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movl 0x18(%rsp), %ecx
callq 0x12bc0
movq 0x28(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x12da4
jmp 0x12dba
jmp 0x12da6
movq 0x20(%rsp), %rdi
movl $0x1, %esi
callq 0x17160
movb $0x1, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movb $0x0, 0xf(%rsp)
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x14, %rsi
callq 0x17200
movq 0x10(%rsp), %rax
testb $0x1, 0x10(%rax)
je 0x13599
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x18, %rsi
callq 0x17200
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
movq 0x10(%rsp), %rax
movl 0x1c(%rax), %edx
movq 0x10(%rsp), %rax
movb 0x10(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x13640
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x135d2
jmp 0x13634
movq 0x10(%rsp), %rcx
movl $0x1, %eax
cmpl 0xc(%rcx), %eax
jne 0x1360f
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
addq $0x424, %rsi            # imm = 0x424
movq 0x10(%rsp), %rax
movl 0x420(%rax), %edx
movq 0x10(%rsp), %rax
movb 0x10(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x13640
movq 0x18(%rsp), %rdi
callq 0x17150
cmpl $0x0, %eax
je 0x13620
jmp 0x13634
movq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0x17160
movb $0x1, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nop