// File: /workspace/github_cpp_makefile_star2_O1/lukasz-wiecaszek[P]h264iframedecoder/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    bool status;
    struct {
        bool rtp;
        bool ts;
        bool annex_b;
    } encapsulation = {};
    uint16_t pid = MPEG2TS_PID_INVALID;
    const char* ofile = nullptr;
    ymn::h264_parser_container_e container = ymn::h264_parser_container_e::NONE;
    mpeg2ts_parser_user_data mpeg2ts_user_data;

    static struct option long_options[] = {
        {"rtp",     no_argument,       0, 'r'},
        {"ts",      required_argument, 0, 't'},
        {"annex-b", no_argument,       0, 'a'},
        {"ofile",   required_argument, 0, 'o'},
        {0,         0,                 0,  0 }
    };

    for (;;) {
        int c = getopt_long(argc, argv, "rt:ao:", long_options, 0);
        if (-1 == c)
            break;

        switch(c) {
            case 'r':
                encapsulation.rtp = true;
                break;

            case 't':
                encapsulation.ts = true;
                encapsulation.annex_b = true;
                container = ymn::h264_parser_container_e::ANNEX_B;
                status = (ymn::strtointeger_conversion_status_e::success == ymn::strtointeger(optarg, pid));
                if (!status) {
                    std::cerr << "error: cannot convert '" << optarg << "' to integer" << std::endl;
                    h264iframedecoder_usage(argv[0]);
                    exit(EXIT_FAILURE);
                }
                break;

            case 'a':
                encapsulation.annex_b = true;
                container = ymn::h264_parser_container_e::ANNEX_B;
                break;

            case 'o':
                ofile = optarg;
                break;

            default:
                std::cout << "default option received" << std::endl;
                /* does nothing */
                break;
        }
    }

    std::cout << "encapsulation:"
        << " rtp=" << (encapsulation.rtp ? "y" : "n")
        << " ts=" << (encapsulation.ts ? "y" : "n")
        << " annex-b=" << (encapsulation.annex_b ? "y" : "n")
        << std::endl;
    if (encapsulation.ts)
        std::cout << "pid: " << HEXDEC(pid) << std::endl;
    std::cout << "container: " << to_string(container) << std::endl;

    const char* filename = argv[optind];
    if (!filename) {
         std::cerr << "error: missing input file" << std::endl;
         h264iframedecoder_usage(argv[0]);
         exit(EXIT_FAILURE);
    }

   if (ofile != nullptr) {
      h264_ofile = std::ofstream(ofile, std::ios::out | std::ios::binary);
      if (!h264_ofile.is_open()) {
         std::cerr << "error: could not open '" << ofile << "'" << std::endl;
         h264iframedecoder_usage(argv[0]);
         exit(EXIT_FAILURE);
      }
   }

    h264_decoder = new ymn::h264_decoder(container);
    assert(h264_decoder != nullptr);

    if (encapsulation.ts) {
        mpeg2ts_parser = new ymn::mpeg2ts_parser(TS_PARSER_BUFFER_SIZE);
        assert(mpeg2ts_parser != nullptr);

        mpeg2ts_user_data.pid = pid;
        mpeg2ts_user_data.h264_decoder = h264_decoder;

        mpeg2ts_parser->set_user_data(&mpeg2ts_user_data);
    }

    if (encapsulation.rtp) {
    }

    std::size_t read_bytes = 0;
    std::ifstream file(filename, std::ios::in | std::ios::binary);
    if (file.is_open()) {
        std::streamsize count;
        char* memblock;

        memblock = new char[READ_BUFFER_SIZE];

        do {
            count = file.readsome(memblock, READ_BUFFER_SIZE);
            read_bytes += count;
            if (count > 0) {
                if (encapsulation.rtp)
                    /* to be implemented */;
                else
                if (encapsulation.ts)
                    mpeg2ts_parser_feed(*mpeg2ts_parser, reinterpret_cast<uint8_t*>(memblock), count);
                else
                    h264_decoder_feed(*h264_decoder, reinterpret_cast<uint8_t*>(memblock), count);
            }
        } while (count > 0);

        file.close();
        std::cout << "read " << read_bytes << " bytes from '" << filename << "'" << std::endl;
    }
    else {
        std::cerr << "error: could not open '" << filename << "'" << std::endl;
    }

    if (mpeg2ts_parser)
        delete mpeg2ts_parser;

    if (h264_decoder)
        delete h264_decoder;

    if (h264_ofile.is_open())
        h264_ofile.close();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %r15
movl %edi, %r13d
movl $0x2000, 0x90(%rsp) # imm = 0x2000
movq $0x0, 0x40(%rsp)
movw $0x2000, %ax            # imm = 0x2000
movl %eax, 0x30(%rsp)
leaq 0x16ab6(%rip), %r12     # 0x1903c
leaq 0x1fbf3(%rip), %r14     # 0x22180
movl $0x0, 0x14(%rsp)
xorl %ebp, %ebp
movq $0x0, 0x38(%rsp)
movq $0x0, 0x50(%rsp)
movq %rsi, 0x28(%rsp)
xorl %ebx, %ebx
movl %r13d, %edi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x2280
cmpl $0x6e, %eax
jle 0x2674
cmpl $0x6f, %eax
je 0x268f
cmpl $0x72, %eax
je 0x26a0
cmpl $0x74, %eax
jne 0x26ab
movq 0x1f9b1(%rip), %rax     # 0x21fa0
movq (%rax), %rbp
cmpb $0x0, (%rbp)
je 0x26f1
callq 0x2050
movq %rax, %rbx
movl $0x0, (%rax)
xorl %r15d, %r15d
movq %rbp, %rdi
leaq 0xa0(%rsp), %rsi
xorl %edx, %edx
callq 0x2210
movq 0xa0(%rsp), %rcx
cmpb $0x0, (%rcx)
jne 0x26f4
movl (%rbx), %ecx
cmpl $0x22, %ecx
sete %dl
cmpq $-0x1, %rax
sete %sil
testb %sil, %dl
jne 0x26f1
testq %rax, %rax
sete %dl
testl %ecx, %ecx
setne %cl
testb %cl, %dl
jne 0x26f1
cmpq $0x10000, %rax          # imm = 0x10000
setb %r15b
cmovael 0x30(%rsp), %eax
movl %eax, 0x30(%rsp)
jmp 0x26f4
cmpl $-0x1, %eax
je 0x2716
cmpl $0x61, %eax
jne 0x26ab
movb $0x1, %bpl
movl $0x1, 0x14(%rsp)
jmp 0x26ed
movq 0x1f90a(%rip), %rax     # 0x21fa0
movq (%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x26ed
movb $0x1, %bl
movb $0x1, %al
movq %rax, 0x50(%rsp)
jmp 0x2716
movl $0x17, %edx
movq 0x1f909(%rip), %rbx     # 0x21fc0
movq %rbx, %rdi
leaq 0x169a7(%rip), %rsi     # 0x19068
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movb $0x1, %bl
jmp 0x2716
xorl %r15d, %r15d
testb %r15b, %r15b
je 0x322b
movb $0x1, %bpl
movl $0x1, 0x14(%rsp)
movb $0x1, %bl
movb $0x1, %al
movq %rax, 0x38(%rsp)
movq 0x28(%rsp), %r15
testb %bl, %bl
jne 0x25ae
leaq 0x1695b(%rip), %rsi     # 0x19080
movl $0xe, %edx
movq 0x1f88f(%rip), %r15     # 0x21fc0
movq %r15, %rdi
callq 0x21d0
leaq 0x1694f(%rip), %rsi     # 0x1908f
movl $0x5, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x16a40(%rip), %r14     # 0x19194
leaq 0x1ad02(%rip), %rbx     # 0x1d45d
testb $0x1, 0x50(%rsp)
movq %rbx, %rsi
cmovneq %r14, %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x1691a(%rip), %rsi     # 0x19095
movl $0x4, %edx
movq %r15, %rdi
callq 0x21d0
movq 0x38(%rsp), %r12
testb $0x1, %r12b
movq %rbx, %rsi
cmovneq %r14, %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x168ee(%rip), %rsi     # 0x1909a
movl $0x9, %edx
movq %r15, %rdi
callq 0x21d0
testb $0x1, %bpl
cmovneq %r14, %rbx
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
testb $0x1, %r12b
je 0x28c6
leaq 0x1689b(%rip), %rsi     # 0x190a4
movl $0x5, %edx
movq %r15, %rdi
callq 0x21d0
leaq 0x16807(%rip), %rsi     # 0x19024
movl $0x2, %edx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movzwl 0x30(%rsp), %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x22b0
movq %rax, %r14
leaq 0x167cd(%rip), %rsi     # 0x19027
movl $0x2, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r14,%rax)
movq %r14, %rdi
movl %ebx, %esi
callq 0x22b0
movq %rax, %rbx
leaq 0x171e4(%rip), %rsi     # 0x19a76
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
leaq 0x167dd(%rip), %rsi     # 0x190aa
movl $0xb, %edx
movq %r15, %rdi
callq 0x21d0
xorl %eax, %eax
movl 0x14(%rsp), %ebp
testl %ebp, %ebp
setne %al
leaq 0x16c07(%rip), %rcx     # 0x194f3
leaq 0x16c05(%rip), %rsi     # 0x194f8
cmoveq %rcx, %rsi
leaq (%rax,%rax,2), %rdx
addq $0x4, %rdx
movq %r15, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq 0x1f693(%rip), %rax     # 0x21fc8
movslq (%rax), %rax
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %r15
testq %r15, %r15
je 0x3276
movq 0x40(%rsp), %r14
testq %r14, %r14
je 0x29f0
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl $0x14, %edx
callq 0x21b0
leaq 0x1f8c1(%rip), %rdi     # 0x22238
movq 0x1f8ba(%rip), %rax     # 0x22238
addq -0x18(%rax), %rdi
leaq 0xa8(%rsp), %rbx
movq -0x8(%rbx), %rax
addq -0x18(%rax), %r12
movq %r12, %rsi
callq 0x22d0
leaq 0x1f89f(%rip), %rdi     # 0x22240
movq %rbx, %rsi
callq 0x2180
movq 0x1f600(%rip), %rax     # 0x21fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
movq %rcx, -0x8(%rbx)
movq -0x18(%rcx), %rcx
movq %rax, 0xa0(%rsp,%rcx)
movq %rbx, %rdi
callq 0x2130
leaq 0x198(%rsp), %rdi
callq 0x20a0
leaq 0x1f8c5(%rip), %rdi     # 0x222a8
callq 0x2080
testb %al, %al
je 0x3286
movl $0xa6480, %edi          # imm = 0xA6480
movl $0x40, %esi
callq 0x21c0
movq %rax, 0x48(%rsp)
movq %rax, %rdi
movl %ebp, %esi
callq 0x8014
testb $0x1, 0x38(%rsp)
je 0x2ae3
movl $0x180, %edi            # imm = 0x180
movl $0x40, %esi
callq 0x21c0
movq %rax, %rbx
leaq 0x1f006(%rip), %rax     # 0x21a38
movq %rax, (%rbx)
movl $0x2000, %eax           # imm = 0x2000
movq %rax, 0x40(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rbx)
xorl %r14d, %r14d
movq %r14, 0x90(%rbx)
movq %rax, 0x98(%rbx)
movq $-0x1, 0xa0(%rbx)
movq %r14, 0xc0(%rbx)
movl $0x2000, %edi           # imm = 0x2000
callq 0x2030
movq %rax, 0xc0(%rbx)
movq %r14, 0x100(%rbx)
leaq 0x1ef8e(%rip), %rax     # 0x21a18
movq %rax, (%rbx)
leaq 0xda6(%rip), %rax       # 0x383a
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)
movq %rbx, 0x1f974(%rip)     # 0x22438
movzwl 0x30(%rsp), %eax
leaq 0x90(%rsp), %rcx
movl %eax, (%rcx)
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rcx)
movq %rcx, 0x100(%rbx)
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
movl $0xc, %edx
callq 0x22c0
leaq 0x118(%rsp), %rdi
callq 0x2080
testb %al, %al
je 0x312c
movq %r15, 0x68(%rsp)
movl $0x1000, %edi           # imm = 0x1000
callq 0x2030
movq %rax, 0x58(%rsp)
leaq 0x164dc(%rip), %r12     # 0x19004
xorl %r14d, %r14d
movq %r14, 0x70(%rsp)
movl $0x1000, %edx           # imm = 0x1000
leaq 0xa0(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x2250
movq %rax, 0x60(%rsp)
testq %rax, %rax
setle %al
orb 0x50(%rsp), %al
testb $0x1, %al
jne 0x30c5
testb $0x1, 0x38(%rsp)
je 0x30b1
movq 0x1f8c8(%rip), %r13     # 0x22438
leaq 0x110(%r13), %rax
movq %rax, 0x88(%rsp)
leaq 0x80(%r13), %rax
movq %rax, 0x80(%rsp)
leaq 0x128(%r13), %rax
movq %rax, 0x78(%rsp)
movq 0x60(%rsp), %rbx
movq 0x58(%rsp), %r14
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x370a
testq %rax, %rax
je 0x3045
movq %r14, 0x40(%rsp)
movq %rax, 0x30(%rsp)
subq %rax, %rbx
movq %rbx, 0x28(%rsp)
jb 0x3206
movq 0x100(%r13), %rax
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x108(%r13), %rax
movq 0x110(%r13), %rdi
addq %r13, %rdi
testb $0x1, %al
je 0x2bfd
movq (%rdi), %rcx
movq -0x1(%rcx,%rax), %rax
callq *%rax
cmpl $0x3, %eax
ja 0x2be0
movl %eax, %r15d
movl %eax, %eax
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0xb, %edx
movq 0x1f3a2(%rip), %rbx     # 0x21fc0
movq %rbx, %rdi
leaq 0x1691e(%rip), %rsi     # 0x19546
jmp 0x2c40
movl $0x9, %edx
movq 0x1f38a(%rip), %rbx     # 0x21fc0
movq %rbx, %rdi
leaq 0x16912(%rip), %rsi     # 0x19552
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
testl %r15d, %r15d
jne 0x2be0
jmp 0x3034
movq 0xc0(%r13), %rbp
movq 0x88(%r13), %rax
movq 0x118(%r13), %rdx
cmpq %rdx, %rax
cmovbq %rax, %rdx
movq 0x80(%r13), %rcx
leaq (%rdx,%rcx), %rsi
movq %rsi, 0x80(%r13)
subq %rdx, %rax
movq %rax, 0x88(%r13)
movzbl 0x1(%rbp,%rcx), %eax
movzbl 0x2(%rbp,%rcx), %edx
movl %eax, %esi
andl $0x1f, %esi
shll $0x8, %esi
orl %edx, %esi
cmpl 0x14(%rsp), %esi
jne 0x2c6c
addq %rcx, %rbp
movzbl 0x3(%rbp), %edx
shrl $0x4, %edx
andl $0x3, %edx
xorl %ecx, %ecx
leaq 0x16332(%rip), %rsi     # 0x19014
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movl $0x4, %ecx
jmp 0x2cf9
movzbl 0x4(%rbp), %ecx
addl $0x5, %ecx
testl %ecx, %ecx
je 0x2c6c
testb $0x40, %al
je 0x2d1a
movl $0x1, 0x1f731(%rip)     # 0x22440
movq $0x0, 0x1f72e(%rip) # 0x22448
movl %ecx, %eax
addq %rax, %rbp
movl $0xbc, %edx
subl %ecx, %edx
movq 0x1f71b(%rip), %rbx     # 0x22448
testq %rbx, %rbx
movq %rbx, %r14
cmoveq %rdx, %r14
leaq 0x1f712(%rip), %rsi     # 0x22450
cmoveq %rbp, %rsi
movl 0x1f6f8(%rip), %eax     # 0x22440
testl %eax, %eax
je 0x2c6c
movq 0x100(%r13), %rcx
cmpl $0x2, %eax
jne 0x2d6d
movq 0x8(%rcx), %rdi
movq %rbp, %rsi
callq 0x3647
jmp 0x2c6c
movl $0x7, %eax
subl %r14d, %eax
movb $0x1, %dil
testl %eax, %eax
jle 0x2e2e
testq %rbx, %rbx
movq %rcx, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
je 0x2dc3
movq %rsi, 0x20(%rsp)
cmpl %edx, %eax
jbe 0x2ded
leaq 0x1f6b1(%rip), %rax     # 0x22450
leaq (%rax,%rbx), %rdi
movq %rbp, %rsi
movq 0x8(%rsp), %rdx
callq 0x2120
movq 0x8(%rsp), %rdx
addq %rdx, %rbx
movq %rbx, 0x1f689(%rip)     # 0x22448
xorl %edi, %edi
jmp 0x2e24
leaq 0x1f686(%rip), %rdi     # 0x22450
movq %rsi, %rbx
movq %r14, %rdx
callq 0x2120
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r14, 0x1f65f(%rip)     # 0x22448
xorl %edi, %edi
jmp 0x2e2e
movl %eax, %r14d
leaq 0x1f659(%rip), %rax     # 0x22450
leaq (%rax,%rbx), %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x2120
movb $0x1, %dil
movq 0x8(%rsp), %rdx
addq %r14, %rbx
movq %rbx, 0x1f630(%rip)     # 0x22448
addq %r14, %rbp
subq %r14, %rdx
movl $0x7, %r14d
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rsi
testb %dil, %dil
je 0x2c6c
cmpb $0x0, (%rsi)
jne 0x2ec1
cmpb $0x0, 0x1(%rsi)
jne 0x2ec1
cmpb $0x1, 0x2(%rsi)
jne 0x2ec1
movb 0x3(%rsi), %al
andb $-0x10, %al
cmpb $-0x20, %al
jne 0x2ec1
movb 0x6(%rsi), %al
andb $-0x40, %al
negb %al
jno 0x2ec1
movl $0x9, %eax
subl %r14d, %eax
movb $0x1, %dil
testl %eax, %eax
jle 0x2f34
movq 0x1f5d0(%rip), %rbx     # 0x22448
testq %rbx, %rbx
movq %rcx, 0x18(%rsp)
je 0x2ed0
movq %rsi, 0x20(%rsp)
movl %eax, %ecx
leaq 0x1f5c0(%rip), %rax     # 0x22450
leaq (%rax,%rbx), %rdi
movq %rdx, %rax
movq %rbp, %rsi
subq %rcx, %rax
jae 0x2eff
movq %rdx, 0x8(%rsp)
movq 0x8(%rsp), %rdx
callq 0x2120
movq 0x8(%rsp), %rdx
addq %rdx, %rbx
movq %rbx, 0x1f58b(%rip)     # 0x22448
xorl %edi, %edi
jmp 0x2f2a
movl $0x0, 0x1f575(%rip)     # 0x22440
jmp 0x2c6c
leaq 0x1f579(%rip), %rdi     # 0x22450
movq %rsi, %rbx
movq %rdx, 0x8(%rsp)
movq %r14, %rdx
callq 0x2120
movq %rbx, %rsi
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r14, 0x1f54d(%rip)     # 0x22448
xorl %edi, %edi
jmp 0x2f34
movq %rcx, %rdx
movq %rax, 0x8(%rsp)
movq %rcx, %r14
callq 0x2120
movb $0x1, %dil
addq %r14, %rbx
movq %rbx, 0x1f52c(%rip)     # 0x22448
addq %r14, %rbp
movl $0x9, %r14d
movq 0x8(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rsi
testb %dil, %dil
je 0x2c6c
movzbl 0x8(%rsi), %edi
addq $0x9, %rdi
movq %rdi, %r8
subq %r14, %r8
movb $0x1, %al
testl %r8d, %r8d
jle 0x2ffa
movq %rdi, 0x20(%rsp)
movq 0x1f4e6(%rip), %rbx     # 0x22448
testq %rbx, %rbx
je 0x2fa2
movq %rcx, 0x18(%rsp)
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
leaq 0x1f4d6(%rip), %rax     # 0x22450
leaq (%rax,%rbx), %rdi
movq %rdx, %r14
movq %rbp, %rsi
subq %r8, %r14
jae 0x2fcc
movq %rdx, %r14
callq 0x2120
movq %r14, %rdx
addq %r14, %rbx
movq %rbx, 0x1f4aa(%rip)     # 0x22448
xorl %eax, %eax
jmp 0x2ff0
leaq 0x1f4a7(%rip), %rdi     # 0x22450
movq %rdx, 0x8(%rsp)
movq %r14, %rdx
movq %rcx, %rbx
callq 0x2120
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
movq %r14, 0x1f480(%rip)     # 0x22448
xorl %eax, %eax
jmp 0x2ff5
movq %r8, %rdx
movq %r8, 0x8(%rsp)
callq 0x2120
movb $0x1, %al
movq 0x8(%rsp), %rcx
addq %rcx, %rbx
movq %rbx, 0x1f45e(%rip)     # 0x22448
addq %rcx, %rbp
movq %r14, %rdx
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rdi
testb %al, %al
je 0x2c6c
cmpq $0x0, 0x1f43e(%rip)     # 0x22448
movl $0x0, %eax
cmovneq %rax, %rdi
subq %rdi, %rdx
addq %rdi, %rbp
movq 0x8(%rcx), %rdi
movq %rbp, %rsi
callq 0x3647
movl $0x2, 0x1f411(%rip)     # 0x22440
jmp 0x2c6c
movq 0x40(%rsp), %r14
addq 0x30(%rsp), %r14
movq 0x28(%rsp), %rbx
jmp 0x30a6
movq 0x40(%r13), %rax
xorl %ecx, %ecx
movq 0x80(%rsp), %rdx
movq %rcx, 0x10(%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movq %rax, 0x98(%r13)
movq $-0x1, 0xa0(%r13)
movq %rcx, 0x100(%r13)
leaq 0x7bd(%rip), %rax       # 0x383a
movq %rax, 0x108(%r13)
movq 0x88(%rsp), %rax
movaps %xmm0, (%rax)
movl $0x2000, 0x120(%r13) # imm = 0x2000
movq 0x78(%rsp), %rax
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
testq %rbx, %rbx
jne 0x2ba4
jmp 0x30c5
movq 0x48(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
callq 0x3647
movq 0x70(%rsp), %r14
movq 0x60(%rsp), %rax
addq %rax, %r14
testq %rax, %rax
jg 0x2b2b
leaq 0xa0(%rsp), %rdi
callq 0x2060
movq 0x1eed1(%rip), %rbx     # 0x21fc0
leaq 0x15ff2(%rip), %rsi     # 0x190e8
movl $0x5, %edx
movq %rbx, %rdi
callq 0x21d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2100
movq %rax, %rbx
leaq 0x15fd6(%rip), %rsi     # 0x190ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x21d0
movq 0x68(%rsp), %r15
jmp 0x3147
movq 0x1eebd(%rip), %rbx     # 0x21ff0
leaq 0x15f96(%rip), %rsi     # 0x190d0
movl $0x17, %edx
movq %rbx, %rdi
callq 0x21d0
movq %r15, %rdi
callq 0x20b0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x21d0
leaq 0x1a534(%rip), %rsi     # 0x1d698
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq 0x1f299(%rip), %rdi     # 0x22438
testq %rdi, %rdi
je 0x31aa
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x804c
movl $0xa6480, %esi          # imm = 0xA6480
movl $0x40, %edx
movq %rbx, %rdi
callq 0x2070
leaq 0x1f0d8(%rip), %rdi     # 0x222a8
callq 0x2080
testb %al, %al
je 0x31e5
leaq 0x1f058(%rip), %rdi     # 0x22238
callq 0x2230
leaq 0xa0(%rsp), %rdi
callq 0x2090
xorl %eax, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1ede3(%rip), %rdi     # 0x21ff0
leaq 0x162ec(%rip), %rsi     # 0x19500
callq 0x2160
movq %rax, %rdi
callq 0x20c0
movl $0x1, %edi
callq 0x21e0
movq 0x1edbe(%rip), %rdi     # 0x21ff0
leaq 0x15e0a(%rip), %rsi     # 0x19043
callq 0x2160
movq 0x1ed5b(%rip), %rcx     # 0x21fa0
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2160
leaq 0x15e04(%rip), %rsi     # 0x1905b
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20c0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0x32ad
jmp 0x3221
movq 0x1ed73(%rip), %rdi     # 0x21ff0
leaq 0x15e32(%rip), %rsi     # 0x190b6
jmp 0x325a
movq 0x1ed63(%rip), %rdi     # 0x21ff0
leaq 0x15e3c(%rip), %rsi     # 0x190d0
callq 0x2160
movq %rax, %rdi
movq %r14, %rsi
callq 0x2160
leaq 0x1a3ed(%rip), %rsi     # 0x1d698
jmp 0x3257