// File: /workspace/github_cpp_makefile_star2_O2/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, -0x78(%rbp)
leaq -0x310(%rbp), %rdi
pushq $0x4
popq %rdx
callq 0x3480
leaq -0x2a0(%rbp), %rdi
callq 0x3060
testb %al, %al
je 0x12037
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movaps 0x5b9d(%rip), %xmm0     # 0x17040
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 0x12668
leaq -0xf0(%rbp), %rsi
movb $0x1a, (%rsi)
leaq -0x50(%rbp), %rdi
callq 0x1382e
leaq -0xf0(%rbp), %rsi
movb $0x0, (%rsi)
leaq -0x50(%rbp), %rdi
callq 0x1382e
leaq -0x50(%rbp), %rdi
movq 0x8(%rdi), %rsi
leaq -0x74(%rbp), %rcx
leaq -0x78(%rbp), %rdx
callq 0x12668
leaq -0xf0(%rbp), %rdi
callq 0x12688
cmpq $0x0, 0x50(%rbx)
je 0x1153b
movq 0x40(%rbx), %rax
leaq -0x70(%rbp), %rsi
andl $0x0, (%rsi)
addq $0x40, %rbx
movq %rbx, 0x8(%rsi)
movq %rax, 0x10(%rsi)
leaq -0xf0(%rbp), %rdi
callq 0x13b1c
leaq -0xf0(%rbp), %rdi
leaq -0x50(%rbp), %rbx
leaq -0x70(%rbp), %r12
callq 0x13bdc
testq %rax, %rax
je 0x11fed
movq -0xc0(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jne 0x1157b
movq -0xa8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x1f8, %ecx            # imm = 0x1F8
addq %rcx, %rax
movl -0x18(%rax), %edx
testq %rdx, %rdx
je 0x115c0
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 0x11fbc
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, -0x74(%rbp)
movq (%rsi), %r14
movq %rsi, -0x88(%rbp)
movb 0x8(%rsi), %al
movb %al, -0x51(%rbp)
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
movq %r12, %rcx
callq 0x126a8
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
leaq -0x74(%rbp), %rdx
leaq -0x70(%rbp), %rcx
callq 0x12668
movq -0x48(%rbp), %rsi
movq %rsi, %rax
subq -0x50(%rbp), %rax
movq %rax, -0x98(%rbp)
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
movq %r12, %rcx
callq 0x126a8
movq %rbx, %rdi
leaq -0x51(%rbp), %rsi
callq 0x126c8
movq -0x48(%rbp), %rsi
movzbl -0x51(%rbp), %ecx
addq %r14, %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x12668
movq -0x88(%rbp), %rax
leaq 0x28(%rax), %rcx
movl -0x50(%rbp), %eax
subl -0x48(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq %rcx, -0xa0(%rbp)
movq %rcx, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq (%rax), %rax
cmpq -0xa0(%rbp), %rax
je 0x11f41
movq %rax, -0x90(%rbp)
movq 0x10(%rax), %r15
movslq (%r15), %rax
leaq 0x567a(%rip), %r14      # 0x16d30
movb (%rax,%r14), %al
movb %al, -0x70(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1382e
movslq (%r15), %rax
movzbl (%rax,%r14), %eax
leal -0x43(%rax), %ecx
cmpl $0x10, %ecx
ja 0x1171b
leaq 0x5581(%rip), %rdx      # 0x16c60
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl 0x30(%r15), %eax
subl 0x28(%r15), %eax
movl %eax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0x6c(%rbp), %rcx
callq 0x12668
movq 0x28(%r15), %rdi
movq 0x30(%r15), %rsi
movq %rbx, %rdx
callq 0x12d4c
jmp 0x11f38
leal -0x62(%rax), %ecx
cmpl $0xa, %ecx
ja 0x117dc
leaq 0x5576(%rip), %rdx      # 0x16ca4
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x18(%r15), %r13
subq 0x10(%r15), %r13
shrq $0x3, %r13
movl %r13d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x12668
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
testl %r13d, %r13d
je 0x11f38
pushq $0x18
popq %rdi
callq 0x3270
movq %rax, %r14
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r12d, %r12d
xorl %ebx, %ebx
movl -0x2c(%rbp), %eax
cmpq %rax, %rbx
jae 0x11cbd
movq 0x10(%r15), %rdx
movq 0x8(%r14), %rsi
leaq (%rdx,%r12), %rcx
incq %rcx
addq %r12, %rdx
movq %r14, %rdi
callq 0x12668
incq %rbx
addq $0x8, %r12
jmp 0x117ad
cmpl $0x59, %eax
jne 0x1168a
movzwl 0x8(%r15), %eax
movw %ax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0x6e(%rbp), %rcx
callq 0x12668
jmp 0x11f38
movq 0x8(%r15), %rax
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0x68(%rbp), %rcx
callq 0x12668
jmp 0x11f38
movss 0x8(%r15), %xmm0
movss %xmm0, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0x6c(%rbp), %rcx
callq 0x12668
jmp 0x11f38
movl 0x8(%r15), %eax
movl %eax, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0x6c(%rbp), %rcx
callq 0x12668
jmp 0x11f38
movb 0x8(%r15), %al
movb %al, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0x6f(%rbp), %rcx
callq 0x12668
jmp 0x11f38
movsd 0x8(%r15), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0x68(%rbp), %rcx
callq 0x12668
jmp 0x11f38
movq 0x18(%r15), %r13
subq 0x10(%r15), %r13
shrq $0x3, %r13
movl %r13d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x12668
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
shll $0x3, %r13d
testl %r13d, %r13d
je 0x11f38
pushq $0x18
popq %rdi
callq 0x3270
movq %rax, %r14
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r12d, %r12d
xorl %ebx, %ebx
movl -0x2c(%rbp), %eax
cmpq %rax, %rbx
jae 0x11b52
movq 0x10(%r15), %rdx
movq 0x8(%r14), %rsi
leaq (%rdx,%r12), %rcx
addq $0x8, %rcx
addq %r12, %rdx
movq %r14, %rdi
callq 0x12668
incq %rbx
addq $0x8, %r12
jmp 0x11924
movq 0x18(%r15), %r13
subq 0x10(%r15), %r13
shrq $0x3, %r13
movl %r13d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x12668
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
shll $0x2, %r13d
testl %r13d, %r13d
je 0x11f38
pushq $0x18
popq %rdi
callq 0x3270
movq %rax, %r14
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r12d, %r12d
xorl %ebx, %ebx
movl -0x2c(%rbp), %eax
cmpq %rax, %rbx
jae 0x11bcb
movq 0x10(%r15), %rdx
movq 0x8(%r14), %rsi
leaq (%rdx,%r12), %rcx
addq $0x4, %rcx
addq %r12, %rdx
movq %r14, %rdi
callq 0x12668
incq %rbx
addq $0x8, %r12
jmp 0x119ce
movq 0x18(%r15), %r13
subq 0x10(%r15), %r13
shrq $0x3, %r13
movl %r13d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x12668
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
shll $0x2, %r13d
testl %r13d, %r13d
je 0x11f38
pushq $0x18
popq %rdi
callq 0x3270
movq %rax, %r14
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r12d, %r12d
xorl %ebx, %ebx
movl -0x2c(%rbp), %eax
cmpq %rax, %rbx
jae 0x11c44
movq 0x10(%r15), %rdx
movq 0x8(%r14), %rsi
leaq (%rdx,%r12), %rcx
addq $0x4, %rcx
addq %r12, %rdx
movq %r14, %rdi
callq 0x12668
incq %rbx
addq $0x8, %r12
jmp 0x11a78
movq 0x18(%r15), %r13
subq 0x10(%r15), %r13
shrq $0x3, %r13
movl %r13d, -0x2c(%rbp)
movq -0x48(%rbp), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
leaq -0x28(%rbp), %rcx
callq 0x12668
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0x4
popq %rdx
leaq -0x70(%rbp), %rcx
callq 0x126a8
shll $0x3, %r13d
testl %r13d, %r13d
je 0x11f38
pushq $0x18
popq %rdi
callq 0x3270
movq %rax, %r14
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
xorl %r12d, %r12d
xorl %ebx, %ebx
movl -0x2c(%rbp), %eax
cmpq %rax, %rbx
jae 0x11d36
movq 0x10(%r15), %rdx
movq 0x8(%r14), %rsi
leaq (%rdx,%r12), %rcx
addq $0x8, %rcx
addq %r12, %rdx
movq %r14, %rdi
callq 0x12668
incq %rbx
addq $0x8, %r12
jmp 0x11b22
movq (%r14), %r12
movq 0x8(%r14), %r15
movl %r15d, %eax
subl %r12d, %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r13d
jbe 0x11dab
pushq $0x18
popq %rdi
callq 0x3270
leaq -0x50(%rbp), %rbx
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rcx
callq 0x14048
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq (%r13), %rdi
movq %r15, %rsi
callq 0x4f63
testl %eax, %eax
je 0x11dd2
movq %r13, %rdi
callq 0x1300c
movq %r13, %rdi
callq 0x3240
xorl %eax, %eax
jmp 0x11dee
movq (%r14), %r12
movq 0x8(%r14), %r15
movl %r15d, %eax
subl %r12d, %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r13d
jbe 0x11db1
pushq $0x18
popq %rdi
callq 0x3270
leaq -0x50(%rbp), %rbx
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rcx
callq 0x14048
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq (%r13), %rdi
movq %r15, %rsi
callq 0x4f63
testl %eax, %eax
je 0x11e18
movq %r13, %rdi
callq 0x1300c
movq %r13, %rdi
callq 0x3240
xorl %eax, %eax
jmp 0x11e34
movq (%r14), %r15
movq 0x8(%r14), %r12
movl %r12d, %eax
subl %r15d, %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r13d
jbe 0x11db7
pushq $0x18
popq %rdi
callq 0x3270
leaq -0x50(%rbp), %rbx
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rcx
callq 0x14048
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq (%r13), %rdi
movq %r15, %rsi
callq 0x4f63
testl %eax, %eax
je 0x11e5e
movq %r13, %rdi
callq 0x1300c
movq %r13, %rdi
callq 0x3240
xorl %eax, %eax
jmp 0x11e7a
movq (%r14), %r12
movq 0x8(%r14), %r15
movl %r15d, %eax
subl %r12d, %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r13d
jbe 0x11dc0
pushq $0x18
popq %rdi
callq 0x3270
leaq -0x50(%rbp), %rbx
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rcx
callq 0x14048
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq (%r13), %rdi
movq %r15, %rsi
callq 0x4f63
testl %eax, %eax
je 0x11ea4
movq %r13, %rdi
callq 0x1300c
movq %r13, %rdi
callq 0x3240
xorl %eax, %eax
jmp 0x11ec0
movq (%r14), %r12
movq 0x8(%r14), %r15
movl %r15d, %eax
subl %r12d, %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r13d
jbe 0x11dc9
pushq $0x18
popq %rdi
callq 0x3270
leaq -0x50(%rbp), %rbx
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rcx
callq 0x14048
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq (%r13), %rdi
movq %r15, %rsi
callq 0x4f63
testl %eax, %eax
je 0x11ee7
movq %r13, %rdi
callq 0x1300c
movq %r13, %rdi
callq 0x3240
xorl %eax, %eax
jmp 0x11f03
leaq -0x50(%rbp), %rbx
jmp 0x11dee
leaq -0x50(%rbp), %rbx
jmp 0x11e34
leaq -0x50(%rbp), %rbx
jmp 0x11e7a
leaq -0x50(%rbp), %rbx
jmp 0x11ec0
leaq -0x50(%rbp), %rbx
jmp 0x11f03
movq %r14, %rdi
callq 0x1300c
movq %r14, %rdi
callq 0x3240
movl -0x70(%rbp), %eax
movl %eax, -0x30(%rbp)
pushq $0x1
popq %rax
movq %r13, %r14
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r14), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x1407a
jmp 0x11f28
movq %r14, %rdi
callq 0x1300c
movq %r14, %rdi
callq 0x3240
movl -0x70(%rbp), %eax
movl %eax, -0x30(%rbp)
pushq $0x1
popq %rax
movq %r13, %r14
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r14), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x1407a
jmp 0x11f28
movq %r14, %rdi
callq 0x1300c
movq %r14, %rdi
callq 0x3240
movl -0x70(%rbp), %eax
movl %eax, -0x30(%rbp)
pushq $0x1
popq %rax
movq %r13, %r14
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r14), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x1407a
jmp 0x11f28
movq %r14, %rdi
callq 0x1300c
movq %r14, %rdi
callq 0x3240
movl -0x70(%rbp), %eax
movl %eax, -0x30(%rbp)
pushq $0x1
popq %rax
movq %r13, %r14
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r14), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x1407a
jmp 0x11f28
movq %r14, %rdi
callq 0x1300c
movq %r14, %rdi
callq 0x3240
movl -0x70(%rbp), %eax
movl %eax, -0x30(%rbp)
pushq $0x1
popq %rax
movq %r13, %r14
movq -0x48(%rbp), %rcx
movl %eax, -0x8(%rcx)
movq -0x48(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, -0x4(%rax)
movq -0x48(%rbp), %rsi
movq (%r14), %rdx
movl %ecx, %ecx
addq %rdx, %rcx
movq %rbx, %rdi
callq 0x1407a
movq %r14, %rdi
callq 0x1300c
movq %r14, %rdi
callq 0x3240
leaq -0x70(%rbp), %r12
jmp 0x1168a
movl -0x48(%rbp), %eax
movq -0x50(%rbp), %rcx
subl %ecx, %eax
addl -0x7c(%rbp), %eax
movl %eax, %edx
movq -0x98(%rbp), %rdi
movl %edi, %esi
movb %al, (%rcx,%rsi)
leal 0x1(%rdi), %ecx
movq -0x50(%rbp), %rsi
movb %ah, (%rsi,%rcx)
shrl $0x10, %eax
shrl $0x18, %edx
leal 0x2(%rdi), %ecx
movq -0x50(%rbp), %rsi
movb %al, (%rsi,%rcx)
addl $0x3, %edi
movq -0x50(%rbp), %rax
movb %dl, (%rax,%rdi)
movq -0x88(%rbp), %rcx
cmpq $0x0, 0x50(%rcx)
je 0x11fb0
movq 0x40(%rcx), %rax
andl $0x0, -0x70(%rbp)
addq $0x40, %rcx
movq %rcx, -0x68(%rbp)
movq %rax, -0x60(%rbp)
leaq -0xf0(%rbp), %rdi
movq %r12, %rsi
callq 0x13b1c
leaq -0xf0(%rbp), %rdi
jmp 0x1154a
movq -0x48(%rbp), %rsi
movb $0x0, -0x70(%rbp)
movq %rbx, %rdi
pushq $0xd
popq %rdx
movq %r12, %rcx
callq 0x126a8
leaq -0xf0(%rbp), %rbx
movq %rbx, %rdi
callq 0x13f2a
movq %rbx, %rdi
leaq -0x50(%rbp), %rbx
jmp 0x1154a
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
subq %rsi, %rdx
leaq -0x310(%rbp), %rdi
callq 0x3320
leaq -0xf0(%rbp), %rdi
callq 0x12d88
leaq -0x50(%rbp), %rdi
callq 0x1300c
leaq -0x310(%rbp), %rdi
callq 0x3370
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x3140
movq %rax, %r14
leaq 0x4d4f(%rip), %rsi      # 0x16d98
movq %rax, %rdi
callq 0x30d0
movq 0xaf98(%rip), %rsi      # 0x1cff0
movq 0xaf69(%rip), %rdx      # 0x1cfc8
movq %r14, %rdi
callq 0x3420
movq %rax, %rbx
jmp 0x120d1
movq %rax, %rbx
movq %r14, %rdi
callq 0x31c0
jmp 0x120d1
jmp 0x120b9
jmp 0x120b9
jmp 0x12085
jmp 0x12085
jmp 0x12085
jmp 0x12085
movq %rax, %rbx
jmp 0x120c8
jmp 0x120b9
jmp 0x120b9
jmp 0x12096
jmp 0x12096
jmp 0x12096
jmp 0x12096
movq %rax, %rbx
movq %r13, %rdi
callq 0x3240
jmp 0x120bc
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
jmp 0x120b9
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x12d88
leaq -0x50(%rbp), %rdi
callq 0x1300c
leaq -0x310(%rbp), %rdi
callq 0x3370
movq %rbx, %rdi
callq 0x3450
nop