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

        // Get file size.
        file.seekg(0, std::ios::end);
        std::streampos streamPos = file.tellg();
        if (streamPos > static_cast<std::streampos>(std::numeric_limits<uint32_t>::max()))
        {
            throw std::runtime_error("Input file size is too big.");
        }
        const std::size_t fileSize = static_cast<std::size_t>(streamPos);
        file.seekg(0, std::ios::beg);

        // Read header.
        std::string magic(20, '\0');
        file.read(&magic[0], 20);
        file.seekg(23);
        uint32_t version;
        file.read(reinterpret_cast<char*>(&version), 4);

        // call on header function.
        onHeaderRead(magic, version);

        if (file.eof())
        {
            throw std::runtime_error("Invalid FBX file.");
        }

        // Read record.
        std::stack<std::pair<Record *, size_t>> recordStack;
        recordStack.push(std::make_pair(this, fileSize));

        while (recordStack.size())
        {
            uint32_t endOffset = 0;
            uint32_t numProperties = 0;
            uint32_t propertyListLen = 0;
            uint8_t nameLen = 0;
            const size_t recordPos = static_cast<size_t>(file.tellg());

            file.read(reinterpret_cast<char*>(&endOffset), 4);
            file.read(reinterpret_cast<char*>(&numProperties), 4);
            file.read(reinterpret_cast<char*>(&propertyListLen), 4);
            file.read(reinterpret_cast<char*>(&nameLen), 1);

            std::string name(nameLen, '\0');
            file.read(&name[0], nameLen);

            if (file.eof())
            {
                throw std::runtime_error("Invalid record header.");
            }

            if (endOffset == 0) // End of nested list.
            {
                recordStack.pop();
                continue;
            }

            const auto & stackTop = recordStack.top();
            Record * pParentRecord = stackTop.first;
            size_t parentEndOffset = stackTop.second;

            // Validate endoffset.
            if (endOffset > fileSize)
            {
                throw std::runtime_error("Record end offset exceeding file size.");
            }
            if (endOffset >= parentEndOffset)
            {
                throw std::runtime_error("Record end offset exceeding parent record.");
            }

            // Validate property list length.
            if (recordPos + propertyListLen > endOffset)
            {
                throw std::runtime_error("Invalid record property list length.");
            }

            // Create and add new record.
            Record * pNewRecord = new Record(name, pParentRecord);
            recordStack.push(std::make_pair(pNewRecord, endOffset));

            // Read properties.
            size_t propertiesByteRead = 0;
            PropertyReader reader(file, pNewRecord);

            for (uint32_t i = 0; i < numProperties; ++i)
            {
                uint8_t code;
                file.read(reinterpret_cast<char*>(&code), 1);

                if (code == 'S' || code == 'R') // String/raw.
                {
                    propertiesByteRead += reader.readRaw(code) + 1;
                }
                else if (code < 'Z') // primitives.
                {
                    propertiesByteRead += reader.readPrimitive(code) + 1;
                }
                else // arrays.
                {
                    propertiesByteRead += reader.readArray(code) + 1;
                }
            }

            // Make sure all property bytes are extracted.
            if (propertiesByteRead != propertyListLen)
            {
                throw std::runtime_error("Invalid property list length of record: " + pParentRecord->name());
            }

            // Error check end record of nested list.
            const size_t curFilePos = static_cast<size_t>(file.tellg());
            if (parentEndOffset <= curFilePos)
            {
                throw std::runtime_error("Missing nested list end of record: " + pParentRecord->name());
            }

            // Exit record if no nested list is present.
            if (endOffset == curFilePos)
            {
                recordStack.pop();
                continue;
            }

            // Read nested list next loop.
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5a0, %rsp            # imm = 0x5A0
movq %rdx, -0x460(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x458(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x220(%rbp), %rdi
movq %rdi, -0x450(%rbp)
movl $0x4, %edx
callq 0x34c0
movq -0x450(%rbp), %rdi
callq 0x34b0
movb %al, -0x442(%rbp)
jmp 0x21e59
movb -0x442(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x21ee7
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x468(%rbp)
leaq 0x14fac(%rip), %rsi     # 0x36e33
callq 0x3100
jmp 0x21e8e
movq -0x468(%rbp), %rdi
movq 0x23154(%rip), %rsi     # 0x44ff0
movq 0x23125(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x22bbc
movq -0x468(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x3230
jmp 0x22bbc
xorl %eax, %eax
movl %eax, %esi
leaq -0x220(%rbp), %rdi
movl $0x2, %edx
callq 0x3410
jmp 0x21efe
leaq -0x220(%rbp), %rdi
callq 0x3550
movq %rdx, -0x478(%rbp)
movq %rax, -0x470(%rbp)
jmp 0x21f1a
movq -0x478(%rbp), %rax
movq -0x470(%rbp), %rcx
movq %rcx, -0x240(%rbp)
movq %rax, -0x238(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x288d0
movq %rax, -0x480(%rbp)
jmp 0x21f4b
callq 0x288f0
movl %eax, %eax
movl %eax, %esi
leaq -0x250(%rbp), %rdi
callq 0x28900
jmp 0x21f62
leaq -0x250(%rbp), %rdi
callq 0x288d0
movq %rax, -0x488(%rbp)
jmp 0x21f77
movq -0x480(%rbp), %rax
movq -0x488(%rbp), %rcx
cmpq %rcx, %rax
jle 0x21ff1
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x490(%rbp)
leaq 0x14ea0(%rip), %rsi     # 0x36e48
callq 0x3100
jmp 0x21faf
movq -0x490(%rbp), %rdi
movq 0x23033(%rip), %rsi     # 0x44ff0
movq 0x23004(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq -0x490(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x3230
jmp 0x22bbc
leaq -0x240(%rbp), %rdi
callq 0x288d0
movq %rax, -0x498(%rbp)
jmp 0x22006
movq -0x498(%rbp), %rax
movq %rax, -0x258(%rbp)
xorl %edx, %edx
movl %edx, %esi
leaq -0x220(%rbp), %rdi
callq 0x3410
jmp 0x22026
leaq -0x279(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x3570
movq -0x4a0(%rbp), %rcx
leaq -0x278(%rbp), %rdi
movl $0x14, %esi
xorl %edx, %edx
callq 0x31e0
jmp 0x22055
leaq -0x279(%rbp), %rdi
callq 0x3340
xorl %eax, %eax
movl %eax, %esi
leaq -0x278(%rbp), %rdi
callq 0x35f0
movq %rax, -0x4a8(%rbp)
jmp 0x2207a
movq -0x4a8(%rbp), %rsi
leaq -0x220(%rbp), %rdi
movl $0x14, %edx
callq 0x33b0
jmp 0x22094
leaq -0x290(%rbp), %rdi
movl $0x17, %esi
callq 0x28900
jmp 0x220a7
movq -0x290(%rbp), %rsi
movq -0x288(%rbp), %rdx
leaq -0x220(%rbp), %rdi
callq 0x33c0
jmp 0x220c3
leaq -0x220(%rbp), %rdi
leaq -0x294(%rbp), %rsi
movl $0x4, %edx
callq 0x33b0
jmp 0x220dd
leaq -0x2b8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x3130
jmp 0x220f2
movq -0x460(%rbp), %rdi
movl -0x294(%rbp), %edx
leaq -0x2b8(%rbp), %rsi
callq 0x28940
jmp 0x2210d
leaq -0x2b8(%rbp), %rdi
callq 0x31c0
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x35a0
movb %al, -0x4a9(%rbp)
jmp 0x22139
movb -0x4a9(%rbp), %al
testb $0x1, %al
jne 0x22148
jmp 0x2220c
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x4b8(%rbp)
leaq 0x14cfe(%rip), %rsi     # 0x36e64
callq 0x3100
jmp 0x2216d
movq -0x4b8(%rbp), %rdi
movq 0x22e75(%rip), %rsi     # 0x44ff0
movq 0x22e46(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x279(%rbp), %rdi
callq 0x3340
jmp 0x22bbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x22bb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x31c0
jmp 0x22bb0
movq -0x4b8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x3230
jmp 0x22bb0
leaq -0x308(%rbp), %rdi
callq 0x28990
jmp 0x2221a
movq -0x458(%rbp), %rax
movq %rax, -0x320(%rbp)
leaq -0x320(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x289f0
movq %rdx, -0x4c8(%rbp)
movq %rax, -0x4c0(%rbp)
jmp 0x2224b
movq -0x4c8(%rbp), %rax
movq -0x4c0(%rbp), %rcx
movq %rcx, -0x318(%rbp)
movq %rax, -0x310(%rbp)
leaq -0x308(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x289c0
jmp 0x2227c
jmp 0x2227e
leaq -0x308(%rbp), %rdi
callq 0x28a20
movq %rax, -0x4d0(%rbp)
jmp 0x22293
movq -0x4d0(%rbp), %rax
cmpq $0x0, %rax
je 0x22b77
movl $0x0, -0x324(%rbp)
movl $0x0, -0x328(%rbp)
movl $0x0, -0x32c(%rbp)
movb $0x0, -0x32d(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x3550
movq %rdx, -0x4e0(%rbp)
movq %rax, -0x4d8(%rbp)
jmp 0x222e5
movq -0x4e0(%rbp), %rax
movq -0x4d8(%rbp), %rcx
movq %rcx, -0x348(%rbp)
movq %rax, -0x340(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x288d0
movq %rax, -0x4e8(%rbp)
jmp 0x22316
movq -0x4e8(%rbp), %rax
movq %rax, -0x338(%rbp)
leaq -0x220(%rbp), %rdi
leaq -0x324(%rbp), %rsi
movl $0x4, %edx
callq 0x33b0
jmp 0x2233e
leaq -0x220(%rbp), %rdi
leaq -0x328(%rbp), %rsi
movl $0x4, %edx
callq 0x33b0
jmp 0x22358
leaq -0x220(%rbp), %rdi
leaq -0x32c(%rbp), %rsi
movl $0x4, %edx
callq 0x33b0
jmp 0x22372
leaq -0x220(%rbp), %rdi
leaq -0x32d(%rbp), %rsi
movl $0x1, %edx
callq 0x33b0
jmp 0x2238c
movzbl -0x32d(%rbp), %eax
movq %rax, -0x4f8(%rbp)
leaq -0x369(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x3570
movq -0x4f8(%rbp), %rsi
movq -0x4f0(%rbp), %rcx
leaq -0x368(%rbp), %rdi
xorl %edx, %edx
callq 0x31e0
jmp 0x223cb
leaq -0x369(%rbp), %rdi
callq 0x3340
xorl %eax, %eax
movl %eax, %esi
leaq -0x368(%rbp), %rdi
callq 0x35f0
movq %rax, -0x500(%rbp)
jmp 0x223f0
movq -0x500(%rbp), %rsi
movzbl -0x32d(%rbp), %eax
movl %eax, %edx
leaq -0x220(%rbp), %rdi
callq 0x33b0
jmp 0x2240e
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x35a0
movb %al, -0x501(%rbp)
jmp 0x2242e
movb -0x501(%rbp), %al
testb $0x1, %al
jne 0x2243d
jmp 0x224f5
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x510(%rbp)
leaq 0x14a1b(%rip), %rsi     # 0x36e76
callq 0x3100
jmp 0x22462
movq -0x510(%rbp), %rdi
movq 0x22b80(%rip), %rsi     # 0x44ff0
movq 0x22b51(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x22ba4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x369(%rbp), %rdi
callq 0x3340
jmp 0x22ba4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x22b69
movq -0x510(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x3230
jmp 0x22b69
cmpl $0x0, -0x324(%rbp)
jne 0x2251b
leaq -0x308(%rbp), %rdi
callq 0x28a40
jmp 0x2250c
movl $0x2, -0x370(%rbp)
jmp 0x22b47
leaq -0x308(%rbp), %rdi
callq 0x28a60
movq %rax, -0x518(%rbp)
jmp 0x22530
movq -0x518(%rbp), %rax
movq %rax, -0x378(%rbp)
movq -0x378(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x380(%rbp)
movq -0x378(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x388(%rbp)
movl -0x324(%rbp), %eax
cmpq -0x258(%rbp), %rax
jbe 0x225d7
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x520(%rbp)
leaq 0x148ff(%rip), %rsi     # 0x36e8d
callq 0x3100
jmp 0x22595
movq -0x520(%rbp), %rdi
movq 0x22a4d(%rip), %rsi     # 0x44ff0
movq 0x22a1e(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq -0x520(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x3230
jmp 0x22b69
movl -0x324(%rbp), %eax
cmpq -0x388(%rbp), %rax
jb 0x2264d
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x528(%rbp)
leaq 0x148b0(%rip), %rsi     # 0x36eb4
callq 0x3100
jmp 0x2260b
movq -0x528(%rbp), %rdi
movq 0x229d7(%rip), %rsi     # 0x44ff0
movq 0x229a8(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq -0x528(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x3230
jmp 0x22b69
movq -0x338(%rbp), %rax
movl -0x32c(%rbp), %ecx
addq %rcx, %rax
movl -0x324(%rbp), %ecx
cmpq %rcx, %rax
jbe 0x226cf
movl $0x10, %edi
callq 0x3160
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x530(%rbp)
leaq 0x14859(%rip), %rsi     # 0x36edf
callq 0x3100
jmp 0x2268d
movq -0x530(%rbp), %rdi
movq 0x22955(%rip), %rsi     # 0x44ff0
movq 0x22926(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq -0x530(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x3230
jmp 0x22b69
movl $0x58, %edi
callq 0x3310
movq %rax, -0x538(%rbp)
jmp 0x226e2
movq -0x538(%rbp), %rdi
movq -0x380(%rbp), %rdx
leaq -0x368(%rbp), %rsi
callq 0x21c80
jmp 0x226fe
movq -0x538(%rbp), %rax
movq %rax, -0x390(%rbp)
leaq -0x390(%rbp), %rdi
leaq -0x324(%rbp), %rsi
callq 0x28a80
movl %edx, -0x544(%rbp)
movq %rax, -0x540(%rbp)
jmp 0x2272e
movl -0x544(%rbp), %eax
movq -0x540(%rbp), %rcx
movq %rcx, -0x3c0(%rbp)
movl %eax, -0x3b8(%rbp)
movl -0x3b8(%rbp), %eax
movl %eax, -0x3a8(%rbp)
movq -0x3c0(%rbp), %rax
movq %rax, -0x3b0(%rbp)
leaq -0x3a0(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x28ab0
jmp 0x22777
leaq -0x308(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x289c0
jmp 0x2278c
movq $0x0, -0x3c8(%rbp)
movq -0x390(%rbp), %rdx
leaq -0x3d8(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x22c70
jmp 0x227b3
movl $0x0, -0x3dc(%rbp)
movl -0x3dc(%rbp), %eax
cmpl -0x328(%rbp), %eax
jae 0x228ee
leaq -0x220(%rbp), %rdi
leaq -0x3dd(%rbp), %rsi
movl $0x1, %edx
callq 0x33b0
jmp 0x227e9
movzbl -0x3dd(%rbp), %eax
cmpl $0x53, %eax
je 0x22801
movzbl -0x3dd(%rbp), %eax
cmpl $0x52, %eax
jne 0x2285e
movzbl -0x3dd(%rbp), %esi
leaq -0x3d8(%rbp), %rdi
callq 0x22ca0
movq %rax, -0x550(%rbp)
jmp 0x2281d
movq -0x550(%rbp), %rax
addq $0x1, %rax
addq -0x3c8(%rbp), %rax
movq %rax, -0x3c8(%rbp)
jmp 0x228d8
movq -0x538(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
callq 0x32e0
jmp 0x22b69
movzbl -0x3dd(%rbp), %eax
cmpl $0x5a, %eax
jge 0x228a1
movzbl -0x3dd(%rbp), %esi
leaq -0x3d8(%rbp), %rdi
callq 0x230d0
movq %rax, -0x558(%rbp)
jmp 0x22886
movq -0x558(%rbp), %rax
addq $0x1, %rax
addq -0x3c8(%rbp), %rax
movq %rax, -0x3c8(%rbp)
jmp 0x228d6
movzbl -0x3dd(%rbp), %esi
leaq -0x3d8(%rbp), %rdi
callq 0x231e0
movq %rax, -0x560(%rbp)
jmp 0x228bd
movq -0x560(%rbp), %rax
addq $0x1, %rax
addq -0x3c8(%rbp), %rax
movq %rax, -0x3c8(%rbp)
jmp 0x228d8
jmp 0x228da
movl -0x3dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3dc(%rbp)
jmp 0x227bd
movq -0x3c8(%rbp), %rax
movl -0x32c(%rbp), %ecx
cmpq %rcx, %rax
je 0x229d6
movb $0x1, -0x401(%rbp)
movl $0x10, %edi
callq 0x3160
movq %rax, -0x570(%rbp)
movq -0x380(%rbp), %rdi
callq 0x23530
movq %rax, -0x568(%rbp)
jmp 0x22931
movq -0x568(%rbp), %rdx
leaq 0x145c5(%rip), %rsi     # 0x36f04
leaq -0x400(%rbp), %rdi
callq 0x28ae0
jmp 0x2294d
movq -0x570(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x34d0
jmp 0x22962
movq -0x570(%rbp), %rdi
movb $0x0, -0x401(%rbp)
movq 0x22679(%rip), %rsi     # 0x44ff0
movq 0x2264a(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x229ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x31c0
testb $0x1, -0x401(%rbp)
jne 0x229c5
jmp 0x229d1
movq -0x570(%rbp), %rdi
callq 0x3230
jmp 0x22b69
leaq -0x220(%rbp), %rdi
callq 0x3550
movq %rdx, -0x580(%rbp)
movq %rax, -0x578(%rbp)
jmp 0x229f2
movq -0x580(%rbp), %rax
movq -0x578(%rbp), %rcx
movq %rcx, -0x420(%rbp)
movq %rax, -0x418(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x288d0
movq %rax, -0x588(%rbp)
jmp 0x22a23
movq -0x588(%rbp), %rax
movq %rax, -0x410(%rbp)
movq -0x388(%rbp), %rax
cmpq -0x410(%rbp), %rax
ja 0x22b14
movb $0x1, -0x441(%rbp)
movl $0x10, %edi
callq 0x3160
movq %rax, -0x598(%rbp)
movq -0x380(%rbp), %rdi
callq 0x23530
movq %rax, -0x590(%rbp)
jmp 0x22a72
movq -0x590(%rbp), %rdx
leaq 0x144ad(%rip), %rsi     # 0x36f2d
leaq -0x440(%rbp), %rdi
callq 0x28ae0
jmp 0x22a8e
movq -0x598(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0x34d0
jmp 0x22aa3
movq -0x598(%rbp), %rdi
movb $0x0, -0x441(%rbp)
movq 0x22538(%rip), %rsi     # 0x44ff0
movq 0x22509(%rip), %rdx     # 0x44fc8
callq 0x3520
jmp 0x22bd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x22afb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x440(%rbp), %rdi
callq 0x31c0
testb $0x1, -0x441(%rbp)
jne 0x22b06
jmp 0x22b12
movq -0x598(%rbp), %rdi
callq 0x3230
jmp 0x22b69
movl -0x324(%rbp), %eax
cmpq -0x410(%rbp), %rax
jne 0x22b3d
leaq -0x308(%rbp), %rdi
callq 0x28a40
jmp 0x22b31
movl $0x2, -0x370(%rbp)
jmp 0x22b47
movl $0x0, -0x370(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x31c0
movl -0x370(%rbp), %eax
testl %eax, %eax
je 0x22b64
jmp 0x22b5f
jmp 0x2227e
jmp 0x2227e
leaq -0x368(%rbp), %rdi
callq 0x31c0
jmp 0x22ba4
leaq -0x308(%rbp), %rdi
callq 0x28bf0
leaq -0x278(%rbp), %rdi
callq 0x31c0
leaq -0x220(%rbp), %rdi
callq 0x3090
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbp
retq
leaq -0x308(%rbp), %rdi
callq 0x28bf0
leaq -0x278(%rbp), %rdi
callq 0x31c0
leaq -0x220(%rbp), %rdi
callq 0x3090
movq -0x228(%rbp), %rdi
callq 0x3560
nopw %cs:(%rax,%rax)