// File: /workspace/github_cpp_makefile_star2_O1/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 $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, %rbx
movl %edx, -0x70(%rbp)
leaq -0x300(%rbp), %rdi
movl $0x4, %edx
callq 0x3460
leaq -0x290(%rbp), %rdi
callq 0x3070
testb %al, %al
je 0x1319d
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movaps 0x5c48(%rip), %xmm0     # 0x18080
leaq -0xeb(%rbp), %rcx
movaps %xmm0, -0x15(%rcx)
movabsq $0x20207972616e69, %rax # imm = 0x20207972616E69
movq %rax, -0x8(%rcx)
movq 0x8(%rdi), %rsi
leaq -0x100(%rbp), %rdx
callq 0x13ca2
movb $0x1a, -0xd0(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x1247b
movb $0x1a, (%rsi)
incq -0x48(%rbp)
jmp 0x1248b
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
callq 0x144b8
movb $0x0, -0xd0(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x124a5
movb $0x0, (%rsi)
incq -0x48(%rbp)
jmp 0x124b5
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
callq 0x144b8
leaq -0x50(%rbp), %rdi
movq 0x8(%rdi), %rsi
leaq -0x6c(%rbp), %rcx
leaq -0x70(%rbp), %rdx
callq 0x13ca2
xorps %xmm0, %xmm0
leaq -0xd0(%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 0x145aa
cmpq $0x0, 0x50(%rbx)
je 0x1251b
movq 0x40(%rbx), %rax
addq $0x40, %rbx
leaq -0x68(%rbp), %rsi
movl $0x0, (%rsi)
movq %rbx, 0x8(%rsi)
movq %rax, 0x10(%rsi)
leaq -0xd0(%rbp), %rdi
callq 0x14758
leaq -0x50(%rbp), %r13
leaq -0x68(%rbp), %r14
movq -0x88(%rbp), %rcx
movq %rcx, %rax
subq -0xa8(%rbp), %rax
sarq $0x3, %rax
cmpq $0x1, %rcx
adcq $-0x1, %rax
leaq (%rax,%rax,4), %rdx
leaq (%rax,%rdx,4), %rsi
movq -0xb0(%rbp), %rdi
movq -0xa0(%rbp), %rax
movq -0x98(%rbp), %rdx
movq %rax, %r8
subq %rdx, %r8
sarq $0x3, %r8
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r9, %r8
subq -0xc0(%rbp), %rdi
addq %rsi, %r8
sarq $0x3, %rdi
movabsq $0x5555555555555555, %rsi # imm = 0x5555555555555555
imulq %rsi, %rdi
cmpq %rdi, %r8
je 0x13124
cmpq %rdx, %rax
jne 0x125ab
movq -0x8(%rcx), %rax
movl $0x1f8, %ecx            # imm = 0x1F8
addq %rcx, %rax
movl -0x18(%rax), %edx
testq %rdx, %rdx
je 0x125f0
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 0x1268c
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, -0x80(%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 0x149be
movq -0x48(%rbp), %rsi
movq %r13, %rdi
leaq -0x6c(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0x13ca2
movq -0x48(%rbp), %rsi
movq %rsi, %rax
subq -0x50(%rbp), %rax
movq %rax, -0xd8(%rbp)
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x149be
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x126c4
movb -0x2d(%rbp), %al
movb %al, (%rsi)
incq -0x48(%rbp)
jmp 0x126d0
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0xd, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x149be
movq -0xa0(%rbp), %rax
movq -0x98(%rbp), %rdi
cmpq %rdi, %rax
je 0x130e2
addq $-0x18, %rax
jmp 0x13118
movq %r13, %rdi
leaq -0x2d(%rbp), %rdx
callq 0x14b8e
movq -0x48(%rbp), %rsi
movzbl -0x2d(%rbp), %ecx
addq %r12, %rcx
movq %r13, %rdi
movq %r12, %rdx
callq 0x13ca2
movq -0x80(%rbp), %rax
leaq 0x28(%rax), %rcx
movl -0x50(%rbp), %eax
subl -0x48(%rbp), %eax
movl %eax, -0x74(%rbp)
movq (%rcx), %rax
movq %rcx, -0xe0(%rbp)
cmpq %rcx, %rax
je 0x1306a
movq %rax, -0xe8(%rbp)
movq 0x10(%rax), %rbx
movslq (%rbx), %rax
leaq 0x5631(%rip), %rcx      # 0x17d50
movb (%rax,%rcx), %al
movb %al, -0x68(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x12737
movb %al, (%rsi)
incq -0x48(%rbp)
jmp 0x12742
movq %r13, %rdi
movq %r14, %rdx
callq 0x144b8
movslq (%rbx), %rax
leaq 0x5604(%rip), %rcx      # 0x17d50
movzbl (%rax,%rcx), %eax
leal -0x43(%rax), %ecx
cmpl $0x10, %ecx
ja 0x12799
leaq 0x5521(%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 0x13ca2
movq 0x28(%rbx), %rdi
movq 0x30(%rbx), %rsi
movq %r13, %rdx
callq 0x13b62
jmp 0x1304f
leal -0x62(%rax), %ecx
cmpl $0xa, %ecx
ja 0x128e7
leaq 0x5518(%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 0x13ca2
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
testl %r14d, %r14d
je 0x1304f
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12865
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 0x13ca2
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x1283b
movq (%r12), %r15
movq 0x8(%r12), %rbx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12e92
movl $0x18, %edi
callq 0x3260
leaq -0x50(%rbp), %r13
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14c80
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fc3
testl %eax, %eax
je 0x12f05
movq (%r14), %rdi
testq %rdi, %rdi
je 0x128d8
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12f29
cmpl $0x59, %eax
jne 0x13053
movzwl 0x8(%rbx), %eax
movw %ax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x66(%rbp), %rcx
callq 0x13ca2
jmp 0x1304f
movss 0x8(%rbx), %xmm0
movss %xmm0, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x64(%rbp), %rcx
callq 0x13ca2
jmp 0x1304f
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x60(%rbp), %rcx
callq 0x13ca2
jmp 0x1304f
movb 0x8(%rbx), %al
movb %al, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x67(%rbp), %rcx
callq 0x13ca2
jmp 0x1304f
movl 0x8(%rbx), %eax
movl %eax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x64(%rbp), %rcx
callq 0x13ca2
jmp 0x1304f
movq 0x8(%rbx), %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rsi
movq %r13, %rdi
movq %r14, %rdx
leaq -0x60(%rbp), %rcx
callq 0x13ca2
jmp 0x1304f
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 0x13ca2
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
shll $0x3, %r14d
testl %r14d, %r14d
je 0x1304f
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12a65
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 0x13ca2
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x12a3a
movq (%r12), %r15
movq 0x8(%r12), %rbx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12e8c
movl $0x18, %edi
callq 0x3260
leaq -0x50(%rbp), %r13
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14c80
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fc3
testl %eax, %eax
je 0x12eb6
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12ad8
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12eda
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 0x13ca2
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
shll $0x2, %r14d
testl %r14d, %r14d
je 0x1304f
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12b9c
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 0x13ca2
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x12b71
movq (%r12), %r15
movq 0x8(%r12), %rbx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12e9b
movl $0x18, %edi
callq 0x3260
leaq -0x50(%rbp), %r13
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14c80
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fc3
testl %eax, %eax
je 0x12f54
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12c0f
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12f78
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 0x13ca2
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
shll $0x2, %r14d
testl %r14d, %r14d
je 0x1304f
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12cd3
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 0x13ca2
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x12ca8
movq (%r12), %rbx
movq 0x8(%r12), %r15
movl %r15d, %eax
subl %ebx, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12ea4
movl $0x18, %edi
callq 0x3260
leaq -0x50(%rbp), %r13
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14c80
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fc3
testl %eax, %eax
je 0x12fa3
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12d46
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x12fc7
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 0x13ca2
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
movq -0x48(%rbp), %rsi
movb $0x0, -0x68(%rbp)
movl $0x4, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rcx
callq 0x149be
shll $0x3, %r14d
testl %r14d, %r14d
je 0x1304f
movl $0x18, %edi
callq 0x3260
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x12e0a
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 0x13ca2
incq %r13
movl -0x2c(%rbp), %eax
addq $0x8, %r15
cmpq %rax, %r13
jb 0x12ddf
movq (%r12), %r15
movq 0x8(%r12), %rbx
movl %ebx, %eax
subl %r15d, %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x7f, %r14d
jbe 0x12ead
movl $0x18, %edi
callq 0x3260
leaq -0x50(%rbp), %r13
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq -0x68(%rbp), %rbx
movq %rbx, %rcx
callq 0x14c80
movq (%r12), %rdx
movq 0x8(%r12), %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3fc3
testl %eax, %eax
je 0x12fef
movq (%r14), %rdi
testq %rdi, %rdi
je 0x12e7d
callq 0x3230
movq %r14, %rdi
callq 0x3230
xorl %eax, %eax
jmp 0x13013
leaq -0x50(%rbp), %r13
jmp 0x12eda
leaq -0x50(%rbp), %r13
jmp 0x12f29
leaq -0x50(%rbp), %r13
jmp 0x12f78
leaq -0x50(%rbp), %r13
jmp 0x12fc7
leaq -0x50(%rbp), %r13
jmp 0x13013
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12ec4
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 0x14d24
jmp 0x13039
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12f13
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 0x14d24
jmp 0x13039
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12f62
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 0x14d24
jmp 0x13039
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12fb1
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 0x14d24
jmp 0x13039
movq (%r12), %rdi
testq %rdi, %rdi
je 0x12ffd
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 0x14d24
movq (%r12), %rdi
testq %rdi, %rdi
je 0x13047
callq 0x3230
movq %r12, %rdi
callq 0x3230
leaq -0x68(%rbp), %r14
movq -0xe8(%rbp), %rax
movq (%rax), %rax
cmpq -0xe0(%rbp), %rax
jne 0x1270a
movl -0x48(%rbp), %eax
movq -0x50(%rbp), %rcx
subl %ecx, %eax
addl -0x74(%rbp), %eax
movl %eax, %edx
movq -0xd8(%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 -0x80(%rbp), %rcx
cmpq $0x0, 0x50(%rcx)
je 0x12523
movq 0x40(%rcx), %rax
addq $0x40, %rcx
movl $0x0, -0x68(%rbp)
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
leaq -0xd0(%rbp), %rdi
movq %r14, %rsi
callq 0x14758
jmp 0x12523
callq 0x3230
movq -0x88(%rbp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, -0x88(%rbp)
movq -0x8(%rax), %rax
movq %rax, -0x98(%rbp)
leaq 0x1f8(%rax), %rcx
movq %rcx, -0x90(%rbp)
addq $0x1e0, %rax            # imm = 0x1E0
movq %rax, -0xa0(%rbp)
jmp 0x12523
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
subq %rsi, %rdx
leaq -0x300(%rbp), %rdi
callq 0x3310
leaq -0xd0(%rbp), %rdi
callq 0x13bba
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x13155
callq 0x3230
movq 0x9e5c(%rip), %rax      # 0x1cfb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2f8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x300(%rbp,%rcx)
callq 0x31f0
leaq -0x208(%rbp), %rdi
callq 0x30c0
addq $0x2d8, %rsp            # imm = 0x2D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3120
movq %rax, %r14
leaq 0x4c07(%rip), %rsi      # 0x17db8
movq %rax, %rdi
callq 0x30f0
movq 0x9e28(%rip), %rsi      # 0x1cfe8
movq 0x9df9(%rip), %rdx      # 0x1cfc0
movq %r14, %rdi
callq 0x3400
jmp 0x131ed
jmp 0x131ed
movq %rax, %rbx
jmp 0x1323e
movq %rax, %rbx
movq %r14, %rdi
callq 0x31b0
jmp 0x1323e
jmp 0x13221
jmp 0x13221
jmp 0x131ed
jmp 0x131ed
movq %rax, %rbx
jmp 0x13230
jmp 0x13221
jmp 0x131fc
jmp 0x131fc
jmp 0x131fc
jmp 0x131fc
movq %rax, %rbx
movq %r14, %rdi
callq 0x3230
jmp 0x13224
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
jmp 0x13221
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x13bba
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x1323e
callq 0x3230
leaq -0x300(%rbp), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3430