// File: /workspace/github_cpp_makefile_star2_O2/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_read_central_dir(mz_zip_archive*, unsigned int)
static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip, mz_uint flags)
{
    mz_uint cdir_size = 0, cdir_entries_on_this_disk = 0, num_this_disk = 0, cdir_disk_index = 0;
    mz_uint64 cdir_ofs = 0;
    mz_int64 cur_file_ofs = 0;
    const mz_uint8 *p;

    mz_uint32 buf_u32[4096 / sizeof(mz_uint32)];
    mz_uint8 *pBuf = (mz_uint8 *)buf_u32;
    mz_bool sort_central_dir = ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0);
    mz_uint32 zip64_end_of_central_dir_locator_u32[(MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
    mz_uint8 *pZip64_locator = (mz_uint8 *)zip64_end_of_central_dir_locator_u32;

    mz_uint32 zip64_end_of_central_dir_header_u32[(MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
    mz_uint8 *pZip64_end_of_central_dir = (mz_uint8 *)zip64_end_of_central_dir_header_u32;

    mz_uint64 zip64_end_of_central_dir_ofs = 0;

    /* Basic sanity checks - reject files which are too small, and check the first 4 bytes of the file to make sure a local header is there. */
    if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
        return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);

    if (!mz_zip_reader_locate_header_sig(pZip, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE, &cur_file_ofs))
        return mz_zip_set_error(pZip, MZ_ZIP_FAILED_FINDING_CENTRAL_DIR);

    /* Read and verify the end of central directory record. */
    if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
        return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);

    if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG)
        return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);

    if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
    {
        if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs - MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE, pZip64_locator, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE)
        {
            if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG)
            {
                zip64_end_of_central_dir_ofs = MZ_READ_LE64(pZip64_locator + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS);
                if (zip64_end_of_central_dir_ofs > (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
                    return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);

                if (pZip->m_pRead(pZip->m_pIO_opaque, zip64_end_of_central_dir_ofs, pZip64_end_of_central_dir, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)
                {
                    if (MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG)
                    {
                        pZip->m_pState->m_zip64 = MZ_TRUE;
                    }
                }
            }
        }
    }

    pZip->m_total_files = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS);
    cdir_entries_on_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS);
    num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS);
    cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS);
    cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS);
    cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS);

    if (pZip->m_pState->m_zip64)
    {
        mz_uint32 zip64_total_num_of_disks = MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS);
        mz_uint64 zip64_cdir_total_entries = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS);
        mz_uint64 zip64_cdir_total_entries_on_this_disk = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS);
        mz_uint64 zip64_size_of_end_of_central_dir_record = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS);
        mz_uint64 zip64_size_of_central_directory = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_SIZE_OFS);

        if (zip64_size_of_end_of_central_dir_record < (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12))
            return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

        if (zip64_total_num_of_disks != 1U)
            return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);

        /* Check for miniz's practical limits */
        if (zip64_cdir_total_entries > MZ_UINT32_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);

        pZip->m_total_files = (mz_uint32)zip64_cdir_total_entries;

        if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);

        cdir_entries_on_this_disk = (mz_uint32)zip64_cdir_total_entries_on_this_disk;

        /* Check for miniz's current practical limits (sorry, this should be enough for millions of files) */
        if (zip64_size_of_central_directory > MZ_UINT32_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);

        cdir_size = (mz_uint32)zip64_size_of_central_directory;

        num_this_disk = MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS);

        cdir_disk_index = MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS);

        cdir_ofs = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_OFS_OFS);
    }

    if (pZip->m_total_files != cdir_entries_on_this_disk)
        return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);

    if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1)))
        return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);

    if (cdir_size < pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

    if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

    pZip->m_central_directory_file_ofs = cdir_ofs;

    if (pZip->m_total_files)
    {
        mz_uint i, n;
        /* Read the entire central directory into a heap block, and allocate another heap block to hold the unsorted central dir file record offsets, and possibly another to hold the sorted indices. */
        if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, MZ_FALSE)) ||
            (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, pZip->m_total_files, MZ_FALSE)))
            return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);

        if (sort_central_dir)
        {
            if (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))
                return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
        }

        if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size)
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);

        /* Now create an index into the central directory file records, do some basic sanity checking on each record */
        p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p;
        for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i)
        {
            mz_uint total_header_size, disk_index, bit_flags, filename_size, ext_data_size;
            mz_uint64 comp_size, decomp_size, local_header_ofs;

            if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG))
                return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

            MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, i) = (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p);

            if (sort_central_dir)
                MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets, mz_uint32, i) = i;

            comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
            decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
            local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS);
            filename_size = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
            ext_data_size = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS);

            if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
                (ext_data_size) &&
                (MZ_MAX(MZ_MAX(comp_size, decomp_size), local_header_ofs) == MZ_UINT32_MAX))
            {
                /* Attempt to find zip64 extended information field in the entry's extra data */
                mz_uint32 extra_size_remaining = ext_data_size;

                if (extra_size_remaining)
                {
                    const mz_uint8 *pExtra_data = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size;

                    do
                    {
                        mz_uint32 field_id;
                        mz_uint32 field_data_size;

                        if (extra_size_remaining < (sizeof(mz_uint16) * 2))
                            return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

                        field_id = MZ_READ_LE16(pExtra_data);
                        field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16));

                        if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
                            return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

                        if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
                        {
                            /* Ok, the archive didn't have any zip64 headers but it uses a zip64 extended information field so mark it as zip64 anyway (this can occur with infozip's zip util when it reads compresses files from stdin). */
                            pZip->m_pState->m_zip64 = MZ_TRUE;
                            pZip->m_pState->m_zip64_has_extended_info_fields = MZ_TRUE;
                            break;
                        }

                        pExtra_data += sizeof(mz_uint16) * 2 + field_data_size;
                        extra_size_remaining = extra_size_remaining - sizeof(mz_uint16) * 2 - field_data_size;
                    } while (extra_size_remaining);
                }
            }

            /* I've seen archives that aren't marked as zip64 that uses zip64 ext data, argh */
            if ((comp_size != MZ_UINT32_MAX) && (decomp_size != MZ_UINT32_MAX))
            {
                if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size))
                    return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
            }

            disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS);
            if ((disk_index == MZ_UINT16_MAX) || ((disk_index != num_this_disk) && (disk_index != 1)))
                return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);

            if (comp_size != MZ_UINT32_MAX)
            {
                if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size)
                    return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
            }

            bit_flags = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
            if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED)
                return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);

            if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) > n)
                return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

            n -= total_header_size;
            p += total_header_size;
        }
    }

    if (sort_central_dir)
        mz_zip_reader_sort_central_dir_offsets_by_filename(pZip);

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1088, %rsp           # imm = 0x1088
movq %rdi, %r14
movq (%rdi), %rbx
pushq $0x8
popq %rdi
cmpq $0x16, %rbx
jb 0x7e9d
movl %esi, -0x30(%rbp)
leaq -0x1000(%rbx), %rax
xorl %r12d, %r12d
cmpq $0x1001, %rbx           # imm = 0x1001
cmovgeq %rax, %r12
movl $0x1000, %r13d          # imm = 0x1000
subq %r12, %rbx
cmpq %r13, %rbx
cmovaeq %r13, %rbx
movq 0x60(%r14), %rdi
movq %r12, %rsi
leaq -0x10b0(%rbp), %rdx
movq %rbx, %rcx
callq *0x48(%r14)
cmpq %rbx, %rax
jne 0x7db4
addl $-0x4, %ebx
testl %ebx, %ebx
js 0x7d97
movl %ebx, %r15d
cmpl $0x6054b50, -0x10b0(%rbp,%r15) # imm = 0x6054B50
jne 0x7d93
movq (%r14), %rax
addq %r12, %r15
subq %r15, %rax
cmpq $0x15, %rax
ja 0x7dbb
decl %ebx
jmp 0x7d6f
testq %r12, %r12
je 0x7db4
movq (%r14), %rbx
movq %rbx, %rax
subq %r12, %rax
addq $-0xffd, %r12           # imm = 0xF003
cmpq $0x10015, %rax          # imm = 0x10015
jb 0x7d48
pushq $0x7
jmp 0x7e9c
movq 0x60(%r14), %rdi
leaq -0x10b0(%rbp), %rdx
pushq $0x16
popq %rcx
movq %r15, %rsi
callq *0x48(%r14)
pushq $0x14
popq %r12
cmpq $0x16, %rax
jne 0x7e95
cmpl $0x6054b50, -0x10b0(%rbp) # imm = 0x6054B50
jne 0x7e9a
cmpq $0x4c, %r15
jl 0x7e64
movq 0x60(%r14), %rdi
addq $-0x14, %r15
leaq -0xb0(%rbp), %rdx
pushq $0x14
popq %rcx
movq %r15, %rsi
callq *0x48(%r14)
cmpq $0x14, %rax
jne 0x7e64
cmpl $0x7064b50, -0xb0(%rbp) # imm = 0x7064B50
jne 0x7e64
movq -0xa8(%rbp), %rsi
movq (%r14), %rax
addq $-0x38, %rax
cmpq %rax, %rsi
pushq $0x8
popq %rdi
ja 0x7e9d
movq 0x60(%r14), %rdi
leaq -0x90(%rbp), %rdx
pushq $0x38
popq %rcx
callq *0x48(%r14)
cmpq $0x38, %rax
jne 0x7e64
cmpl $0x6064b50, -0x90(%rbp) # imm = 0x6064B50
jne 0x7e64
movq 0x68(%r14), %rax
movl $0x1, 0x64(%rax)
movzwl -0x10a6(%rbp), %eax
movl %eax, 0x10(%r14)
movq 0x68(%r14), %r13
cmpl $0x0, 0x64(%r13)
pushq $0xa
popq %r9
pushq $0x9
popq %r8
je 0x7eb7
cmpq $0x2c, -0x8c(%rbp)
jae 0x8195
movl %r8d, %edi
jmp 0x7e9d
movl %r12d, %edi
jmp 0x7e9d
pushq $0x8
popq %rdi
movl %edi, 0x1c(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x1088, %rsp           # imm = 0x1088
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl -0x10a8(%rbp), %ecx
movzwl -0x10ac(%rbp), %esi
movzwl -0x10aa(%rbp), %edx
movl -0x10a4(%rbp), %r10d
movl -0x10a0(%rbp), %r15d
cmpl %ecx, %eax
jne 0x81d2
movl %esi, %ecx
orl %edx, %ecx
je 0x7ef8
movl %esi, %ecx
xorl $0x1, %ecx
xorl $0x1, %edx
orl %ecx, %edx
jne 0x81d2
imull $0x2e, %eax, %ecx
cmpl %ecx, %r10d
jb 0x7e90
movl %r10d, %ecx
leaq (%r15,%rcx), %rdx
cmpq (%r14), %rdx
ja 0x7e90
movl %esi, -0x50(%rbp)
movq %r15, 0x8(%r14)
pushq $0x1
popq %rbx
testl %eax, %eax
je 0x7ea3
movq %r13, %rsi
cmpq %rcx, 0x10(%r13)
movl %r10d, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
jae 0x7f4f
movq %r14, %rdi
movq %r13, %rsi
movq %rcx, %rdx
xorl %ecx, %ecx
callq 0xf595
testl %eax, %eax
je 0x81e9
movq 0x68(%r14), %rsi
movl 0x10(%r14), %eax
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%r13)
movl %eax, %r13d
movq %rsi, %rdx
cmpq %r13, 0x30(%rsi)
jae 0x7f88
movq %rsi, -0x38(%rbp)
addq $0x20, %rsi
movq %r14, %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xf595
testl %eax, %eax
je 0x81e9
movq 0x68(%r14), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rsi
btl $0xb, -0x30(%rbp)
movq %r13, 0x28(%rsi)
jb 0x7fd3
movl 0x10(%r14), %r13d
movq %rdx, %rax
cmpq %r13, 0x50(%rdx)
jae 0x7fcc
movq %rdx, -0x38(%rbp)
leaq 0x40(%rdx), %rsi
movq %r14, %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0xf595
pushq $0x10
popq %rdi
testl %eax, %eax
je 0x7e9d
movq 0x68(%r14), %rax
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq %r13, 0x48(%rdx)
movq %rax, %rdx
movq 0x60(%r14), %rdi
movq (%rdx), %rdx
movq %r15, %rsi
movq %rcx, %r15
callq *0x48(%r14)
movl %r12d, %edi
cmpq %r15, %rax
movl -0x48(%rbp), %edx
jne 0x7e9d
movq 0x68(%r14), %r15
movq (%r15), %rcx
xorl %esi, %esi
movq %rcx, %r8
movq %r15, -0x40(%rbp)
movl 0x10(%r14), %eax
cmpq %rax, %rsi
jae 0x81fe
cmpl $0x2e, %edx
jb 0x81f0
cmpl $0x2014b50, (%r8)       # imm = 0x2014B50
jne 0x81f0
movl %edx, %edi
movl %r8d, %eax
subl %ecx, %eax
btl $0xb, -0x30(%rbp)
movq 0x20(%r15), %rdx
movl %eax, (%rdx,%rsi,4)
jb 0x8042
movq 0x40(%r15), %rax
movl %esi, (%rax,%rsi,4)
movl 0x14(%r8), %r10d
movl 0x18(%r8), %r11d
movzwl 0x1c(%r8), %edx
movzwl 0x1e(%r8), %eax
movzwl %ax, %r9d
cmpl $0x0, 0x68(%r15)
jne 0x8083
testw %ax, %ax
je 0x8083
movl 0x2a(%r8), %eax
cmpl %r11d, %r10d
movl %r11d, %r15d
cmoval %r10d, %r15d
cmpl %eax, %r15d
cmovbel %eax, %r15d
cmpl $-0x1, %r15d
je 0x813c
cmpl $-0x1, %r10d
setne %al
cmpl $-0x1, %r11d
setne %r15b
andb %al, %r15b
cmpb $0x1, %r15b
jne 0x80d1
cmpl $0x0, 0xa(%r8)
setne %al
cmpl %r10d, %r11d
sete %r15b
orb %al, %r15b
cmpb $0x1, %r15b
jne 0x81f0
testl %r11d, %r11d
sete %al
testl %r10d, %r10d
setne %r11b
orb %al, %r11b
cmpb $0x1, %r11b
jne 0x81f0
movzwl 0x22(%r8), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x81f7
cmpl $0x1, %eax
movq -0x40(%rbp), %r15
je 0x80f3
cmpl %eax, -0x50(%rbp)
jne 0x81f7
cmpl $-0x1, %r10d
je 0x810d
movl 0x2a(%r8), %eax
addq %r10, %rax
addq $0x1e, %rax
cmpq (%r14), %rax
ja 0x81f0
testb $0x20, 0x9(%r8)
jne 0x85d9
addl %r9d, %edx
movzwl 0x20(%r8), %eax
addl %edx, %eax
addl $0x2e, %eax
movl %edi, %edx
subl %eax, %edx
jb 0x81f0
movl %eax, %eax
addq %rax, %r8
incq %rsi
jmp 0x8003
leaq (%r8,%rdx), %rax
addq $0x2e, %rax
movl %r9d, %r15d
cmpl $0x4, %r15d
jb 0x81f0
movl %r15d, %r15d
movzwl 0x2(%rax), %r12d
leaq 0x4(%r12), %r13
cmpq %r15, %r13
ja 0x81f0
cmpw $0x1, (%rax)
je 0x817e
addq %r13, %rax
subl %r12d, %r15d
addl $-0x4, %r15d
jne 0x8147
jmp 0x8083
movq -0x40(%rbp), %rax
movabsq $0x100000001, %r15      # imm = 0x100000001
movq %r15, 0x64(%rax)
jmp 0x8083
cmpl $0x1, -0xa0(%rbp)
jne 0x81d2
pushq $0x2
popq %rdi
cmpl $0x0, -0x6c(%rbp)
jne 0x7e9d
movl -0x70(%rbp), %eax
movl -0x78(%rbp), %ecx
movl -0x74(%rbp), %esi
movl -0x68(%rbp), %r10d
movl -0x64(%rbp), %edx
movl %eax, 0x10(%r14)
testl %esi, %esi
jne 0x7e9d
testl %edx, %edx
je 0x81da
pushq $0xf
jmp 0x7e9c
movl %r9d, %edi
jmp 0x7e9d
movl -0x80(%rbp), %esi
movl -0x7c(%rbp), %edx
movq -0x60(%rbp), %r15
jmp 0x7eda
pushq $0x10
jmp 0x7e9c
pushq $0x9
jmp 0x7e9c
pushq $0xa
jmp 0x7e9c
movq %rax, -0x38(%rbp)
btl $0xb, -0x30(%rbp)
jb 0x7ea3
cmpl $0x2, -0x38(%rbp)
jb 0x7ea3
movq -0x40(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rsi
leal -0x2(%rsi), %eax
shrl %eax
movq %rax, -0x58(%rbp)
movq %rax, %rdi
leaq 0x1(,%rdi,2), %r10
cmpq %rsi, %r10
jae 0x83e2
leaq (%rdi,%rdi), %rax
leaq 0x2(%rax), %rcx
movq (%rdx), %r8
movq 0x20(%rdx), %r9
cmpq %rsi, %rcx
movq %rdi, -0x50(%rbp)
jae 0x82ee
movq -0x30(%rbp), %rdx
movl (%rdx,%r10,4), %ecx
movl 0x8(%rdx,%rax,4), %eax
movl (%r9,%rcx,4), %ecx
leaq (%r8,%rcx), %rdx
movl (%r9,%rax,4), %eax
leaq (%r8,%rax), %r13
leaq (%r8,%rcx), %rsi
addq $0x2e, %rsi
movzwl -0x12(%rsi), %r11d
movzwl 0x1c(%r8,%rax), %r14d
cmpw %r14w, %r11w
movl %r14d, %eax
cmovbl %r11d, %eax
movzwl %ax, %eax
movq %rax, -0x48(%rbp)
addq %rdx, %rax
addq $0x2e, %rax
xorl %r12d, %r12d
xorl %r15d, %r15d
leaq (%rsi,%r12), %rcx
movl %r15d, %edx
cmpq %rax, %rcx
jae 0x82f3
movzbl (%rcx), %ecx
leal -0x41(%rcx), %edx
leal 0x20(%rcx), %edi
cmpb $0x1a, %dl
movzbl %dil, %r15d
cmovael %ecx, %r15d
movzbl 0x2e(%r13,%r12), %ecx
leal -0x41(%rcx), %edx
leal 0x20(%rcx), %edi
cmpb $0x1a, %dl
movzbl %dil, %edx
cmovael %ecx, %edx
cmpb %dl, %r15b
jne 0x82f3
incq %r12
jmp 0x82ae
xorl %r11d, %r11d
jmp 0x8313
xorl %eax, %eax
cmpw %r14w, %r11w
setb %al
xorl %ecx, %ecx
cmpb %dl, %r15b
setb %cl
cmpq %r12, -0x48(%rbp)
cmovel %eax, %ecx
movzbl %cl, %r11d
movq -0x50(%rbp), %rdi
addq %r10, %r11
movq -0x30(%rbp), %rax
movl (%rax,%rdi,4), %ecx
movl (%rax,%r11,4), %r14d
movq %rcx, -0x48(%rbp)
movl (%r9,%rcx,4), %eax
leaq (%r8,%rax), %rcx
movl (%r9,%r14,4), %edx
leaq (%r8,%rdx), %r13
leaq (%r8,%rax), %rsi
addq $0x2e, %rsi
movzwl -0x12(%rsi), %r9d
movzwl 0x1c(%r8,%rdx), %r8d
cmpw %r8w, %r9w
movl %r8d, %eax
cmovbl %r9d, %eax
movzwl %ax, %r15d
leaq (%r15,%rcx), %rax
addq $0x2e, %rax
xorl %r12d, %r12d
xorl %ecx, %ecx
leaq (%rsi,%r12), %rdi
movl %ecx, %edx
cmpq %rax, %rdi
jae 0x83a2
movzbl (%rdi), %edx
leal -0x41(%rdx), %ecx
leal 0x20(%rdx), %edi
cmpb $0x1a, %cl
movzbl %dil, %ecx
cmovael %edx, %ecx
movzbl 0x2e(%r13,%r12), %edi
leal -0x41(%rdi), %edx
leal 0x20(%rdi), %r10d
cmpb $0x1a, %dl
movzbl %r10b, %edx
cmovael %edi, %edx
cmpb %dl, %cl
jne 0x83a2
incq %r12
jmp 0x8364
xorl %eax, %eax
cmpw %r8w, %r9w
setae %al
xorl %esi, %esi
cmpb %dl, %cl
setae %sil
cmpq %r12, %r15
cmovel %eax, %esi
testb %sil, %sil
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rcx
jne 0x83e2
movq -0x30(%rbp), %rax
movl %r14d, (%rax,%rcx,4)
movq -0x48(%rbp), %rcx
movl %ecx, (%rax,%r11,4)
movq %r11, %rdi
jmp 0x8233
movq -0x58(%rbp), %rax
subq $0x1, %rax
jae 0x822c
jmp 0x85c8
movq -0x30(%rbp), %rcx
movl -0x4(%rcx,%rsi,4), %r8d
movl (%rcx), %eax
movl %eax, -0x4(%rcx,%rsi,4)
movq %r8, -0x50(%rbp)
movl %r8d, (%rcx)
xorl %r11d, %r11d
movq %rdi, -0x38(%rbp)
leaq (%r11,%r11), %rax
leaq 0x1(,%r11,2), %r9
cmpq %rdi, %r9
jae 0x85bb
movq %r11, -0x48(%rbp)
leaq 0x2(%rax), %rcx
movq (%rdx), %r8
movq 0x20(%rdx), %r10
cmpq %rdi, %rcx
jae 0x84d0
movq -0x30(%rbp), %rdx
movl (%rdx,%r9,4), %ecx
movl 0x8(%rdx,%rax,4), %eax
movl (%r10,%rcx,4), %ecx
leaq (%r8,%rcx), %rsi
movl (%r10,%rax,4), %edi
leaq (%r8,%rdi), %r13
leaq (%r8,%rcx), %rax
addq $0x2e, %rax
movzwl -0x12(%rax), %r11d
movzwl 0x1c(%r8,%rdi), %r14d
cmpw %r14w, %r11w
movl %r14d, %ecx
cmovbl %r11d, %ecx
movzwl %cx, %ecx
movq %rcx, -0x58(%rbp)
leaq (%rcx,%rsi), %rdi
addq $0x2e, %rdi
xorl %r12d, %r12d
xorl %esi, %esi
leaq (%rax,%r12), %r15
movl %esi, %ecx
cmpq %rdi, %r15
jae 0x84d5
movzbl (%r15), %ecx
leal -0x41(%rcx), %esi
leal 0x20(%rcx), %r15d
cmpb $0x1a, %sil
movzbl %r15b, %esi
cmovael %ecx, %esi
movzbl 0x2e(%r13,%r12), %r15d
leal -0x41(%r15), %ecx
leal 0x20(%r15), %edx
cmpb $0x1a, %cl
movzbl %dl, %ecx
cmovael %r15d, %ecx
cmpb %cl, %sil
jne 0x84d5
incq %r12
jmp 0x848d
xorl %r11d, %r11d
jmp 0x84f1
xorl %eax, %eax
cmpw %r14w, %r11w
setb %al
xorl %edx, %edx
cmpb %cl, %sil
setb %dl
cmpq %r12, -0x58(%rbp)
cmovel %eax, %edx
movzbl %dl, %r11d
addq %r9, %r11
movq -0x30(%rbp), %rax
movl (%rax,%r11,4), %r9d
movq -0x50(%rbp), %rax
movl (%r10,%rax,4), %eax
leaq (%r8,%rax), %rcx
movl (%r10,%r9,4), %edx
leaq (%r8,%rdx), %r12
addq %r8, %rax
addq $0x2e, %rax
movzwl -0x12(%rax), %r10d
movzwl 0x1c(%r8,%rdx), %r8d
cmpw %r8w, %r10w
movl %r8d, %edx
cmovbl %r10d, %edx
movzwl %dx, %r14d
leaq (%r14,%rcx), %rdi
addq $0x2e, %rdi
xorl %r15d, %r15d
xorl %esi, %esi
leaq (%rax,%r15), %r13
movl %esi, %ecx
cmpq %rdi, %r13
jae 0x857f
movzbl (%r13), %ecx
leal -0x41(%rcx), %edx
leal 0x20(%rcx), %esi
cmpb $0x1a, %dl
movzbl %sil, %esi
cmovael %ecx, %esi
movzbl 0x2e(%r12,%r15), %edx
leal -0x41(%rdx), %ecx
leal 0x20(%rdx), %r13d
cmpb $0x1a, %cl
movzbl %r13b, %ecx
cmovael %edx, %ecx
cmpb %cl, %sil
jne 0x857f
incq %r15
jmp 0x853e
xorl %eax, %eax
cmpw %r8w, %r10w
setae %al
xorl %edx, %edx
cmpb %cl, %sil
setae %dl
cmpq %r15, %r14
cmovel %eax, %edx
testb %dl, %dl
jne 0x85c0
movq -0x30(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %r9d, (%rax,%rcx,4)
movq -0x50(%rbp), %rcx
movl %ecx, (%rax,%r11,4)
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rdi
jmp 0x8412
movq %rdi, %rsi
jmp 0x85c8
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rsi, %rdi
decq %rdi
jne 0x83f5
jmp 0x7ea3
pushq $0x5
jmp 0x7e9c