// File: jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_validate_file
mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags)
{
    mz_zip_archive_file_stat file_stat;
    mz_zip_internal_state *pState;
    const mz_uint8 *pCentral_dir_header;
    mz_bool found_zip64_ext_data_in_cdir = MZ_FALSE;
    mz_bool found_zip64_ext_data_in_ldir = MZ_FALSE;
    mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
    mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
    mz_uint64 local_header_ofs = 0;
    mz_uint32 local_header_filename_len, local_header_extra_len, local_header_crc32;
    mz_uint64 local_header_comp_size, local_header_uncomp_size;
    mz_uint32 uncomp_crc32 = MZ_CRC32_INIT;
    mz_bool has_data_descriptor;
    mz_uint32 local_header_bit_flags;

    mz_zip_array file_data_array;
    mz_zip_array_init(&file_data_array, 1);

    if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    if (file_index > pZip->m_total_files)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    pState = pZip->m_pState;

    pCentral_dir_header = mz_zip_get_cdh(pZip, file_index);

    if (!mz_zip_file_stat_internal(pZip, file_index, pCentral_dir_header, &file_stat, &found_zip64_ext_data_in_cdir))
        return MZ_FALSE;

    /* A directory or zero length file */
    if ((file_stat.m_is_directory) || (!file_stat.m_uncomp_size))
        return MZ_TRUE;

    /* Encryption and patch files are not supported. */
    if (file_stat.m_is_encrypted)
        return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);

    /* This function only supports stored and deflate. */
    if ((file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
        return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD);

    if (!file_stat.m_is_supported)
        return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE);

    /* Read and parse the local directory entry. */
    local_header_ofs = file_stat.m_local_header_ofs;
    if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
        return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);

    if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

    local_header_filename_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS);
    local_header_extra_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
    local_header_comp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS);
    local_header_uncomp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS);
    local_header_crc32 = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_CRC32_OFS);
    local_header_bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS);
    has_data_descriptor = (local_header_bit_flags & 8) != 0;

    if (local_header_filename_len != strlen(file_stat.m_filename))
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

    if ((local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size) > pZip->m_archive_size)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

    if (!mz_zip_array_resize(pZip, &file_data_array, MZ_MAX(local_header_filename_len, local_header_extra_len), MZ_FALSE))
        return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);

    if (local_header_filename_len)
    {
        if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE, file_data_array.m_p, local_header_filename_len) != local_header_filename_len)
        {
            mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
            goto handle_failure;
        }

        /* I've seen 1 archive that had the same pathname, but used backslashes in the local dir and forward slashes in the central dir. Do we care about this? For now, this case will fail validation. */
        if (memcmp(file_stat.m_filename, file_data_array.m_p, local_header_filename_len) != 0)
        {
            mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
            goto handle_failure;
        }
    }

    if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
    {
        mz_uint32 extra_size_remaining = local_header_extra_len;
        const mz_uint8 *pExtra_data = (const mz_uint8 *)file_data_array.m_p;

        if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len, file_data_array.m_p, local_header_extra_len) != local_header_extra_len)
        {
            mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
            goto handle_failure;
        }

        do
        {
            mz_uint32 field_id, field_data_size, field_total_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));
            field_total_size = field_data_size + sizeof(mz_uint16) * 2;

            if (field_total_size > 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)
            {
                const mz_uint8 *pSrc_field_data = pExtra_data + sizeof(mz_uint32);

                if (field_data_size < sizeof(mz_uint64) * 2)
                {
                    mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
                    goto handle_failure;
                }

                local_header_uncomp_size = MZ_READ_LE64(pSrc_field_data);
                local_header_comp_size = MZ_READ_LE64(pSrc_field_data + sizeof(mz_uint64));

                found_zip64_ext_data_in_ldir = MZ_TRUE;
                break;
            }

            pExtra_data += field_total_size;
            extra_size_remaining -= field_total_size;
        } while (extra_size_remaining);
    }

    /* TODO: parse local header extra data when local_header_comp_size is 0xFFFFFFFF! (big_descriptor.zip) */
    /* I've seen zips in the wild with the data descriptor bit set, but proper local header values and bogus data descriptors */
    if ((has_data_descriptor) && (!local_header_comp_size) && (!local_header_crc32))
    {
        mz_uint8 descriptor_buf[32];
        mz_bool has_id;
        const mz_uint8 *pSrc;
        mz_uint32 file_crc32;
        mz_uint64 comp_size = 0, uncomp_size = 0;

        mz_uint32 num_descriptor_uint32s = ((pState->m_zip64) || (found_zip64_ext_data_in_ldir)) ? 6 : 4;

        if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size, descriptor_buf, sizeof(mz_uint32) * num_descriptor_uint32s) != (sizeof(mz_uint32) * num_descriptor_uint32s))
        {
            mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
            goto handle_failure;
        }

        has_id = (MZ_READ_LE32(descriptor_buf) == MZ_ZIP_DATA_DESCRIPTOR_ID);
        pSrc = has_id ? (descriptor_buf + sizeof(mz_uint32)) : descriptor_buf;

        file_crc32 = MZ_READ_LE32(pSrc);

        if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
        {
            comp_size = MZ_READ_LE64(pSrc + sizeof(mz_uint32));
            uncomp_size = MZ_READ_LE64(pSrc + sizeof(mz_uint32) + sizeof(mz_uint64));
        }
        else
        {
            comp_size = MZ_READ_LE32(pSrc + sizeof(mz_uint32));
            uncomp_size = MZ_READ_LE32(pSrc + sizeof(mz_uint32) + sizeof(mz_uint32));
        }

        if ((file_crc32 != file_stat.m_crc32) || (comp_size != file_stat.m_comp_size) || (uncomp_size != file_stat.m_uncomp_size))
        {
            mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
            goto handle_failure;
        }
    }
    else
    {
        if ((local_header_crc32 != file_stat.m_crc32) || (local_header_comp_size != file_stat.m_comp_size) || (local_header_uncomp_size != file_stat.m_uncomp_size))
        {
            mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
            goto handle_failure;
        }
    }

    mz_zip_array_clear(pZip, &file_data_array);

    if ((flags & MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY) == 0)
    {
        if (!mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_compute_crc32_callback, &uncomp_crc32, 0))
            return MZ_FALSE;

        /* 1 more check to be sure, although the extract checks too. */
        if (uncomp_crc32 != file_stat.m_crc32)
        {
            mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
            return MZ_FALSE;
        }
    }

    return MZ_TRUE;

handle_failure:
    mz_zip_array_clear(pZip, &file_data_array);
    return MZ_FALSE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x750, %rsp            # imm = 0x750
movq %rdi, -0x1b8(%rbp)
movl %esi, -0x1bc(%rbp)
movl %edx, -0x1c0(%rbp)
movl $0x0, -0x62c(%rbp)
movl $0x0, -0x630(%rbp)
leaq -0x650(%rbp), %rax
movq %rax, -0x658(%rbp)
movq $0x0, -0x660(%rbp)
movl $0x0, -0x684(%rbp)
leaq -0x6b0(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x1, -0x54(%rbp)
movq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3190
movl -0x54(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x18(%rax)
cmpq $0x0, -0x1b8(%rbp)
je 0x10fc3
movq -0x1b8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x10fc3
movq -0x1b8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x10fc3
movq -0x1b8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x10fc3
movq -0x1b8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x10ff5
movq -0x1b8(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x18, -0x7c(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x10fe6
movl -0x7c(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movl -0x1bc(%rbp), %eax
movq -0x1b8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jbe 0x11048
movq -0x1b8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x18, -0x8c(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x11039
movl -0x8c(%rbp), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x1b8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x620(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0x1bc(%rbp), %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x1108c
movq -0x68(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x1108c
movl -0x6c(%rbp), %eax
movq -0x68(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jb 0x11096
movq $0x0, -0x60(%rbp)
jmp 0x110ba
movq -0x68(%rbp), %rax
movq 0x68(%rax), %rax
movq (%rax), %rax
movq -0x68(%rbp), %rcx
movq 0x68(%rcx), %rcx
movq 0x20(%rcx), %rcx
movl -0x6c(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x628(%rbp)
movq -0x1b8(%rbp), %rdi
movl -0x1bc(%rbp), %esi
movq -0x628(%rbp), %rdx
leaq -0x618(%rbp), %rcx
leaq -0x62c(%rbp), %r8
callq 0x11c80
cmpl $0x0, %eax
jne 0x11100
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
cmpl $0x0, -0x5cc(%rbp)
jne 0x11113
cmpq $0x0, -0x5e8(%rbp)
jne 0x11122
movl $0x1, -0x1b0(%rbp)
jmp 0x11c6c
cmpl $0x0, -0x5c8(%rbp)
je 0x1116c
movq -0x1b8(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x5, -0x9c(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x1115d
movl -0x9c(%rbp), %ecx
movq -0x98(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movzwl -0x602(%rbp), %eax
cmpl $0x0, %eax
je 0x111c5
movzwl -0x602(%rbp), %eax
cmpl $0x8, %eax
je 0x111c5
movq -0x1b8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x4, -0xac(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x111b6
movl -0xac(%rbp), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
cmpl $0x0, -0x5c4(%rbp)
jne 0x1120f
movq -0x1b8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x6, -0xbc(%rbp)
cmpq $0x0, -0xb8(%rbp)
je 0x11200
movl -0xbc(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x5d8(%rbp), %rax
movq %rax, -0x660(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x1b8(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x660(%rbp), %rsi
movq -0x658(%rbp), %rdx
movl $0x1e, %ecx
callq *%rax
cmpq $0x1e, %rax
je 0x1128f
movq -0x1b8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl $0x14, -0xcc(%rbp)
cmpq $0x0, -0xc8(%rbp)
je 0x11280
movl -0xcc(%rbp), %ecx
movq -0xc8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x658(%rbp), %rax
cmpl $0x4034b50, (%rax)      # imm = 0x4034B50
je 0x112df
movq -0x1b8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl $0x9, -0xdc(%rbp)
cmpq $0x0, -0xd8(%rbp)
je 0x112d0
movl -0xdc(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x658(%rbp), %rax
movzwl 0x1a(%rax), %eax
movl %eax, -0x664(%rbp)
movq -0x658(%rbp), %rax
movzwl 0x1c(%rax), %eax
movl %eax, -0x668(%rbp)
movq -0x658(%rbp), %rax
movl 0x12(%rax), %eax
movq %rax, -0x678(%rbp)
movq -0x658(%rbp), %rax
movl 0x16(%rax), %eax
movq %rax, -0x680(%rbp)
movq -0x658(%rbp), %rax
movl 0xe(%rax), %eax
movl %eax, -0x66c(%rbp)
movq -0x658(%rbp), %rax
movzwl 0x6(%rax), %eax
movl %eax, -0x68c(%rbp)
movl -0x68c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x688(%rbp)
movl -0x664(%rbp), %eax
movq %rax, -0x738(%rbp)
leaq -0x618(%rbp), %rdi
addq $0x58, %rdi
callq 0x3140
movq %rax, %rcx
movq -0x738(%rbp), %rax
cmpq %rcx, %rax
je 0x113cb
movq -0x1b8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movl $0x9, -0xec(%rbp)
cmpq $0x0, -0xe8(%rbp)
je 0x113bc
movl -0xec(%rbp), %ecx
movq -0xe8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x660(%rbp), %rax
addq $0x1e, %rax
movl -0x664(%rbp), %ecx
addq %rcx, %rax
movl -0x668(%rbp), %ecx
addq %rcx, %rax
addq -0x5f0(%rbp), %rax
movq -0x1b8(%rbp), %rcx
cmpq (%rcx), %rax
jbe 0x1143c
movq -0x1b8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movl $0x9, -0xfc(%rbp)
cmpq $0x0, -0xf8(%rbp)
je 0x1142d
movl -0xfc(%rbp), %ecx
movq -0xf8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x1b8(%rbp), %rax
movq %rax, -0x740(%rbp)
movl -0x664(%rbp), %eax
cmpl -0x668(%rbp), %eax
jbe 0x11466
movl -0x664(%rbp), %eax
movl %eax, -0x744(%rbp)
jmp 0x11472
movl -0x668(%rbp), %eax
movl %eax, -0x744(%rbp)
movq -0x740(%rbp), %rcx
movl -0x744(%rbp), %eax
movl %eax, %eax
movq %rcx, -0x30(%rbp)
leaq -0x6b0(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x114cd
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x44(%rbp), %ecx
callq 0x20220
cmpl $0x0, %eax
jne 0x114cb
movl $0x0, -0x24(%rbp)
jmp 0x114e0
jmp 0x114cd
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x11527
movq -0x1b8(%rbp), %rax
movq %rax, -0x108(%rbp)
movl $0x10, -0x10c(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0x11518
movl -0x10c(%rbp), %ecx
movq -0x108(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
cmpl $0x0, -0x664(%rbp)
je 0x11603
movq -0x1b8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x1b8(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x660(%rbp), %rsi
addq $0x1e, %rsi
movq -0x6b0(%rbp), %rdx
movl -0x664(%rbp), %ecx
callq *%rax
movl -0x664(%rbp), %ecx
cmpq %rcx, %rax
je 0x115a6
movq -0x1b8(%rbp), %rax
movq %rax, -0x118(%rbp)
movl $0x14, -0x11c(%rbp)
cmpq $0x0, -0x118(%rbp)
je 0x115a1
movl -0x11c(%rbp), %ecx
movq -0x118(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x11c23
leaq -0x618(%rbp), %rdi
addq $0x58, %rdi
movq -0x6b0(%rbp), %rsi
movl -0x664(%rbp), %eax
movl %eax, %edx
callq 0x3150
cmpl $0x0, %eax
je 0x11601
movq -0x1b8(%rbp), %rax
movq %rax, -0x128(%rbp)
movl $0x1e, -0x12c(%rbp)
cmpq $0x0, -0x128(%rbp)
je 0x115fc
movl -0x12c(%rbp), %ecx
movq -0x128(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x11c23
jmp 0x11603
cmpl $0x0, -0x668(%rbp)
je 0x11881
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x678(%rbp)
je 0x11630
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x680(%rbp)
jne 0x11881
movl -0x668(%rbp), %eax
movl %eax, -0x6b4(%rbp)
movq -0x6b0(%rbp), %rax
movq %rax, -0x6c0(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x1b8(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x660(%rbp), %rsi
addq $0x1e, %rsi
movl -0x664(%rbp), %ecx
addq %rcx, %rsi
movq -0x6b0(%rbp), %rdx
movl -0x668(%rbp), %ecx
callq *%rax
movl -0x668(%rbp), %ecx
cmpq %rcx, %rax
je 0x116c5
movq -0x1b8(%rbp), %rax
movq %rax, -0x138(%rbp)
movl $0x14, -0x13c(%rbp)
cmpq $0x0, -0x138(%rbp)
je 0x116c0
movl -0x13c(%rbp), %ecx
movq -0x138(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x11c23
jmp 0x116c7
movl -0x6b4(%rbp), %eax
cmpq $0x4, %rax
jae 0x11714
movq -0x1b8(%rbp), %rax
movq %rax, -0x148(%rbp)
movl $0x9, -0x14c(%rbp)
cmpq $0x0, -0x148(%rbp)
je 0x11705
movl -0x14c(%rbp), %ecx
movq -0x148(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x6c0(%rbp), %rax
movzwl (%rax), %eax
movl %eax, -0x6c4(%rbp)
movq -0x6c0(%rbp), %rax
movzwl 0x2(%rax), %eax
movl %eax, -0x6c8(%rbp)
movl -0x6c8(%rbp), %eax
addq $0x4, %rax
movl %eax, -0x6cc(%rbp)
movl -0x6cc(%rbp), %eax
cmpl -0x6b4(%rbp), %eax
jbe 0x11794
movq -0x1b8(%rbp), %rax
movq %rax, -0x158(%rbp)
movl $0x9, -0x15c(%rbp)
cmpq $0x0, -0x158(%rbp)
je 0x11785
movl -0x15c(%rbp), %ecx
movq -0x158(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
cmpl $0x1, -0x6c4(%rbp)
jne 0x11845
movq -0x6c0(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x6d8(%rbp)
movl -0x6c8(%rbp), %eax
cmpq $0x10, %rax
jae 0x117f6
movq -0x1b8(%rbp), %rax
movq %rax, -0x168(%rbp)
movl $0x9, -0x16c(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x117f1
movl -0x16c(%rbp), %ecx
movq -0x168(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x11c23
movq -0x6d8(%rbp), %rax
movl (%rax), %eax
movq -0x6d8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, -0x680(%rbp)
movq -0x6d8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x6d8(%rbp), %rcx
movl 0xc(%rcx), %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, -0x678(%rbp)
movl $0x1, -0x630(%rbp)
jmp 0x1187f
movl -0x6cc(%rbp), %ecx
movq -0x6c0(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x6c0(%rbp)
movl -0x6cc(%rbp), %ecx
movl -0x6b4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x6b4(%rbp)
cmpl $0x0, -0x6b4(%rbp)
jne 0x116c7
jmp 0x11881
cmpl $0x0, -0x688(%rbp)
je 0x11ad8
cmpq $0x0, -0x678(%rbp)
jne 0x11ad8
cmpl $0x0, -0x66c(%rbp)
jne 0x11ad8
movq $0x0, -0x720(%rbp)
movq $0x0, -0x728(%rbp)
movq -0x620(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x64(%rcx)
movb %al, -0x745(%rbp)
jne 0x118e4
cmpl $0x0, -0x630(%rbp)
setne %al
movb %al, -0x745(%rbp)
movb -0x745(%rbp), %dl
movl $0x4, %eax
movl $0x6, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x72c(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x1b8(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x660(%rbp), %rsi
addq $0x1e, %rsi
movl -0x664(%rbp), %ecx
addq %rcx, %rsi
movl -0x668(%rbp), %ecx
addq %rcx, %rsi
addq -0x5f0(%rbp), %rsi
leaq -0x700(%rbp), %rdx
movl -0x72c(%rbp), %ecx
shlq $0x2, %rcx
callq *%rax
movl -0x72c(%rbp), %ecx
shlq $0x2, %rcx
cmpq %rcx, %rax
je 0x11993
movq -0x1b8(%rbp), %rax
movq %rax, -0x178(%rbp)
movl $0x14, -0x17c(%rbp)
cmpq $0x0, -0x178(%rbp)
je 0x1198e
movl -0x17c(%rbp), %ecx
movq -0x178(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x11c23
cmpl $0x8074b50, -0x700(%rbp) # imm = 0x8074B50
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x704(%rbp)
cmpl $0x0, -0x704(%rbp)
je 0x119c8
leaq -0x700(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x750(%rbp)
jmp 0x119d6
leaq -0x700(%rbp), %rax
movq %rax, -0x750(%rbp)
movq -0x750(%rbp), %rax
movq %rax, -0x710(%rbp)
movq -0x710(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x714(%rbp)
movq -0x620(%rbp), %rax
cmpl $0x0, 0x64(%rax)
jne 0x11a09
cmpl $0x0, -0x630(%rbp)
je 0x11a4f
movq -0x710(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x710(%rbp), %rcx
movl 0x8(%rcx), %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, -0x720(%rbp)
movq -0x710(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x710(%rbp), %rcx
movl 0x10(%rcx), %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, -0x728(%rbp)
jmp 0x11a71
movq -0x710(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x720(%rbp)
movq -0x710(%rbp), %rax
movl 0x8(%rax), %eax
movq %rax, -0x728(%rbp)
movl -0x714(%rbp), %eax
cmpl -0x5f8(%rbp), %eax
jne 0x11a9f
movq -0x720(%rbp), %rax
cmpq -0x5f0(%rbp), %rax
jne 0x11a9f
movq -0x728(%rbp), %rax
cmpq -0x5e8(%rbp), %rax
je 0x11ad6
movq -0x1b8(%rbp), %rax
movq %rax, -0x188(%rbp)
movl $0x1e, -0x18c(%rbp)
cmpq $0x0, -0x188(%rbp)
je 0x11ad1
movl -0x18c(%rbp), %ecx
movq -0x188(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x11c23
jmp 0x11b3f
movl -0x66c(%rbp), %eax
cmpl -0x5f8(%rbp), %eax
jne 0x11b06
movq -0x678(%rbp), %rax
cmpq -0x5f0(%rbp), %rax
jne 0x11b06
movq -0x680(%rbp), %rax
cmpq -0x5e8(%rbp), %rax
je 0x11b3d
movq -0x1b8(%rbp), %rax
movq %rax, -0x198(%rbp)
movl $0x1e, -0x19c(%rbp)
cmpq $0x0, -0x198(%rbp)
je 0x11b38
movl -0x19c(%rbp), %ecx
movq -0x198(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x11c23
jmp 0x11b3f
movq -0x1b8(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x6b0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x10(%rbp), %rcx
movq (%rcx), %rsi
callq *%rax
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3190
movl -0x1c0(%rbp), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x11c17
movq -0x1b8(%rbp), %rdi
movl -0x1bc(%rbp), %esi
leaq 0x78a(%rip), %rdx       # 0x12330
leaq -0x684(%rbp), %rcx
xorl %r8d, %r8d
callq 0xf1b0
cmpl $0x0, %eax
jne 0x11bc9
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
movl -0x684(%rbp), %eax
cmpl -0x5f8(%rbp), %eax
je 0x11c15
movq -0x1b8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movl $0x1e, -0x1ac(%rbp)
cmpq $0x0, -0x1a8(%rbp)
je 0x11c09
movl -0x1ac(%rbp), %ecx
movq -0x1a8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1b0(%rbp)
jmp 0x11c6c
jmp 0x11c17
movl $0x1, -0x1b0(%rbp)
jmp 0x11c6c
movq -0x1b8(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0x6b0(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x20(%rbp), %rcx
movq (%rcx), %rsi
callq *%rax
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3190
movl $0x0, -0x1b0(%rbp)
movl -0x1b0(%rbp), %eax
addq $0x750, %rsp            # imm = 0x750
popq %rbp
retq
nopl (%rax,%rax)