// File: jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_extract_to_callback
mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags)
{
    int status = TINFL_STATUS_DONE;
    mz_uint file_crc32 = MZ_CRC32_INIT;
    mz_uint64 read_buf_size, read_buf_ofs = 0, read_buf_avail, comp_remaining, out_buf_ofs = 0, cur_file_ofs;
    mz_zip_archive_file_stat file_stat;
    void *pRead_buf = NULL;
    void *pWrite_buf = NULL;
    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;

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

    if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
        return MZ_FALSE;

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

    /* Encryption and patch files are not supported. */
    if (file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG))
        return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);

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

    /* Read and do some minimal validation of the local directory entry (this doesn't crack the zip64 stuff, which we already have from the central dir) */
    cur_file_ofs = file_stat.m_local_header_ofs;
    if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_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);

    cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
    if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);

    /* Decompress the file either directly from memory or from a file input buffer. */
    if (pZip->m_pState->m_pMem)
    {
        pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs;
        read_buf_size = read_buf_avail = file_stat.m_comp_size;
        comp_remaining = 0;
    }
    else
    {
        read_buf_size = MZ_MIN(file_stat.m_comp_size, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE);
        if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
            return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);

        read_buf_avail = 0;
        comp_remaining = file_stat.m_comp_size;
    }

    if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method))
    {
        /* The file is stored or the caller has requested the compressed data. */
        if (pZip->m_pState->m_pMem)
        {
            if (((sizeof(size_t) == sizeof(mz_uint32))) && (file_stat.m_comp_size > MZ_UINT32_MAX))
                return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);

            if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size)
            {
                mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED);
                status = TINFL_STATUS_FAILED;
            }
            else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
            {
#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
                file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)file_stat.m_comp_size);
#endif
            }

            cur_file_ofs += file_stat.m_comp_size;
            out_buf_ofs += file_stat.m_comp_size;
            comp_remaining = 0;
        }
        else
        {
            while (comp_remaining)
            {
                read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
                if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
                {
                    mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
                    status = TINFL_STATUS_FAILED;
                    break;
                }

#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
                if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
                {
                    file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)read_buf_avail);
                }
#endif

                if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
                {
                    mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED);
                    status = TINFL_STATUS_FAILED;
                    break;
                }

                cur_file_ofs += read_buf_avail;
                out_buf_ofs += read_buf_avail;
                comp_remaining -= read_buf_avail;
            }
        }
    }
    else
    {
        tinfl_decompressor inflator;
        tinfl_init(&inflator);

        if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
        {
            mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
            status = TINFL_STATUS_FAILED;
        }
        else
        {
            do
            {
                mz_uint8 *pWrite_buf_cur = (mz_uint8 *)pWrite_buf + (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
                size_t in_buf_size, out_buf_size = TINFL_LZ_DICT_SIZE - (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
                if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
                {
                    read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
                    if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
                    {
                        mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
                        status = TINFL_STATUS_FAILED;
                        break;
                    }
                    cur_file_ofs += read_buf_avail;
                    comp_remaining -= read_buf_avail;
                    read_buf_ofs = 0;
                }

                in_buf_size = (size_t)read_buf_avail;
                status = tinfl_decompress(&inflator, (const mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pWrite_buf, pWrite_buf_cur, &out_buf_size, comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0);
                read_buf_avail -= in_buf_size;
                read_buf_ofs += in_buf_size;

                if (out_buf_size)
                {
                    if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size)
                    {
                        mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED);
                        status = TINFL_STATUS_FAILED;
                        break;
                    }

#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
                    file_crc32 = (mz_uint32)mz_crc32(file_crc32, pWrite_buf_cur, out_buf_size);
#endif
                    if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size)
                    {
                        mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED);
                        status = TINFL_STATUS_FAILED;
                        break;
                    }
                }
            } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) || (status == TINFL_STATUS_HAS_MORE_OUTPUT));
        }
    }

    if ((status == TINFL_STATUS_DONE) && (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
    {
        /* Make sure the entire file was decompressed, and check its CRC. */
        if (out_buf_ofs != file_stat.m_uncomp_size)
        {
            mz_zip_set_error(pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE);
            status = TINFL_STATUS_FAILED;
        }
#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
        else if (file_crc32 != file_stat.m_crc32)
        {
            mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED);
            status = TINFL_STATUS_FAILED;
        }
#endif
    }

    if (!pZip->m_pState->m_pMem)
        pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);

    if (pWrite_buf)
        pZip->m_pFree(pZip->m_pAlloc_opaque, pWrite_buf);

    return status == TINFL_STATUS_DONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3130, %rsp           # imm = 0x3130
movq %rdi, -0x108(%rbp)
movl %esi, -0x10c(%rbp)
movq %rdx, -0x118(%rbp)
movq %rcx, -0x120(%rbp)
movl %r8d, -0x124(%rbp)
movl $0x0, -0x128(%rbp)
movl $0x0, -0x12c(%rbp)
movq $0x0, -0x140(%rbp)
movq $0x0, -0x158(%rbp)
movq $0x0, -0x5c0(%rbp)
movq $0x0, -0x5c8(%rbp)
leaq -0x5f0(%rbp), %rax
movq %rax, -0x5f8(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0xf25b
movq -0x108(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0xf25b
cmpq $0x0, -0x118(%rbp)
je 0xf25b
movq -0x108(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0xf28d
movq -0x108(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x18, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xf27e
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x100(%rbp)
jmp 0xfd21
movq -0x108(%rbp), %rdi
movl -0x10c(%rbp), %esi
leaq -0x5b8(%rbp), %rdx
callq 0xeda0
cmpl $0x0, %eax
jne 0xf2ba
movl $0x0, -0x100(%rbp)
jmp 0xfd21
cmpl $0x0, -0x56c(%rbp)
jne 0xf2cd
cmpq $0x0, -0x590(%rbp)
jne 0xf2dc
movl $0x1, -0x100(%rbp)
jmp 0xfd21
movzwl -0x5a4(%rbp), %eax
andl $0x61, %eax
cmpl $0x0, %eax
je 0xf31d
movq -0x108(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x5, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xf30e
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x100(%rbp)
jmp 0xfd21
movl -0x124(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0xf377
movzwl -0x5a2(%rbp), %eax
cmpl $0x0, %eax
je 0xf377
movzwl -0x5a2(%rbp), %eax
cmpl $0x8, %eax
je 0xf377
movq -0x108(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x4, -0x2c(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xf368
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x100(%rbp)
jmp 0xfd21
movq -0x578(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x108(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x108(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x160(%rbp), %rsi
movq -0x5f8(%rbp), %rdx
movl $0x1e, %ecx
callq *%rax
cmpq $0x1e, %rax
je 0xf3e8
movq -0x108(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x14, -0x3c(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xf3d9
movl -0x3c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x100(%rbp)
jmp 0xfd21
movq -0x5f8(%rbp), %rax
cmpl $0x4034b50, (%rax)      # imm = 0x4034B50
je 0xf429
movq -0x108(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x9, -0x4c(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xf41a
movl -0x4c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x100(%rbp)
jmp 0xfd21
movq -0x5f8(%rbp), %rax
movzwl 0x1a(%rax), %eax
addl $0x1e, %eax
movq -0x5f8(%rbp), %rcx
movzwl 0x1c(%rcx), %ecx
addl %ecx, %eax
cltq
addq -0x160(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
addq -0x590(%rbp), %rax
movq -0x108(%rbp), %rcx
cmpq (%rcx), %rax
jbe 0xf4a0
movq -0x108(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x9, -0x5c(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xf491
movl -0x5c(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x100(%rbp)
jmp 0xfd21
movq -0x108(%rbp), %rax
movq 0x68(%rax), %rax
cmpq $0x0, 0x80(%rax)
je 0xf4fa
movq -0x108(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x80(%rax), %rax
addq -0x160(%rbp), %rax
movq %rax, -0x5c0(%rbp)
movq -0x590(%rbp), %rax
movq %rax, -0x148(%rbp)
movq %rax, -0x138(%rbp)
movq $0x0, -0x150(%rbp)
jmp 0xf5b3
cmpq $0x10000, -0x590(%rbp) # imm = 0x10000
jae 0xf517
movq -0x590(%rbp), %rax
movq %rax, -0x3110(%rbp)
jmp 0xf525
movl $0x10000, %eax          # imm = 0x10000
movq %rax, -0x3110(%rbp)
jmp 0xf525
movq -0x3110(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x108(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x108(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x138(%rbp), %rdx
movl $0x1, %esi
callq *%rax
movq %rax, %rcx
movq %rcx, -0x5c0(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0xf59a
movq -0x108(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x10, -0x6c(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0xf58b
movl -0x6c(%rbp), %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x100(%rbp)
jmp 0xfd21
movq $0x0, -0x148(%rbp)
movq -0x590(%rbp), %rax
movq %rax, -0x150(%rbp)
movl -0x124(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0xf5d1
cmpw $0x0, -0x5a2(%rbp)
jne 0xf862
movq -0x108(%rbp), %rax
movq 0x68(%rax), %rax
cmpq $0x0, 0x80(%rax)
je 0xf6b4
movq -0x118(%rbp), %rax
movq -0x120(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x5c0(%rbp), %rdx
movq -0x590(%rbp), %rcx
callq *%rax
cmpq -0x590(%rbp), %rax
je 0xf647
movq -0x108(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x1f, -0x7c(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0xf63b
movl -0x7c(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xf67a
movl -0x124(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0xf678
movl -0x12c(%rbp), %eax
movl %eax, %edi
movq -0x5c0(%rbp), %rsi
movq -0x590(%rbp), %rdx
callq 0x3910
movl %eax, -0x12c(%rbp)
jmp 0xf67a
movq -0x590(%rbp), %rax
addq -0x160(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x590(%rbp), %rax
addq -0x158(%rbp), %rax
movq %rax, -0x158(%rbp)
movq $0x0, -0x150(%rbp)
jmp 0xf85d
jmp 0xf6b6
cmpq $0x0, -0x150(%rbp)
je 0xf85b
movq -0x138(%rbp), %rax
cmpq -0x150(%rbp), %rax
jae 0xf6e4
movq -0x138(%rbp), %rax
movq %rax, -0x3118(%rbp)
jmp 0xf6f2
movq -0x150(%rbp), %rax
movq %rax, -0x3118(%rbp)
movq -0x3118(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x108(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x108(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x160(%rbp), %rsi
movq -0x5c0(%rbp), %rdx
movq -0x148(%rbp), %rcx
callq *%rax
cmpq -0x148(%rbp), %rax
je 0xf777
movq -0x108(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x14, -0x8c(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0xf768
movl -0x8c(%rbp), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xf85b
movl -0x124(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0xf7a8
movl -0x12c(%rbp), %eax
movl %eax, %edi
movq -0x5c0(%rbp), %rsi
movq -0x148(%rbp), %rdx
callq 0x3910
movl %eax, -0x12c(%rbp)
movq -0x118(%rbp), %rax
movq -0x120(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x5c0(%rbp), %rdx
movq -0x148(%rbp), %rcx
callq *%rax
cmpq -0x148(%rbp), %rax
je 0xf814
movq -0x108(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x1f, -0x9c(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0xf808
movl -0x9c(%rbp), %ecx
movq -0x98(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xf85b
movq -0x148(%rbp), %rax
addq -0x160(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x148(%rbp), %rax
addq -0x158(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x148(%rbp), %rcx
movq -0x150(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x150(%rbp)
jmp 0xf6b6
jmp 0xf85d
jmp 0xfbf2
jmp 0xf864
movl $0x0, -0x30f0(%rbp)
movq -0x108(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x108(%rbp), %rcx
movq 0x40(%rcx), %rdi
movl $0x1, %esi
movl $0x8000, %edx           # imm = 0x8000
callq *%rax
movq %rax, %rcx
movq %rcx, -0x5c8(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0xf8e2
movq -0x108(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x10, -0xac(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0xf8d3
movl -0xac(%rbp), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xfbf0
jmp 0xf8e4
movq -0x5c8(%rbp), %rax
movq -0x158(%rbp), %rcx
andq $0x7fff, %rcx           # imm = 0x7FFF
addq %rcx, %rax
movq %rax, -0x30f8(%rbp)
movq -0x158(%rbp), %rcx
andq $0x7fff, %rcx           # imm = 0x7FFF
movl $0x8000, %eax           # imm = 0x8000
subq %rcx, %rax
movq %rax, -0x3108(%rbp)
cmpq $0x0, -0x148(%rbp)
jne 0xfa32
movq -0x108(%rbp), %rax
movq 0x68(%rax), %rax
cmpq $0x0, 0x80(%rax)
jne 0xfa32
movq -0x138(%rbp), %rax
cmpq -0x150(%rbp), %rax
jae 0xf967
movq -0x138(%rbp), %rax
movq %rax, -0x3120(%rbp)
jmp 0xf975
movq -0x150(%rbp), %rax
movq %rax, -0x3120(%rbp)
movq -0x3120(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x108(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x108(%rbp), %rcx
movq 0x60(%rcx), %rdi
movq -0x160(%rbp), %rsi
movq -0x5c0(%rbp), %rdx
movq -0x148(%rbp), %rcx
callq *%rax
cmpq -0x148(%rbp), %rax
je 0xf9fa
movq -0x108(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x14, -0xbc(%rbp)
cmpq $0x0, -0xb8(%rbp)
je 0xf9eb
movl -0xbc(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xfbee
movq -0x148(%rbp), %rax
addq -0x160(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x148(%rbp), %rcx
movq -0x150(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x150(%rbp)
movq $0x0, -0x140(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x3100(%rbp)
movq -0x5c0(%rbp), %rsi
addq -0x140(%rbp), %rsi
movq -0x5c8(%rbp), %rcx
movq -0x30f8(%rbp), %r8
movq -0x150(%rbp), %rdi
xorl %eax, %eax
movl $0x2, %edx
cmpq $0x0, %rdi
cmovnel %edx, %eax
leaq -0x30f0(%rbp), %rdi
leaq -0x3100(%rbp), %rdx
leaq -0x3108(%rbp), %r9
movl %eax, (%rsp)
callq 0x5060
movl %eax, -0x128(%rbp)
movq -0x3100(%rbp), %rcx
movq -0x148(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x148(%rbp)
movq -0x3100(%rbp), %rax
addq -0x140(%rbp), %rax
movq %rax, -0x140(%rbp)
cmpq $0x0, -0x3108(%rbp)
je 0xfbbd
movq -0x118(%rbp), %rax
movq -0x120(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x30f8(%rbp), %rdx
movq -0x3108(%rbp), %rcx
callq *%rax
cmpq -0x3108(%rbp), %rax
je 0xfb3e
movq -0x108(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl $0x1f, -0xcc(%rbp)
cmpq $0x0, -0xc8(%rbp)
je 0xfb2f
movl -0xcc(%rbp), %ecx
movq -0xc8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xfbee
movl -0x12c(%rbp), %eax
movl %eax, %edi
movq -0x30f8(%rbp), %rsi
movq -0x3108(%rbp), %rdx
callq 0x3910
movl %eax, -0x12c(%rbp)
movq -0x3108(%rbp), %rax
addq -0x158(%rbp), %rax
movq %rax, -0x158(%rbp)
cmpq -0x588(%rbp), %rax
jbe 0xfbbb
movq -0x108(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl $0xb, -0xdc(%rbp)
cmpq $0x0, -0xd8(%rbp)
je 0xfbaf
movl -0xdc(%rbp), %ecx
movq -0xd8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xfbee
jmp 0xfbbd
jmp 0xfbbf
movb $0x1, %al
cmpl $0x1, -0x128(%rbp)
movb %al, -0x3121(%rbp)
je 0xfbe0
cmpl $0x2, -0x128(%rbp)
sete %al
movb %al, -0x3121(%rbp)
movb -0x3121(%rbp), %al
testb $0x1, %al
jne 0xf8e4
jmp 0xfbf0
jmp 0xfbf2
cmpl $0x0, -0x128(%rbp)
jne 0xfcaf
movl -0x124(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0xfcaf
movq -0x158(%rbp), %rax
cmpq -0x588(%rbp), %rax
je 0xfc61
movq -0x108(%rbp), %rax
movq %rax, -0xe8(%rbp)
movl $0xd, -0xec(%rbp)
cmpq $0x0, -0xe8(%rbp)
je 0xfc55
movl -0xec(%rbp), %ecx
movq -0xe8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xfcad
movl -0x12c(%rbp), %eax
cmpl -0x598(%rbp), %eax
je 0xfcab
movq -0x108(%rbp), %rax
movq %rax, -0xf8(%rbp)
movl $0xb, -0xfc(%rbp)
cmpq $0x0, -0xf8(%rbp)
je 0xfca1
movl -0xfc(%rbp), %ecx
movq -0xf8(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0xffffffff, -0x128(%rbp) # imm = 0xFFFFFFFF
jmp 0xfcad
jmp 0xfcaf
movq -0x108(%rbp), %rax
movq 0x68(%rax), %rax
cmpq $0x0, 0x80(%rax)
jne 0xfce3
movq -0x108(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x108(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x5c0(%rbp), %rsi
callq *%rax
cmpq $0x0, -0x5c8(%rbp)
je 0xfd0c
movq -0x108(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x108(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x5c8(%rbp), %rsi
callq *%rax
cmpl $0x0, -0x128(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x100(%rbp)
movl -0x100(%rbp), %eax
addq $0x3130, %rsp           # imm = 0x3130
popq %rbp
retq