// File: /workspace/github_cpp_makefile_star2_O1/ipatix[P]wav2agb/wav_file.cpp
// Function: wav_file::wav_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
wav_file::wav_file(const std::string& path) : loadBuffer(loadChunkSize)
{
    ifs.exceptions(std::ios::badbit | std::ios::eofbit);
    ifs.open(path, std::ios::binary);
    if (!ifs.good())
        throw std::runtime_error("failed to open file: " + path + ", reason: " + strerror(errno));
    if (!ifs.is_open())
        throw std::runtime_error("failed to open file: " + path + ", reason: " + strerror(errno));

    ifs.seekg(0, ifs.end);
    std::streampos len = ifs.tellg();
    ifs.seekg(0, ifs.beg);

    std::string chunkId = read_str(ifs, 4);
    if (chunkId != "RIFF")
        throw std::runtime_error("RIFF ID invalid");
    uint32_t mainChunkLen = read_u32(ifs);
    if (mainChunkLen + 8 != len)
        throw std::runtime_error("RIFF chunk len (=" +
                std::to_string(mainChunkLen) +
                ") doesn't match file len (=" +
                std::to_string(len) +
                ")");
    std::string riffType = read_str(ifs, 4);
    if (riffType != "WAVE")
        throw std::runtime_error("WAVE ID invalid");

    bool dataChunkFound = false;
    bool fmtChunkFound = false;
    // search all chunks
    std::streampos curPos;
    while ((curPos = ifs.tellg()) + std::streampos(8) <= len) {
        chunkId = read_str(ifs, 4);
        uint32_t chunkLen = read_u32(ifs);
        if (curPos + std::streampos(8) + std::streampos(chunkLen) > len)
            throw std::runtime_error("ERROR: chunk goes beyond end of file: offset=" + std::to_string(curPos));

        if (chunkId == "fmt ") {
            fmtChunkFound = true;
            std::vector<uint8_t> fmtChunk = read_arr(ifs, chunkLen);
            uint16_t fmtTag = arr_u16(fmtChunk, 0);
            uint16_t numChannels = arr_u16(fmtChunk, 2);
            if (numChannels != 1)
                throw std::runtime_error("ERROR: input file is NOT mono");
            this->sampleRate = arr_u32(fmtChunk, 4);
            uint16_t block_align = arr_u16(fmtChunk, 12);
            uint16_t bits_per_sample = arr_u16(fmtChunk, 14);
            if (fmtTag == 1) {
                // integer
                if (block_align == 1 && bits_per_sample == 8)
                    this->fmt = format_type::u8;
                else if (block_align == 2 && bits_per_sample == 16)
                    this->fmt = format_type::s16;
                else if (block_align == 3 && bits_per_sample == 24)
                    this->fmt = format_type::s24;
                else if (block_align == 4 && bits_per_sample == 32)
                    this->fmt = format_type::s32;
                else
                    throw std::runtime_error("ERROR: unsupported integer format combination");
            } else if (fmtTag == 3) {
                // float
                if (block_align == 4 && bits_per_sample == 32)
                    this->fmt = format_type::f32;
                else if (block_align == 8 && bits_per_sample == 64)
                    this->fmt = format_type::f64;
                else
                    throw std::runtime_error("ERROR: unsupported float format combination");
            } else {
                throw std::runtime_error("ERROR: unsupported format code: " + std::to_string(fmtTag));
            }
        } else if (chunkId == "data") {
            dataChunkFound = true;
            dataChunkPos = ifs.tellg();
            dataChunkEndPos = dataChunkPos + std::streampos(chunkLen);
            ifs.seekg(chunkLen, ifs.cur);
        } else if (chunkId == "smpl") {
            std::vector<uint8_t> smplChunk = read_arr(ifs, chunkLen);
            uint32_t midiUnityNote = arr_u32(smplChunk, 12);
            this->midiKey = static_cast<uint8_t>(std::min(midiUnityNote, 127u));
            uint32_t midiPitchFraction = arr_u32(smplChunk, 16);
            // the values below convert the uint32_t range to 0.0 to 100.0 range
            this->tuning = static_cast<double>(midiPitchFraction) / (4294967296.0 * 100.0);
            uint32_t numLoops = arr_u32(smplChunk, 28);
            if (numLoops > 1)
                throw std::runtime_error("ERROR: too many loops in smpl chunk");
            if (numLoops == 1) {
                uint32_t loopType = arr_u32(smplChunk, 36 + 4);
                if (loopType != 0)
                    throw std::runtime_error("ERROR: loop type not supported: " + std::to_string(loopType));
                this->loopStart = arr_u32(smplChunk, 36 + 8);
                // sampler chunks tell the last sample to be played (so including rather than excluding), thus +1
                this->loopEnd = arr_u32(smplChunk, 36 + 12) + 1;
                this->loopEnabled = true;
            }
        } else {
            //fprintf(stderr, "WARNING: ignoring unknown chunk type: <%s>\n", chunkId.c_str());
            ifs.seekg(chunkLen, ifs.cur);
        }

        /* https://en.wikipedia.org/wiki/Resource_Interchange_File_Format#Explanation
         * If chunk size is odd, skip the pad byte */
        if ((chunkLen % 2) == 1)
            ifs.seekg(1, ifs.cur);
    }

    if (!fmtChunkFound)
        throw std::runtime_error("ERROR: fmt chunk not found");
    if (!dataChunkFound)
        throw std::runtime_error("ERROR: data chunk not found");

    uint32_t numSamples = static_cast<uint32_t>(dataChunkEndPos - dataChunkPos) / fmt_size();
    this->loopEnd = std::min(this->loopEnd, numSamples);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2250
xorpd %xmm0, %xmm0
movupd %xmm0, 0x218(%rbx)
movupd %xmm0, 0x208(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x228(%rbx)
movupd %xmm0, 0x230(%rbx)
movq $0x0, 0x240(%rbx)
movl $0x4000, %edi           # imm = 0x4000
callq 0x2210
movq %rax, 0x230(%rbx)
movq %rax, 0x238(%rbx)
movq %rax, %r15
addq $0x4000, %r15           # imm = 0x4000
movq %r15, 0x240(%rbx)
movl $0x4000, %edx           # imm = 0x4000
movq %rax, %rdi
xorl %esi, %esi
callq 0x2140
movq %r15, 0x238(%rbx)
movq $-0x1, 0x248(%rbx)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x254(%rbx)
movb $0x0, 0x25c(%rbx)
movq $0x0, 0x260(%rbx)
movb $0x3c, 0x268(%rbx)
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl $0x3, 0x1c(%rbx,%rax)
movl 0x20(%rbx,%rax), %esi
callq 0x2390
movq %rbx, %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x21e0
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
jne 0x46a2
leaq 0x78(%rbx), %rdi
callq 0x2060
testb %al, %al
je 0x4700
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x22d0
movq %rbx, %rdi
callq 0x23b0
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22d0
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x4e33
leaq 0x26e9(%rip), %rsi      # 0x6725
leaq 0x48(%rsp), %rdi
callq 0x2090
testl %eax, %eax
jne 0x475e
leaq 0x28(%rsp), %rsi
movl $0x4, %edx
movq %rbx, %rdi
callq 0x22b0
movl 0x28(%rsp), %r12d
leal 0x8(%r12), %eax
cmpq %rax, %r14
jne 0x4795
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x4e33
leaq 0x26e1(%rip), %rsi      # 0x6768
leaq 0x28(%rsp), %rdi
callq 0x2090
testl %eax, %eax
jne 0x480e
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xa8(%rsp)
movq %rbx, %rdi
callq 0x23b0
movq %rax, %r13
leaq 0x8(%rax), %rbp
cmpq %r14, %rbp
jg 0x4465
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4e33
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x2290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4102
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x22b0
movzbl 0x8(%rsp), %r12d
movzbl 0x9(%rsp), %eax
shll $0x8, %eax
movzbl 0xa(%rsp), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movzbl 0xb(%rsp), %r15d
shll $0x18, %r15d
orl %ecx, %r15d
orl %r12d, %r15d
addq %r15, %rbp
cmpq %r14, %rbp
jg 0x44fc
leaq 0x48(%rsp), %r13
movq %r13, %rdi
leaq 0x2654(%rip), %rsi      # 0x67ab
callq 0x2090
testl %eax, %eax
je 0x41a3
movq %r13, %rdi
leaq 0x26df(%rip), %rsi      # 0x6849
callq 0x2090
testl %eax, %eax
je 0x424d
movq %r13, %rdi
leaq 0x26cd(%rip), %rsi      # 0x684e
callq 0x2090
testl %eax, %eax
je 0x42b6
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x22d0
jmp 0x4444
leaq 0x88(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4eaa
movq %rbp, %rdi
xorl %esi, %esi
callq 0x4f00
movl %eax, %r13d
movl $0x2, %esi
movq %rbp, %rdi
callq 0x4f00
cmpw $0x1, %ax
jne 0x4559
movl $0x4, %esi
leaq 0x88(%rsp), %rbp
movq %rbp, %rdi
callq 0x4f39
movl %eax, 0x26c(%rbx)
movl $0xc, %esi
movq %rbp, %rdi
callq 0x4f00
movl %eax, %r15d
movl $0xe, %esi
movq %rbp, %rdi
callq 0x4f00
cmpw $0x3, %r13w
je 0x4293
movzwl %r13w, %r13d
cmpl $0x1, %r13d
jne 0x4590
movl %r15d, %ecx
xorl $0x1, %ecx
movl %eax, %edx
xorl $0x8, %edx
orw %cx, %dx
jne 0x43c6
movl $0x0, 0x250(%rbx)
jmp 0x441d
movq %rbx, %rdi
callq 0x23b0
movq %rax, 0x208(%rbx)
movq %rdx, 0x210(%rbx)
addq %r15, %rax
movq %rax, 0x218(%rbx)
movq %rdx, 0x220(%rbx)
movb $0x1, %al
movq %rax, 0xa8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x22d0
jmp 0x4444
movl %r15d, %ecx
xorl $0x4, %ecx
movl %eax, %edx
xorl $0x20, %edx
orw %cx, %dx
jne 0x43a5
movl $0x4, 0x250(%rbx)
jmp 0x441d
leaq 0x88(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4eaa
movl $0xc, %esi
movq %r13, %rdi
callq 0x4f39
cmpl $0x7f, %eax
movl $0x7f, %ecx
cmovael %ecx, %eax
movb %al, 0x268(%rbx)
movl $0x10, %esi
movq %r13, %rdi
callq 0x4f39
movl %eax, %eax
cvtsi2sd %rax, %xmm0
divsd 0x2382(%rip), %xmm0     # 0x6688
movsd %xmm0, 0x260(%rbx)
movl $0x1c, %esi
movq %r13, %rdi
callq 0x4f39
cmpl $0x2, %eax
jae 0x45ed
cmpl $0x1, %eax
jne 0x437f
movl $0x28, %esi
leaq 0x88(%rsp), %rdi
callq 0x4f39
movl %eax, %r13d
testl %eax, %eax
jne 0x4645
movl $0x2c, %esi
leaq 0x88(%rsp), %rdi
callq 0x4f39
movl %eax, 0x254(%rbx)
movl $0x30, %esi
leaq 0x88(%rsp), %rdi
callq 0x4f39
incl %eax
movl %eax, 0x258(%rbx)
movb $0x1, 0x25c(%rbx)
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x4444
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x2220
jmp 0x4444
cmpw $0x8, %r15w
jne 0x4624
cmpw $0x40, %ax
jne 0x4624
movl $0x5, 0x250(%rbx)
jmp 0x441d
movl %r15d, %ecx
xorl $0x2, %ecx
movl %eax, %edx
xorl $0x10, %edx
orw %cx, %dx
jne 0x43e2
movl $0x1, 0x250(%rbx)
jmp 0x441d
movl %r15d, %ecx
xorl $0x3, %ecx
movl %eax, %edx
xorl $0x18, %edx
orw %cx, %dx
jne 0x43fe
movl $0x2, 0x250(%rbx)
jmp 0x441d
cmpw $0x4, %r15w
jne 0x4895
cmpw $0x20, %ax
jne 0x4895
movl $0x3, 0x250(%rbx)
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x443a
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x2220
movb $0x1, %al
movq %rax, 0xb0(%rsp)
testb $0x1, %r12b
je 0x40b1
movl $0x1, %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x22d0
jmp 0x40b1
testb $0x1, 0xb0(%rsp)
je 0x4845
testb $0x1, 0xa8(%rsp)
je 0x4863
movq 0x208(%rbx), %r15
movq 0x218(%rbx), %r14
movq %rbx, %rdi
callq 0x3e88
movl %eax, %ecx
subl %r15d, %r14d
movl %r14d, %eax
xorl %edx, %edx
divl %ecx
movl 0x258(%rbx), %ecx
cmpl %ecx, %eax
cmovbl %eax, %ecx
movl %ecx, 0x258(%rbx)
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x44cf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2220
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x44ea
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2220
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
callq 0x5914
leaq 0x2260(%rip), %rsi      # 0x677d
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x5824
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0x4ab3(%rip), %rsi      # 0x8ff8
movq 0x4a84(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x2243(%rip), %rsi      # 0x67b0
movq %rax, %rdi
callq 0x20f0
movq 0x4a7c(%rip), %rsi      # 0x8ff8
movq 0x4a4d(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x68(%rsp), %rdi
movl %r13d, %esi
callq 0x59c8
leaq 0x2277(%rip), %rsi      # 0x6828
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x5824
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0x4a1f(%rip), %rsi      # 0x8ff8
movq 0x49f0(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x2252(%rip), %rsi      # 0x6853
movq %rax, %rdi
callq 0x20f0
movq 0x49e8(%rip), %rsi      # 0x8ff8
movq 0x49b9(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x21c4(%rip), %rsi      # 0x67fc
movq %rax, %rdi
callq 0x20f0
jmp 0x48b1
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x68(%rsp), %rdi
movl %r13d, %esi
callq 0x5894
leaq 0x2211(%rip), %rsi      # 0x6877
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x5824
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0x496a(%rip), %rsi      # 0x8ff8
movq 0x493b(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x204e(%rip), %rsi      # 0x6704
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x56f4
leaq 0x2050(%rip), %rsi      # 0x671a
leaq 0x8(%rsp), %rdi
callq 0x23e0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x48c7
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
jmp 0x48d4
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x1ff0(%rip), %rsi      # 0x6704
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x56f4
leaq 0x1ff2(%rip), %rsi      # 0x671a
leaq 0x8(%rsp), %rdi
callq 0x23e0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x492b
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
jmp 0x4938
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x1fb8(%rip), %rsi      # 0x672a
movq %rax, %rdi
callq 0x20f0
movq 0x4877(%rip), %rsi      # 0x8ff8
movq 0x4848(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0xd8(%rsp), %rdi
movl %r12d, %esi
callq 0x5894
leaq 0x1f81(%rip), %rsi      # 0x673a
leaq 0x88(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
callq 0x5824
leaq 0x1f77(%rip), %rsi      # 0x674c
leaq 0x88(%rsp), %rdi
callq 0x23e0
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4a31
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
jmp 0x4a3e
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x1f4b(%rip), %rsi      # 0x676d
movq %rax, %rdi
callq 0x20f0
movq 0x47c7(%rip), %rsi      # 0x8ff8
movq 0x4798(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x203f(%rip), %rsi      # 0x6898
movq %rax, %rdi
callq 0x20f0
jmp 0x487f
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x203c(%rip), %rsi      # 0x68b3
movq %rax, %rdi
callq 0x20f0
movq 0x4772(%rip), %rsi      # 0x8ff8
movq 0x4743(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
movl $0x10, %edi
callq 0x2120
movq %rax, %r15
leaq 0x1f25(%rip), %rsi      # 0x67ce
movq %rax, %rdi
callq 0x20f0
movq 0x4740(%rip), %rsi      # 0x8ff8
movq 0x4711(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x2030
movl (%rax), %edi
callq 0x20d0
movq %r14, %rdi
movq %rax, %rsi
callq 0x23e0
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x498f
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x499c
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x2030
movl (%rax), %edi
callq 0x20d0
movq %r14, %rdi
movq %rax, %rsi
callq 0x23e0
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x49e0
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x49ed
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r15, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0x462c(%rip), %rsi      # 0x8ff8
movq 0x45fd(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r15, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0x45db(%rip), %rsi      # 0x8ff8
movq 0x45ac(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
jmp 0x4afe
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x70(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb8(%rsp), %rdi
movq %r14, %rsi
callq 0x5914
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x577c
leaq 0x1bbb(%rip), %rsi      # 0x663f
leaq 0x8(%rsp), %rdi
callq 0x23e0
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x4ab2
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
jmp 0x4abf
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r15, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0x4509(%rip), %rsi      # 0x8ff8
movq 0x44da(%rip), %rdx      # 0x8fd0
movq %r15, %rdi
callq 0x23a0
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4b20
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4b20
movq %rax, %r14
movb $0x1, %bpl
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4b43
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4b43
movq %rax, %r14
movb $0x1, %bpl
leaq 0xc8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4b6c
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4b6c
movq %rax, %r14
movb $0x1, %bpl
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x4b8b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4b8b
movq %rax, %r14
movb $0x1, %bpl
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4bf3
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4bf3
jmp 0x4bb2
jmp 0x4bce
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4bd4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4bd4
movq %rax, %r14
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4c1e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4c1e
movq %rax, %r14
movb $0x1, %bpl
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c57
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4c57
jmp 0x4c18
movq %rax, %r14
movb $0x1, %bpl
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c7b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4c7b
jmp 0x4d31
jmp 0x4c49
jmp 0x4c49
jmp 0x4dcc
movq %rax, %r14
jmp 0x4d9c
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
jne 0x4c66
jmp 0x4dea
jmp 0x4ca1
movq %rax, %r14
movq %r15, %rdi
callq 0x2190
jmp 0x4dea
jmp 0x4c75
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x4e05
movq %r15, %rdi
callq 0x2190
jmp 0x4e05
jmp 0x4cb7
jmp 0x4cd8
jmp 0x4dcc
jmp 0x4dcc
jmp 0x4ca1
movq %rax, %r14
jmp 0x4dea
jmp 0x4d19
movq %rax, %r14
jmp 0x4e23
jmp 0x4d09
jmp 0x4d31
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4cde
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4cde
movq %rax, %r14
movb $0x1, %bpl
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d0f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4d0f
jmp 0x4da6
jmp 0x4d19
jmp 0x4da6
jmp 0x4d31
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
jne 0x4d34
jmp 0x4da9
movq %rax, %r14
jmp 0x4e05
jmp 0x4da6
jmp 0x4da6
jmp 0x4da6
jmp 0x4dcc
jmp 0x4da6
movq %rax, %r14
movq %r15, %rdi
callq 0x2190
jmp 0x4da9
jmp 0x4da6
jmp 0x4dcc
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4d6c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4d6c
movq %rax, %r14
movb $0x1, %bpl
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d97
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2220
jmp 0x4d97
jmp 0x4da6
jmp 0x4da6
jmp 0x4da6
jmp 0x4dcc
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x4dcf
movq %r15, %rdi
callq 0x2190
jmp 0x4dcf
movq %rax, %r14
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x4dcf
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x2220
jmp 0x4dcf
jmp 0x4dcc
jmp 0x4dcc
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4dea
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2220
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e05
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2220
leaq 0x230(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4e23
movq 0x240(%rbx), %rsi
subq %rdi, %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x2070
movq %r14, %rdi
callq 0x23c0