// File: /workspace/github_cpp_makefile_star2_O3/lukasz-wiecaszek[P]h264iframedecoder/./h264_parser.hpp
// Function: ymn::h264_parser::h264_parser(unsigned long, ymn::h264_parser_container_e)
explicit h264_parser(std::size_t capacity, h264_parser_container_e container) :
        base_parser<uint8_t>(capacity),
        m_parse_function(nullptr),
        m_aud(),
        m_sps_table(),
        m_recent_sps(-1),
        m_pps_table(),
        m_recent_pps(-1),
        m_sei(),
        m_slice_header(),
        m_slice_data()
    {
        switch (container) {
            case h264_parser_container_e::NONE:
                m_parse_function = &h264_parser::parse_nal_units;
                break;

            case h264_parser_container_e::ANNEX_B:
                m_parse_function = &h264_parser::parse_byte_stream_nal_units;
                break;

            default:
                /* do nothing */
                break;
        }

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %rbx
movq %rsi, 0x40(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rdi)
xorl %r14d, %r14d
movq %r14, 0x90(%rdi)
movq %rsi, 0x98(%rdi)
movq $-0x1, 0xa0(%rdi)
movq %rsi, %rdi
callq 0x2030
movq %rax, 0xc0(%rbx)
movq %r14, 0x100(%rbx)
leaq 0xbb34(%rip), %rax      # 0x20ca8
movq %rax, (%rbx)
movb $0x0, 0x120(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x108(%rbx)
leaq 0xb9e1(%rip), %rax      # 0x20b70
movq %rax, 0x118(%rbx)
movl $0x128, %r14d           # imm = 0x128
leaq (%rbx,%r14), %rdi
callq 0x1595c
addq $0xb00, %r14            # imm = 0xB00
cmpq $0x16128, %r14          # imm = 0x16128
jne 0x1519c
movl $0xffffffff, 0x16128(%rbx) # imm = 0xFFFFFFFF
leaq 0x165a4(%rbx), %rax
leaq 0x16664(%rbx), %rcx
movl $0x16130, %edx          # imm = 0x16130
xorl %esi, %esi
leaq 0xba0d(%rip), %rdi      # 0x20be8
leaq 0xb9a6(%rip), %r8       # 0x20b88
leaq 0xbadf(%rip), %r9       # 0x20cc8
leaq 0xbaf0(%rip), %r10      # 0x20ce0
movl $0x718, %r11d           # imm = 0x718
movb %sil, 0x8(%rbx,%rdx)
movq %rdi, (%rbx,%rdx)
movb %sil, 0x460(%rbx,%rdx)
movq %r8, 0x458(%rbx,%rdx)
xorl %r14d, %r14d
movb $0x0, -0x4(%rax,%r14)
movq %r9, -0xc(%rax,%r14)
movl $0x0, (%rax,%r14)
addq $0x20, %r14
cmpq $0xc0, %r14
jne 0x15212
xorl %r14d, %r14d
movb $0x0, -0x4(%rcx,%r14)
movq %r10, -0xc(%rcx,%r14)
movl $0x0, (%rcx,%r14)
addq $0x50, %r14
cmpq $0x1e0, %r14            # imm = 0x1E0
jne 0x15235
addq %r11, %rdx
addq %r11, %rax
addq %r11, %rcx
cmpq $0x87930, %rdx          # imm = 0x87930
jne 0x151f6
movl $0xffffffff, 0x87930(%rbx) # imm = 0xFFFFFFFF
xorl %eax, %eax
movb %al, 0x87940(%rbx)
leaq 0xb980(%rip), %rcx      # 0x20c00
movq %rcx, 0x87938(%rbx)
movb %al, 0x87968(%rbx)
leaq 0xb9e4(%rip), %rcx      # 0x20c78
movq %rcx, 0x87960(%rbx)
movb %al, 0x879c0(%rbx)
leaq 0xb970(%rip), %rcx      # 0x20c18
movq %rcx, 0x879b8(%rbx)
movb %al, 0x879f0(%rbx)
movq %rcx, 0x879e8(%rbx)
movb %al, 0x87a20(%rbx)
leaq 0xb967(%rip), %rcx      # 0x20c30
movq %rcx, 0x87a18(%rbx)
movb %al, 0x88248(%rbx)
leaq 0xb96b(%rip), %rcx      # 0x20c48
movq %rcx, 0x88240(%rbx)
movb %al, 0x88260(%rbx)
leaq 0xb96f(%rip), %rcx      # 0x20c60
movq %rcx, 0x88258(%rbx)
movb %al, 0x882e8(%rbx)
leaq 0xb98b(%rip), %rax      # 0x20c90
movq %rax, 0x882e0(%rbx)
testl %ebp, %ebp
je 0x1531e
cmpl $0x1, %ebp
jne 0x15337
leaq -0xe566(%rip), %rax     # 0x6db6
jmp 0x15325
leaq -0xe573(%rip), %rax     # 0x6db2
movq %rax, 0x108(%rbx)
movq $0x0, 0x110(%rbx)
popq %rbx
popq %r14
popq %rbp
retq