// File: ivan-tkatchev[P]makerpm/makerpm.cc
// Function: create_cpio(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, rpmprops_t&)
void create_cpio(const std::string& archive_name, const std::string& prefix,
                 std::vector<std::string>& files, rpmprops_t& props) {

    // RPM wants files to be in sorted order.
    std::sort(files.begin(), files.end());


    struct archive* a;
    struct archive* adisk;
    int r;

    a = ::archive_write_new();
    if (a == NULL) {
        throw std::runtime_error("Could not allocate archive struct.");
    }
    
    adisk = ::archive_read_disk_new();
    if (adisk == NULL ) {
        throw std::runtime_error("Could not allocate archive struct.");
    }

    ::archive_read_disk_set_symlink_physical(adisk);
    ::archive_read_disk_set_standard_lookup(adisk);

    r = ::archive_write_set_format_cpio_newc(a);
    if (r != ARCHIVE_OK) {
        throw std::runtime_error("Could not set archive format: " + std::string(::archive_error_string(a)));
    }

    r = ::archive_write_open_filename(a, archive_name.c_str());
    if (r != ARCHIVE_OK) {
        throw std::runtime_error("Could not open archive for writing: " + archive_name + ::archive_error_string(a));
    }

    for (const std::string& f : files) {

        struct archive_entry* entry;

        entry = ::archive_entry_new();

        if (entry == NULL) {
            throw std::runtime_error("Could not allocate archive entry struct.");
        }

        ::archive_entry_copy_sourcepath(entry, f.c_str());

        r = ::archive_read_disk_entry_from_file(adisk, entry, -1, NULL);        

        if (r != ARCHIVE_OK) {
            throw std::runtime_error("Could not read file: " + f + ::archive_error_string(a));
        }

        std::string pathname = f;

        if (pathname == prefix) {
            pathname = "/";

        } else if (pathname.size() > prefix.size() && 
                   pathname.compare(0, prefix.size(), prefix) == 0) {

            pathname = pathname.substr(prefix.size());
        }

        if (pathname.size() == 0) {
            throw std::runtime_error("Invalid empty pathname.");
        }

        if (pathname[0] == '/') {
            pathname = "." + pathname;

        } else if (pathname.size() < 2 ||
                   pathname[0] != '.' || pathname[1] != '/') {

            pathname = "./" + pathname;
        }

        ::archive_entry_copy_pathname(entry, pathname.c_str());

        if (::archive_entry_filetype(entry) != AE_IFREG) {
            ::archive_entry_set_size(entry, 0);
        }

        r = ::archive_write_header(a, entry);

        if (r != ARCHIVE_OK) {
            throw std::runtime_error("Could not write file to archive: " + f + ::archive_error_string(a));
        }

        if (::archive_entry_size(entry) != 0) {

            mfile mf(f);

            ssize_t res = ::archive_write_data(a, mf.addr, mf.size);

            if (res != (ssize_t)mf.size) {
                throw std::runtime_error("Could not write file to archive: " + f);
            }

            add_to_rpmprops(entry, &mf, props);

        } else {

            add_to_rpmprops(entry, nullptr, props);
        }

        ::archive_entry_free(entry);
    }

    if (::archive_write_close(a)) {
        throw std::runtime_error("Could not close archive: " + std::string(::archive_error_string(a)));
    }

    if (::archive_read_free(adisk)) {
        throw std::runtime_error("Could not close archive: " + std::string(::archive_error_string(a)));
    }

    ::archive_write_free(a);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3f0, %rsp            # imm = 0x3F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x23690
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x236c0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x23650
callq 0x4460
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2014e
movl $0x10, %edi
callq 0x42f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x300(%rbp)
leaq 0x114b3(%rip), %rsi     # 0x315c3
callq 0x41f0
jmp 0x20117
movq -0x300(%rbp), %rdi
movq 0x19ebb(%rip), %rsi     # 0x39fe0
movq 0x19eac(%rip), %rdx     # 0x39fd8
callq 0x4430
movq -0x300(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x4630
jmp 0x20e7a
callq 0x4400
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x201ba
movl $0x10, %edi
callq 0x42f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x308(%rbp)
leaq 0x11447(%rip), %rsi     # 0x315c3
callq 0x41f0
jmp 0x20183
movq -0x308(%rbp), %rdi
movq 0x19e4f(%rip), %rsi     # 0x39fe0
movq 0x19e40(%rip), %rdx     # 0x39fd8
callq 0x4430
movq -0x308(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x4630
jmp 0x20e7a
movq -0x40(%rbp), %rdi
callq 0x46d0
movq -0x40(%rbp), %rdi
callq 0x4040
movq -0x38(%rbp), %rdi
callq 0x43f0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x202ff
movb $0x1, -0x9a(%rbp)
movl $0x10, %edi
callq 0x42f0
movq %rax, -0x318(%rbp)
movq -0x38(%rbp), %rdi
callq 0x44d0
movq %rax, -0x310(%rbp)
jmp 0x2020c
leaq -0x99(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x46c0
movq -0x310(%rbp), %rsi
movq -0x320(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x45f0
jmp 0x2023b
leaq 0x113a4(%rip), %rsi     # 0x315e6
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rdx
callq 0x21af0
jmp 0x20254
movq -0x318(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4230
jmp 0x20266
movq -0x318(%rbp), %rdi
movb $0x0, -0x9a(%rbp)
movq 0x19d65(%rip), %rsi     # 0x39fe0
movq 0x19d56(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x202e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x202d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x202cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4540
leaq -0x98(%rbp), %rdi
callq 0x4540
leaq -0x99(%rbp), %rdi
callq 0x4820
testb $0x1, -0x9a(%rbp)
jne 0x202ee
jmp 0x202fa
movq -0x318(%rbp), %rdi
callq 0x4630
jmp 0x20e7a
movq -0x38(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4100
movq -0x328(%rbp), %rdi
movq %rax, %rsi
callq 0x45d0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x20425
movb $0x1, -0xe1(%rbp)
movl $0x10, %edi
callq 0x42f0
movq %rax, -0x330(%rbp)
movq -0x8(%rbp), %rdx
leaq 0x112b3(%rip), %rsi     # 0x31605
leaq -0xe0(%rbp), %rdi
callq 0x22dc0
jmp 0x20360
movq -0x38(%rbp), %rdi
callq 0x44d0
movq %rax, -0x338(%rbp)
jmp 0x20372
movq -0x338(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x236f0
jmp 0x2038e
movq -0x330(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x4230
jmp 0x203a3
movq -0x330(%rbp), %rdi
movb $0x0, -0xe1(%rbp)
movq 0x19c28(%rip), %rsi     # 0x39fe0
movq 0x19c19(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20409
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x203fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4540
leaq -0xe0(%rbp), %rdi
callq 0x4540
testb $0x1, -0xe1(%rbp)
jne 0x20414
jmp 0x20420
movq -0x330(%rbp), %rdi
callq 0x4630
jmp 0x20e7a
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rdi
callq 0x23690
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rdi
callq 0x236c0
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x23740
testb $0x1, %al
jne 0x20472
jmp 0x20bfb
leaq -0xf8(%rbp), %rdi
callq 0x23780
movq %rax, -0x108(%rbp)
callq 0x44c0
movq %rax, -0x110(%rbp)
cmpq $0x0, -0x110(%rbp)
jne 0x204f7
movl $0x10, %edi
callq 0x42f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x340(%rbp)
leaq 0x11171(%rip), %rsi     # 0x3162a
callq 0x41f0
jmp 0x204c0
movq -0x340(%rbp), %rdi
movq 0x19b12(%rip), %rsi     # 0x39fe0
movq 0x19b03(%rip), %rdx     # 0x39fd8
callq 0x4430
movq -0x340(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x4630
jmp 0x20e7a
movq -0x110(%rbp), %rax
movq %rax, -0x348(%rbp)
movq -0x108(%rbp), %rdi
callq 0x4100
movq -0x348(%rbp), %rdi
movq %rax, %rsi
callq 0x4510
movq -0x40(%rbp), %rdi
movq -0x110(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %ecx
callq 0x4780
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x2063f
movb $0x1, -0x151(%rbp)
movl $0x10, %edi
callq 0x42f0
movq %rax, -0x350(%rbp)
movq -0x108(%rbp), %rdx
leaq 0x110e7(%rip), %rsi     # 0x31653
leaq -0x150(%rbp), %rdi
callq 0x22dc0
jmp 0x2057a
movq -0x38(%rbp), %rdi
callq 0x44d0
movq %rax, -0x358(%rbp)
jmp 0x2058c
movq -0x358(%rbp), %rdx
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x236f0
jmp 0x205a8
movq -0x350(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x4230
jmp 0x205bd
movq -0x350(%rbp), %rdi
movb $0x0, -0x151(%rbp)
movq 0x19a0e(%rip), %rsi     # 0x39fe0
movq 0x199ff(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20623
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20617
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x4540
leaq -0x150(%rbp), %rdi
callq 0x4540
testb $0x1, -0x151(%rbp)
jne 0x2062e
jmp 0x2063a
movq -0x350(%rbp), %rdi
callq 0x4630
jmp 0x20e7a
movq -0x108(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0x4110
movq -0x10(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0x237a0
testb $0x1, %al
jne 0x20668
jmp 0x20693
leaq 0x11013(%rip), %rsi     # 0x31682
leaq -0x178(%rbp), %rdi
callq 0x4310
jmp 0x2067d
jmp 0x2073a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20bea
leaq -0x178(%rbp), %rdi
callq 0x4270
movq %rax, -0x360(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4270
movq %rax, %rcx
movq -0x360(%rbp), %rax
cmpq %rcx, %rax
jbe 0x20738
movq -0x10(%rbp), %rdi
callq 0x4270
movq %rax, %rdx
movq -0x10(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x178(%rbp), %rdi
callq 0x4750
movl %eax, -0x364(%rbp)
jmp 0x206e6
movl -0x364(%rbp), %eax
cmpl $0x0, %eax
jne 0x20738
movq -0x10(%rbp), %rdi
callq 0x4270
movq %rax, %rdx
leaq -0x198(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movq $-0x1, %rcx
callq 0x46f0
jmp 0x20719
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x43a0
leaq -0x198(%rbp), %rdi
callq 0x4540
jmp 0x2073a
leaq -0x178(%rbp), %rdi
callq 0x4270
cmpq $0x0, %rax
jne 0x207ad
movl $0x10, %edi
callq 0x42f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x370(%rbp)
leaq 0x10eff(%rip), %rsi     # 0x31669
callq 0x41f0
jmp 0x20771
movq -0x370(%rbp), %rdi
movq 0x19861(%rip), %rsi     # 0x39fe0
movq 0x19852(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq -0x370(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x4630
jmp 0x20bea
xorl %eax, %eax
movl %eax, %esi
leaq -0x178(%rbp), %rdi
callq 0x47b0
movq %rax, -0x378(%rbp)
jmp 0x207c6
movq -0x378(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x20815
leaq 0x10d38(%rip), %rsi     # 0x31514
leaq -0x1b8(%rbp), %rdi
leaq -0x178(%rbp), %rdx
callq 0x22dc0
jmp 0x207f1
leaq -0x178(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x43a0
leaq -0x1b8(%rbp), %rdi
callq 0x4540
jmp 0x208b5
leaq -0x178(%rbp), %rdi
callq 0x4270
cmpq $0x2, %rax
jb 0x20878
xorl %eax, %eax
movl %eax, %esi
leaq -0x178(%rbp), %rdi
callq 0x47b0
movq %rax, -0x380(%rbp)
jmp 0x20840
movq -0x380(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x20878
leaq -0x178(%rbp), %rdi
movl $0x1, %esi
callq 0x47b0
movq %rax, -0x388(%rbp)
jmp 0x20869
movq -0x388(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x208b3
leaq 0x10e02(%rip), %rsi     # 0x31681
leaq -0x1d8(%rbp), %rdi
leaq -0x178(%rbp), %rdx
callq 0x22dc0
jmp 0x20894
leaq -0x178(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x43a0
leaq -0x1d8(%rbp), %rdi
callq 0x4540
jmp 0x208b5
movq -0x110(%rbp), %rax
movq %rax, -0x390(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x4100
movq -0x390(%rbp), %rdi
movq %rax, %rsi
callq 0x4560
jmp 0x208e0
movq -0x110(%rbp), %rdi
callq 0x44e0
movl %eax, -0x394(%rbp)
jmp 0x208f4
movl -0x394(%rbp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0x20915
movq -0x110(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4530
jmp 0x20913
jmp 0x20915
movq -0x38(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x42e0
movl %eax, -0x398(%rbp)
jmp 0x2092d
movl -0x398(%rbp), %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x20a39
movb $0x1, -0x219(%rbp)
movl $0x10, %edi
callq 0x42f0
movq %rax, -0x3a0(%rbp)
movq -0x108(%rbp), %rdx
leaq 0x10d1e(%rip), %rsi     # 0x31684
leaq -0x218(%rbp), %rdi
callq 0x22dc0
jmp 0x20974
movq -0x38(%rbp), %rdi
callq 0x44d0
movq %rax, -0x3a8(%rbp)
jmp 0x20986
movq -0x3a8(%rbp), %rdx
leaq -0x1f8(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x236f0
jmp 0x209a2
movq -0x3a0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x4230
jmp 0x209b7
movq -0x3a0(%rbp), %rdi
movb $0x0, -0x219(%rbp)
movq 0x19614(%rip), %rsi     # 0x39fe0
movq 0x19605(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20a1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20a11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x4540
leaq -0x218(%rbp), %rdi
callq 0x4540
testb $0x1, -0x219(%rbp)
jne 0x20a28
jmp 0x20a34
movq -0x3a0(%rbp), %rdi
callq 0x4630
jmp 0x20bea
movq -0x110(%rbp), %rdi
callq 0x4790
movq %rax, -0x3b0(%rbp)
jmp 0x20a4e
movq -0x3b0(%rbp), %rax
cmpq $0x0, %rax
je 0x20ba7
movq -0x108(%rbp), %rsi
leaq -0x238(%rbp), %rdi
callq 0x22ed0
jmp 0x20a74
movq -0x38(%rbp), %rdi
movq -0x238(%rbp), %rsi
movq -0x228(%rbp), %rdx
callq 0x4240
movq %rax, -0x3b8(%rbp)
jmp 0x20a94
movq -0x3b8(%rbp), %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rax
cmpq -0x228(%rbp), %rax
je 0x20b72
movb $0x1, -0x261(%rbp)
movl $0x10, %edi
callq 0x42f0
movq %rax, -0x3c0(%rbp)
movq -0x108(%rbp), %rdx
leaq 0x10ba8(%rip), %rsi     # 0x31684
leaq -0x260(%rbp), %rdi
callq 0x22dc0
jmp 0x20aea
movq -0x3c0(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x4230
jmp 0x20aff
movq -0x3c0(%rbp), %rdi
movb $0x0, -0x261(%rbp)
movq 0x194cc(%rip), %rsi     # 0x39fe0
movq 0x194bd(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20b99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20b59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x4540
testb $0x1, -0x261(%rbp)
jne 0x20b64
jmp 0x20b70
movq -0x3c0(%rbp), %rdi
callq 0x4630
jmp 0x20b99
movq -0x110(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x238(%rbp), %rsi
callq 0x1fc00
jmp 0x20b8b
leaq -0x238(%rbp), %rdi
callq 0x232f0
jmp 0x20bbf
leaq -0x238(%rbp), %rdi
callq 0x232f0
jmp 0x20bea
movq -0x110(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x1fc00
jmp 0x20bbd
jmp 0x20bbf
movq -0x110(%rbp), %rdi
callq 0x47f0
jmp 0x20bcd
leaq -0x178(%rbp), %rdi
callq 0x4540
leaq -0xf8(%rbp), %rdi
callq 0x23830
jmp 0x20456
leaq -0x178(%rbp), %rdi
callq 0x4540
jmp 0x20e7a
movq -0x38(%rbp), %rdi
callq 0x40d0
cmpl $0x0, %eax
je 0x20d33
movb $0x1, -0x2aa(%rbp)
movl $0x10, %edi
callq 0x42f0
movq %rax, -0x3d0(%rbp)
movq -0x38(%rbp), %rdi
callq 0x44d0
movq %rax, -0x3c8(%rbp)
jmp 0x20c37
leaq -0x2a9(%rbp), %rdi
movq %rdi, -0x3d8(%rbp)
callq 0x46c0
movq -0x3c8(%rbp), %rsi
movq -0x3d8(%rbp), %rdx
leaq -0x2a8(%rbp), %rdi
callq 0x45f0
jmp 0x20c66
leaq 0x10a39(%rip), %rsi     # 0x316a6
leaq -0x288(%rbp), %rdi
leaq -0x2a8(%rbp), %rdx
callq 0x21af0
jmp 0x20c82
movq -0x3d0(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x4230
jmp 0x20c97
movq -0x3d0(%rbp), %rdi
movb $0x0, -0x2aa(%rbp)
movq 0x19334(%rip), %rsi     # 0x39fe0
movq 0x19325(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20d17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20d0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20cff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x4540
leaq -0x2a8(%rbp), %rdi
callq 0x4540
leaq -0x2a9(%rbp), %rdi
callq 0x4820
testb $0x1, -0x2aa(%rbp)
jne 0x20d22
jmp 0x20d2e
movq -0x3d0(%rbp), %rdi
callq 0x4630
jmp 0x20e7a
movq -0x40(%rbp), %rdi
callq 0x40f0
cmpl $0x0, %eax
je 0x20e68
movb $0x1, -0x2f2(%rbp)
movl $0x10, %edi
callq 0x42f0
movq %rax, -0x3e8(%rbp)
movq -0x38(%rbp), %rdi
callq 0x44d0
movq %rax, -0x3e0(%rbp)
jmp 0x20d6f
leaq -0x2f1(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
callq 0x46c0
movq -0x3e0(%rbp), %rsi
movq -0x3f0(%rbp), %rdx
leaq -0x2f0(%rbp), %rdi
callq 0x45f0
jmp 0x20d9e
leaq 0x10901(%rip), %rsi     # 0x316a6
leaq -0x2d0(%rbp), %rdi
leaq -0x2f0(%rbp), %rdx
callq 0x21af0
jmp 0x20dba
movq -0x3e8(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x4230
jmp 0x20dcf
movq -0x3e8(%rbp), %rdi
movb $0x0, -0x2f2(%rbp)
movq 0x191fc(%rip), %rsi     # 0x39fe0
movq 0x191ed(%rip), %rdx     # 0x39fd8
callq 0x4430
jmp 0x20e83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20e4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20e43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x20e37
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x4540
leaq -0x2f0(%rbp), %rdi
callq 0x4540
leaq -0x2f1(%rbp), %rdi
callq 0x4820
testb $0x1, -0x2f2(%rbp)
jne 0x20e5a
jmp 0x20e66
movq -0x3e8(%rbp), %rdi
callq 0x4630
jmp 0x20e7a
movq -0x38(%rbp), %rdi
callq 0x4730
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x4440
nopw %cs:(%rax,%rax)