// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/fbx.cpp
// Function: Fbx::Record::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int) const
void Record::write(const std::string & filename, const uint32_t version) const
    {
        std::ofstream file(filename, std::ios::binary);
        if (file.is_open() == false)
        {
            throw std::runtime_error("Failed to open file.");
        }

        std::vector<uint8_t> data;

        // Write FBX header.
        const uint8_t magic[21] = "Kaydara FBX Binary  ";
        const uint8_t * pVersion = reinterpret_cast<const uint8_t*>(&version);

        data.insert(data.end(), magic, magic + 21);
        data.push_back(0x1A);
        data.push_back(0);
        data.insert(data.end(), pVersion, pVersion + 4);

        std::stack<std::tuple<ConstIterator, ConstIterator, uint32_t>> stack;
        if (m_nestedList.size())
        {
            stack.push(std::make_tuple(m_nestedList.begin(), m_nestedList.end(), 0));
        }

        while (stack.size())
        {
            auto & top = stack.top();
            ConstIterator & currentIt = std::get<0>(top);
            ConstIterator & endIt = std::get<1>(top);
            uint32_t & parentStart = std::get<2>(top);

            if (parentStart != 0)
            {
                const uint32_t currentPos = static_cast<uint32_t>(data.size());
                const uint8_t * pCurrentPos = reinterpret_cast<const uint8_t *>(&currentPos);
                data[parentStart] = pCurrentPos[0];
                data[parentStart + 1] = pCurrentPos[1];
                data[parentStart + 2] = pCurrentPos[2];
                data[parentStart + 3] = pCurrentPos[3];
            }

            if (currentIt == endIt)
            {
                data.insert(data.end(), 13, 0);
                stack.pop();

                continue;
            }

            const Record * pRecord = *currentIt;
            parentStart = static_cast<uint32_t>(data.size());
            ++currentIt;

            // Write record header.
            const auto & properties = pRecord->properties();
            const uint32_t numProperties = static_cast<uint32_t>(properties.size());
            const uint8_t * pNumProperties = reinterpret_cast<const uint8_t*>(&numProperties);
            const std::string & name = pRecord->name();
            const uint8_t * pName = reinterpret_cast<const uint8_t*>(&name[0]);
            const uint8_t nameLength = static_cast<uint8_t>(name.size());
            data.insert(data.end(), 4, 0);
            data.insert(data.end(), pNumProperties, pNumProperties + 4);
            const uint32_t propertiesOffset = static_cast<uint32_t>(data.size());
            data.insert(data.end(), 4, 0);
            data.push_back(nameLength);
            data.insert(data.end(), pName, pName + nameLength);

            // Write record properties.
            const uint32_t propertyStart = static_cast<uint32_t>(data.size());
            for (auto pIt = properties.begin(); pIt != properties.end(); ++pIt)
            {
                Property * pProperty = *pIt;
                data.push_back(pProperty->code());

                switch (pProperty->code())
                {
                case 'I': writePrimitive(data, pProperty->primitive().integer32); break;
                case 'L': writePrimitive(data, pProperty->primitive().integer64); break;
                case 'F': writePrimitive(data, pProperty->primitive().float32); break;
                case 'D': writePrimitive(data, pProperty->primitive().float64); break;
                case 'C': writePrimitive(data, pProperty->primitive().boolean); break;
                case 'Y': writePrimitive(data, pProperty->primitive().integer16); break;
                case 'i': writeArray<int32_t>(data, pProperty->array()); break;
                case 'l': writeArray<int64_t>(data, pProperty->array()); break;
                case 'f': writeArray<float>(data, pProperty->array()); break;
                case 'd': writeArray<double>(data, pProperty->array()); break;
                case 'b': writeArray<bool>(data, pProperty->array()); break;
                case 'R':
                case 'S': writeRaw(data, pProperty->raw()); break;
                default: break;
                }
            }

            // Set properties length
            const uint32_t propertiesEnd = static_cast<uint32_t>(data.size());
            const uint32_t propertiesLength = propertiesEnd - propertyStart;
            const uint8_t * pPropertiesLength = reinterpret_cast<const uint8_t*>(&propertiesLength);
            data[propertiesOffset] = pPropertiesLength[0];
            data[propertiesOffset + 1] = pPropertiesLength[1];
            data[propertiesOffset + 2] = pPropertiesLength[2];
            data[propertiesOffset + 3] = pPropertiesLength[3];

            // Add nested list.
            if (pRecord->size())
            {
                stack.push(std::make_tuple(pRecord->begin(), pRecord->end(), 0));
            }
            
        }

        file.write(reinterpret_cast<const char*>(&data[0]), data.size());
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, %rbx
movl %edx, -0x70(%rbp)
leaq -0x310(%rbp), %rdi
movl $0x4, %edx
callq 0x3460
leaq -0x2a0(%rbp), %rdi
callq 0x3070
testb %al, %al
je 0x12f3f
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movaps 0x5ee8(%rip), %xmm0     # 0x18060
leaq -0xfb(%rbp), %rcx
movaps %xmm0, -0x15(%rcx)
movabsq $0x20207972616e69, %rax # imm = 0x20207972616E69
movq %rax, -0x8(%rcx)
leaq -0x110(%rbp), %rdx
xorl %esi, %esi
callq 0x13a4a
movb $0x1a, -0xe0(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x121c0
movb $0x1a, (%rsi)
movq -0x48(%rbp), %rsi
incq %rsi
movq %rsi, -0x48(%rbp)
jmp 0x121d4
leaq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x14248
movq -0x48(%rbp), %rsi
movb $0x0, -0xe0(%rbp)
cmpq -0x40(%rbp), %rsi
je 0x121f1
movb $0x0, (%rsi)
movq -0x48(%rbp), %rsi
incq %rsi
movq %rsi, -0x48(%rbp)
jmp 0x12205
leaq -0x50(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x14248
movq -0x48(%rbp), %rsi
leaq -0x6c(%rbp), %rcx
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x13a4a
xorps %xmm0, %xmm0
leaq -0xe0(%rbp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x1433a
cmpq $0x0, 0x50(%rbx)
je 0x12267
movq 0x40(%rbx), %rax
addq $0x40, %rbx
leaq -0x68(%rbp), %rsi
movl $0x0, (%rsi)
movq %rbx, 0x8(%rsi)
movq %rax, 0x10(%rsi)
leaq -0xe0(%rbp), %rdi
callq 0x144e8
leaq -0x50(%rbp), %r13
leaq -0x68(%rbp), %r14
movq -0x98(%rbp), %rcx
movq %rcx, %rax
subq -0xb8(%rbp), %rax
sarq $0x3, %rax
cmpq $0x1, %rcx
adcq $-0x1, %rax
leaq (%rax,%rax,4), %rdx
leaq (%rax,%rdx,4), %rsi
movq -0xc0(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq -0xa8(%rbp), %rdx
movq %rax, %r8
subq %rdx, %r8
sarq $0x3, %r8
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r9, %r8
subq -0xd0(%rbp), %rdi
addq %rsi, %r8
sarq $0x3, %rdi
movabsq $0x5555555555555555, %rsi # imm = 0x5555555555555555
imulq %rsi, %rdi
cmpq %rdi, %r8
je 0x12ec6
cmpq %rdx, %rax
jne 0x122f7
movq -0x8(%rcx), %rax
movl $0x1f8, %ecx            # imm = 0x1F8
addq %rcx, %rax
movl -0x18(%rax), %edx
testq %rdx, %rdx
je 0x1233c
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rcx
subq %rsi, %rcx
movl %ecx, %edi
movb %cl, (%rsi,%rdx)
movl -0x18(%rax), %edx
incl %edx
movq -0x50(%rbp), %rsi
movb %ch, (%rsi,%rdx)
shrl $0x10, %ecx
shrl $0x18, %edi
movl -0x18(%rax), %edx
addl $0x2, %edx
movq -0x50(%rbp), %rsi
movb %cl, (%rsi,%rdx)
movl -0x18(%rax), %ecx
addl $0x3, %ecx
movq -0x50(%rbp), %rdx
movb %dil, (%rdx,%rcx)
movq -0x8(%rax), %rcx
cmpq -0x10(%rax), %rcx
je 0x123e2
movq 0x10(%rcx), %rsi
movl -0x48(%rbp), %edx
subl -0x50(%rbp), %edx
movl %edx, -0x18(%rax)
movq (%rcx), %rcx
movq %rcx, -0x8(%rax)
movl 0x38(%rsi), %eax
movl %eax, -0x6c(%rbp)
movq (%rsi), %r12
movq %rsi, -0x88(%rbp)
movb 0x8(%rsi), %al
movb %al, -0x2d(%rbp)
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x1474e
movq -0x48(%rbp), %rsi
movq %r13, %rdi
leaq -0x6c(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0x13a4a
movq -0x48(%rbp), %rsi
movq %rsi, %rax
subq -0x50(%rbp), %rax
movq %rax, -0xe8(%rbp)
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x1474e
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x1241a
movb -0x2d(%rbp), %al
movb %al, (%rsi)
movq -0x48(%rbp), %rsi
incq %rsi
movq %rsi, -0x48(%rbp)
jmp 0x1242d
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0xd, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x1474e
movq -0xb0(%rbp), %rax
movq -0xa8(%rbp), %rdi
cmpq %rdi, %rax
je 0x12e84
addq $-0x18, %rax
jmp 0x12eba
movq %r13, %rdi
leaq -0x2d(%rbp), %rdx
callq 0x14958
movq -0x48(%rbp), %rsi
movb -0x2d(%rbp), %al
movzbl %al, %ecx
addq %r12, %rcx
movq %r13, %rdi
movq %r12, %rdx
callq 0x13a4a
movq -0x88(%rbp), %rax
leaq 0x28(%rax), %rcx
movq -0x50(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x78(%rbp)
movq (%rcx), %rax
movq %rcx, -0xf0(%rbp)
cmpq %rcx, %rax
je 0x12dfa
movq %rax, -0xf8(%rbp)
movq 0x10(%rax), %rbx
movslq (%rbx), %rax
leaq 0x58cf(%rip), %rcx      # 0x17d50
movb (%rax,%rcx), %al
movb %al, -0x68(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x12499
movb %al, (%rsi)
incq -0x48(%rbp)
jmp 0x124a4
movq %r13, %rdi
movq %r14, %rdx
callq 0x14248
movslq (%rbx), %rax
leaq 0x58a2(%rip), %rcx      # 0x17d50
movzbl (%rax,%rcx), %eax
leal -0x43(%rax), %ecx
cmpl $0x10, %ecx
ja 0x124fb
leaq 0x57bf(%rip), %rdx      # 0x17c80
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl 0x30(%rbx), %eax
subl 0x28(%rbx), %eax
movl %eax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x64(%rbp), %rcx
callq 0x13a4a
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
movq %r13, %rdx
callq 0x138fa
jmp 0x12dcd
leal -0x62(%rax), %ecx
cmpl $0xa, %ecx
ja 0x125dd
leaq 0x57b6(%rip), %rdx      # 0x17cc4
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x18(%rbx), %r14
subq 0x10(%rbx), %r14
shrq $0x3, %r14
movl %r14d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x13a4a
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
testl %r14d, %r14d
je 0x12dcd
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12a4c
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdx
movq 0x8(%r12), %rsi
leaq (%rdx,%r15), %rcx
incq %rcx
addq %r15, %rdx
movq %r12, %rdi
callq 0x13a4a
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x125a1
movq (%r12), %r15
movq 0x8(%r12), %rbx
leaq -0x50(%rbp), %r13
jmp 0x12a51
cmpl $0x59, %eax
jne 0x12dd1
movzwl 0x8(%rbx), %eax
movw %ax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x66(%rbp), %rcx
callq 0x13a4a
jmp 0x12dcd
movss 0x8(%rbx), %xmm0
movss %xmm0, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x64(%rbp), %rcx
callq 0x13a4a
jmp 0x12dcd
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x60(%rbp), %rcx
callq 0x13a4a
jmp 0x12dcd
movb 0x8(%rbx), %al
movb %al, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x67(%rbp), %rcx
callq 0x13a4a
jmp 0x12dcd
movl 0x8(%rbx), %eax
movl %eax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x64(%rbp), %rcx
callq 0x13a4a
jmp 0x12dcd
movq 0x8(%rbx), %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x60(%rbp), %rcx
callq 0x13a4a
jmp 0x12dcd
movq 0x18(%rbx), %r14
subq 0x10(%rbx), %r14
shrq $0x3, %r14
movl %r14d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x13a4a
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
shll $0x3, %r14d
testl %r14d, %r14d
je 0x12dcd
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x129d2
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdx
movq 0x8(%r12), %rsi
leaq (%rdx,%r15), %rcx
addq $0x8, %rcx
addq %r15, %rdx
movq %r12, %rdi
callq 0x13a4a
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x12734
movq (%r12), %r15
movq 0x8(%r12), %rbx
leaq -0x50(%rbp), %r13
jmp 0x129d7
movq 0x18(%rbx), %r14
subq 0x10(%rbx), %r14
shrq $0x3, %r14
movl %r14d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x13a4a
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
shll $0x2, %r14d
testl %r14d, %r14d
je 0x12dcd
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12ac6
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdx
movq 0x8(%r12), %rsi
leaq (%rdx,%r15), %rcx
addq $0x4, %rcx
addq %r15, %rdx
movq %r12, %rdi
callq 0x13a4a
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x127ff
movq (%r12), %r15
movq 0x8(%r12), %rbx
leaq -0x50(%rbp), %r13
jmp 0x12acb
movq 0x18(%rbx), %r14
subq 0x10(%rbx), %r14
shrq $0x3, %r14
movl %r14d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x13a4a
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
shll $0x2, %r14d
testl %r14d, %r14d
je 0x12dcd
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12b40
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdx
movq 0x8(%r12), %rsi
leaq (%rdx,%r15), %rcx
addq $0x4, %rcx
addq %r15, %rdx
movq %r12, %rdi
callq 0x13a4a
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x128ca
movq (%r12), %r15
movq 0x8(%r12), %rbx
leaq -0x50(%rbp), %r13
jmp 0x12b45
movq 0x18(%rbx), %r14
subq 0x10(%rbx), %r14
shrq $0x3, %r14
movl %r14d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x13a4a
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x1474e
shll $0x3, %r14d
testl %r14d, %r14d
je 0x12dcd
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12bba
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0x10(%rbx), %rdx
movq 0x8(%r12), %rsi
leaq (%rdx,%r15), %rcx
addq $0x8, %rcx
addq %r15, %rdx
movq %r12, %rdi
callq 0x13a4a
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x12995
movq (%r12), %r15
movq 0x8(%r12), %rbx
leaq -0x50(%rbp), %r13
jmp 0x12bbf
xorl %r15d, %r15d
xorl %ebx, %ebx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12c58
movl $0x18, %edi
callq 0x3260
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14a4a
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fa8
testl %eax, %eax
je 0x12c34
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12a3d
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12c58
xorl %r15d, %r15d
xorl %ebx, %ebx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12ca7
movl $0x18, %edi
callq 0x3260
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14a4a
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fa8
testl %eax, %eax
je 0x12c83
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12ab7
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12ca7
xorl %r15d, %r15d
xorl %ebx, %ebx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12cf6
movl $0x18, %edi
callq 0x3260
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14a4a
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fa8
testl %eax, %eax
je 0x12cd2
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12b31
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12cf6
xorl %r15d, %r15d
xorl %ebx, %ebx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12d45
movl $0x18, %edi
callq 0x3260
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14a4a
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fa8
testl %eax, %eax
je 0x12d21
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12bab
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12d45
xorl %r15d, %r15d
xorl %ebx, %ebx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12d91
movl $0x18, %edi
callq 0x3260
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14a4a
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fa8
testl %eax, %eax
je 0x12d6d
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12c25
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12d91
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12c42
callq 0x3230
movq %r12, %rdi
callq 0x3230
movl -0x68(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x1, %eax
movq %r14, %r12
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r12), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %r13, %rdi
callq 0x14aea
jmp 0x12db7
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12c91
callq 0x3230
movq %r12, %rdi
callq 0x3230
movl -0x68(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x1, %eax
movq %r14, %r12
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r12), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %r13, %rdi
callq 0x14aea
jmp 0x12db7
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12ce0
callq 0x3230
movq %r12, %rdi
callq 0x3230
movl -0x68(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x1, %eax
movq %r14, %r12
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r12), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %r13, %rdi
callq 0x14aea
jmp 0x12db7
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12d2f
callq 0x3230
movq %r12, %rdi
callq 0x3230
movl -0x68(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x1, %eax
movq %r14, %r12
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r12), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %r13, %rdi
callq 0x14aea
jmp 0x12db7
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12d7b
callq 0x3230
movq %r12, %rdi
callq 0x3230
movl -0x68(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x1, %eax
movq %r14, %r12
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r12), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %r13, %rdi
callq 0x14aea
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12dc5
callq 0x3230
movq %r12, %rdi
callq 0x3230
leaq -0x68(%rbp), %r14
movq -0xf8(%rbp), %rax
movq (%rax), %rax
cmpq -0xf0(%rbp), %rax
jne 0x1246c
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
movq -0x80(%rbp), %rdx
movq -0x78(%rbp), %rsi
jmp 0x12e08
movq -0x80(%rbp), %rdx
movq %rdx, %rcx
movq -0x78(%rbp), %rsi
movq %rsi, %rax
subl %esi, %edx
subl %ecx, %eax
addl %edx, %eax
movl %eax, %edx
shrl $0x10, %edx
movl %eax, %esi
shrl $0x18, %esi
movq -0xe8(%rbp), %r8
movl %r8d, %edi
movb %al, (%rcx,%rdi)
leal 0x1(%r8), %ecx
movq -0x50(%rbp), %rdi
movb %ah, (%rdi,%rcx)
leal 0x2(%r8), %eax
movq -0x50(%rbp), %rcx
movb %dl, (%rcx,%rax)
addl $0x3, %r8d
movq -0x50(%rbp), %rax
movb %sil, (%rax,%r8)
movq -0x88(%rbp), %rcx
cmpq $0x0, 0x50(%rcx)
je 0x1226f
movq 0x40(%rcx), %rax
addq $0x40, %rcx
movl $0x0, -0x68(%rbp)
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
leaq -0xe0(%rbp), %rdi
movq %r14, %rsi
callq 0x144e8
jmp 0x1226f
callq 0x3230
movq -0x98(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0x98(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
leaq 0x1f8(%rax), %rcx
movq %rcx, -0xa0(%rbp)
addq $0x1e0, %rax            # imm = 0x1E0
movq %rax, -0xb0(%rbp)
jmp 0x1226f
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
subq %rsi, %rdx
leaq -0x310(%rbp), %rdi
callq 0x3310
leaq -0xe0(%rbp), %rdi
callq 0x13952
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x12ef7
callq 0x3230
movq 0xa0ba(%rip), %rax      # 0x1cfb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x308(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x310(%rbp,%rcx)
callq 0x31f0
leaq -0x218(%rbp), %rdi
callq 0x30c0
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3120
movq %rax, %r14
leaq 0x4e65(%rip), %rsi      # 0x17db8
movq %rax, %rdi
callq 0x30f0
movq 0xa086(%rip), %rsi      # 0x1cfe8
movq 0xa057(%rip), %rdx      # 0x1cfc0
movq %r14, %rdi
callq 0x3400
jmp 0x12f8f
jmp 0x12f8f
movq %rax, %rbx
jmp 0x12fe0
movq %rax, %rbx
movq %r14, %rdi
callq 0x31b0
jmp 0x12fe0
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12f8f
jmp 0x12f8f
movq %rax, %rbx
jmp 0x12fd2
jmp 0x12fc3
jmp 0x12f9e
jmp 0x12f9e
jmp 0x12f9e
jmp 0x12f9e
movq %rax, %rbx
movq %r14, %rdi
callq 0x3230
jmp 0x12fc6
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
jmp 0x12fc3
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x13952
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x12fe0
callq 0x3230
leaq -0x310(%rbp), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3430