LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: tinfl_decompress_mem_to_callback
int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
{
    int result = 0;
    tinfl_decompressor decomp;
    mz_uint8 *pDict = (mz_uint8 *)MZ_MALLOC(TINFL_LZ_DICT_SIZE);
    size_t in_buf_ofs = 0, dict_ofs = 0;
    if (!pDict)
        return TINFL_STATUS_FAILED;
    tinfl_init(&decomp);
    for (;;)
    {
        size_t in_buf_size = *pIn_buf_size - in_buf_ofs, dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs;
        tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8 *)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size,
                                               (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)));
        in_buf_ofs += in_buf_size;
        if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user)))
            break;
        if (status != TINFL_STATUS_HAS_MORE_OUTPUT)
        {
            result = (status == TINFL_STATUS_DONE);
            break;
        }
        dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1);
    }
    MZ_FREE(pDict);
    *pIn_buf_size = in_buf_ofs;
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b48, %rsp           # imm = 0x2B48
movl %r8d, %ebx
movq %rcx, -0x60(%rbp)
movq %rdx, -0x58(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdi, -0x68(%rbp)
movl $0x8000, %edi           # imm = 0x8000
callq 0x3320
movq %rax, -0x38(%rbp)
testq %rax, %rax
je 0x7d47
leaq -0x2b60(%rbp), %rax
movl $0x0, (%rax)
andl $-0x7, %ebx
xorl %r15d, %r15d
xorl %r14d, %r14d
movl %ebx, -0x2c(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
subq %r15, %rax
movq %rax, -0x50(%rbp)
movl $0x8000, %eax           # imm = 0x8000
subq %r14, %rax
movq %rax, -0x48(%rbp)
movq -0x68(%rbp), %rax
leaq (%rax,%r15), %rsi
movq -0x38(%rbp), %rcx
leaq (%rcx,%r14), %r12
movl %ebx, (%rsp)
leaq -0x2b60(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r12, %r8
leaq -0x48(%rbp), %r9
callq 0x441a
movl %eax, %ebx
addq -0x50(%rbp), %r15
movq -0x48(%rbp), %r13
testq %r13, %r13
je 0x7d25
movq %r12, %rdi
movl %r13d, %esi
movq -0x60(%rbp), %rdx
callq *-0x58(%rbp)
testl %eax, %eax
je 0x7d4f
cmpl $0x2, %ebx
jne 0x7d3c
addl %r14d, %r13d
andl $0x7fff, %r13d          # imm = 0x7FFF
movq %r13, %r14
movl -0x2c(%rbp), %ebx
jmp 0x7cc1
xorl %r12d, %r12d
testl %ebx, %ebx
sete %r12b
jmp 0x7d52
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x7d62
xorl %r12d, %r12d
movq -0x38(%rbp), %rdi
callq 0x32d0
movq -0x40(%rbp), %rax
movq %r15, (%rax)
movl %r12d, %eax
addq $0x2b48, %rsp           # imm = 0x2B48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: tinfl_decompressor_alloc
tinfl_decompressor *tinfl_decompressor_alloc()
{
    tinfl_decompressor *pDecomp = (tinfl_decompressor *)MZ_MALLOC(sizeof(tinfl_decompressor));
    if (pDecomp)
        tinfl_init(pDecomp);
    return pDecomp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x2af8, %edi           # imm = 0x2AF8
callq 0x3320
testq %rax, %rax
je 0x7d90
movl $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_end_internal(mz_zip_archive*, int)
static mz_bool mz_zip_reader_end_internal(mz_zip_archive *pZip, mz_bool set_last_error)
{
    mz_bool status = MZ_TRUE;

    if (!pZip)
        return MZ_FALSE;

    if ((!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
    {
        if (set_last_error)
            pZip->m_last_error = MZ_ZIP_INVALID_PARAMETER;

        return MZ_FALSE;
    }

    if (pZip->m_pState)
    {
        mz_zip_internal_state *pState = pZip->m_pState;
        pZip->m_pState = NULL;

        mz_zip_array_clear(pZip, &pState->m_central_dir);
        mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
        mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);

#ifndef MINIZ_NO_STDIO
        if (pState->m_pFile)
        {
            if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
            {
                if (MZ_FCLOSE(pState->m_pFile) == EOF)
                {
                    if (set_last_error)
                        pZip->m_last_error = MZ_ZIP_FILE_CLOSE_FAILED;
                    status = MZ_FALSE;
                }
            }
            pState->m_pFile = NULL;
        }
#endif /* #ifndef MINIZ_NO_STDIO */

        pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
    }
    pZip->m_zip_mode = MZ_ZIP_MODE_INVALID;

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x7ebf
movl %esi, %r12d
movq %rdi, %rbx
movq 0x68(%rdi), %r14
testq %r14, %r14
je 0x7eb3
cmpq $0x0, 0x28(%rbx)
je 0x7eb3
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x7eb3
cmpl $0x1, 0x14(%rbx)
jne 0x7eb3
movq $0x0, 0x68(%rbx)
movq 0x40(%rbx), %rdi
movq (%r14), %rsi
callq *%rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq 0x40(%rbx), %rdi
movq 0x20(%r14), %rsi
callq *0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movq 0x40(%rbx), %rdi
movq 0x40(%r14), %rsi
callq *0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movq 0x70(%r14), %rdi
movl $0x1, %r15d
testq %rdi, %rdi
je 0x7ea0
cmpl $0x4, 0x18(%rbx)
jne 0x7e98
callq 0x3250
cmpl $-0x1, %eax
jne 0x7e98
xorl %r15d, %r15d
testl %r12d, %r12d
je 0x7e98
movl $0x15, 0x1c(%rbx)
movq $0x0, 0x70(%r14)
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq *0x30(%rbx)
movl $0x0, 0x14(%rbx)
jmp 0x7ebf
testl %r12d, %r12d
je 0x7ebf
movl $0x18, 0x1c(%rbx)
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_init
mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags)
{
    if ((!pZip) || (!pZip->m_pRead))
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    if (!mz_zip_reader_init_internal(pZip, flags))
        return MZ_FALSE;

    pZip->m_zip_type = MZ_ZIP_TYPE_USER;
    pZip->m_archive_size = size;

    if (!mz_zip_reader_read_central_dir(pZip, flags))
    {
        mz_zip_reader_end_internal(pZip, MZ_FALSE);
        return MZ_FALSE;
    }

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x7f30
movq %rdi, %r14
cmpq $0x0, 0x48(%rdi)
je 0x7f28
movl %edx, %r15d
movq %rsi, %r12
movq %r14, %rdi
movl %edx, %esi
callq 0x7f3b
testl %eax, %eax
je 0x7f30
movl $0x1, 0x18(%r14)
movq %r12, (%r14)
movq %r14, %rdi
movl %r15d, %esi
callq 0x8020
movl $0x1, %ebx
testl %eax, %eax
jne 0x7f30
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
callq 0x7dd1
jmp 0x7f30
movl $0x18, 0x1c(%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_init_internal(mz_zip_archive*, unsigned int)
static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip, mz_uint flags)
{
    (void)flags;
    if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    if (!pZip->m_pAlloc)
        pZip->m_pAlloc = miniz_def_alloc_func;
    if (!pZip->m_pFree)
        pZip->m_pFree = miniz_def_free_func;
    if (!pZip->m_pRealloc)
        pZip->m_pRealloc = miniz_def_realloc_func;

    pZip->m_archive_size = 0;
    pZip->m_central_directory_file_ofs = 0;
    pZip->m_total_files = 0;
    pZip->m_last_error = MZ_ZIP_NO_ERROR;

    if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
        return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);

    memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state));
    MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8));
    MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32));
    MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32));
    pZip->m_pState->m_init_flags = flags;
    pZip->m_pState->m_zip64 = MZ_FALSE;
    pZip->m_pState->m_zip64_has_extended_info_fields = MZ_FALSE;

    pZip->m_zip_mode = MZ_ZIP_MODE_READING;

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x7f64
movq %rdi, %rbx
cmpq $0x0, 0x68(%rdi)
jne 0x7f5d
cmpl $0x0, 0x14(%rbx)
je 0x7f72
movl $0x18, 0x1c(%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r14d
movq 0x28(%rbx), %rax
testq %rax, %rax
jne 0x7f89
leaq -0x47d9(%rip), %rax     # 0x37ac
movq %rax, 0x28(%rbx)
cmpq $0x0, 0x30(%rbx)
jne 0x7f9b
leaq -0x47da(%rip), %rcx     # 0x37bd
movq %rcx, 0x30(%rbx)
cmpq $0x0, 0x38(%rbx)
jne 0x7fad
leaq -0x47df(%rip), %rcx     # 0x37ca
movq %rcx, 0x38(%rbx)
xorl %r15d, %r15d
movl %r15d, 0x1c(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl %r15d, 0x10(%rbx)
movq 0x40(%rbx), %rdi
movl $0x1, %esi
movl $0x98, %edx
callq *%rax
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x8014
movl $0x98, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x3160
movq 0x68(%rbx), %rax
movl $0x1, %r15d
movl %r15d, 0x18(%rax)
movl $0x4, %ecx
movl %ecx, 0x38(%rax)
movl %ecx, 0x58(%rax)
movl %r14d, 0x60(%rax)
movq $0x0, 0x64(%rax)
movl %r15d, 0x14(%rbx)
jmp 0x7f64
movl $0x10, 0x1c(%rbx)
jmp 0x7f64
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_init_mem
mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags)
{
    if (!pMem)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
        return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);

    if (!mz_zip_reader_init_internal(pZip, flags))
        return MZ_FALSE;

    pZip->m_zip_type = MZ_ZIP_TYPE_MEMORY;
    pZip->m_archive_size = size;
    pZip->m_pRead = mz_zip_mem_read_func;
    pZip->m_pIO_opaque = pZip;
    pZip->m_pNeeds_keepalive = NULL;

#ifdef __cplusplus
    pZip->m_pState->m_pMem = const_cast<void *>(pMem);
#else
    pZip->m_pState->m_pMem = (void *)pMem;
#endif

    pZip->m_pState->m_mem_size = size;

    if (!mz_zip_reader_read_central_dir(pZip, flags))
    {
        mz_zip_reader_end_internal(pZip, MZ_FALSE);
        return MZ_FALSE;
    }

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x866b
movq %rdx, %r15
cmpq $0x15, %rdx
ja 0x867c
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x86ea
movl $0x8, 0x1c(%rbx)
jmp 0x86ea
xorl %r14d, %r14d
testq %rbx, %rbx
je 0x86ea
movl $0x18, 0x1c(%rbx)
jmp 0x86ea
movl %ecx, %r14d
movq %rsi, %r12
movq %rbx, %rdi
movl %ecx, %esi
callq 0x7f3b
testl %eax, %eax
je 0x86e7
movl $0x2, 0x18(%rbx)
movq %r15, (%rbx)
leaq 0x55(%rip), %rax        # 0x86f6
movq %rax, 0x48(%rbx)
movq %rbx, 0x60(%rbx)
movq $0x0, 0x58(%rbx)
movq 0x68(%rbx), %rax
movq %r12, 0x80(%rax)
movq %r15, 0x88(%rax)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8020
movl $0x1, %r14d
testl %eax, %eax
jne 0x86ea
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7dd1
jmp 0x86ea
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_init_file_v2
mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size)
{
    mz_uint64 file_size;
    MZ_FILE *pFile;

    if ((!pZip) || (!pFilename) || ((archive_size) && (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    pFile = MZ_FOPEN(pFilename, "rb");
    if (!pFile)
        return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);

    file_size = archive_size;
    if (!file_size)
    {
        if (MZ_FSEEK64(pFile, 0, SEEK_END))
        {
            MZ_FCLOSE(pFile);
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED);
        }

        file_size = MZ_FTELL64(pFile);
    }

    /* TODO: Better sanity check archive_size and the # of actual remaining bytes */

    if (file_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
    {
	MZ_FCLOSE(pFile);
        return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
    }

    if (!mz_zip_reader_init_internal(pZip, flags))
    {
        MZ_FCLOSE(pFile);
        return MZ_FALSE;
    }

    pZip->m_zip_type = MZ_ZIP_TYPE_FILE;
    pZip->m_pRead = mz_zip_file_read_func;
    pZip->m_pIO_opaque = pZip;
    pZip->m_pState->m_pFile = pFile;
    pZip->m_archive_size = file_size;
    pZip->m_pState->m_file_archive_start_ofs = file_start_ofs;

    if (!mz_zip_reader_read_central_dir(pZip, flags))
    {
        mz_zip_reader_end_internal(pZip, MZ_FALSE);
        return MZ_FALSE;
    }

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdi, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x8803
movq %r8, %r13
leaq -0x1(%r8), %rax
cmpq $0x15, %rax
jb 0x8808
movl %edx, %r14d
leaq 0xeab2(%rip), %rax      # 0x17239
movq %rsi, %rdi
movq %rax, %rsi
callq 0x3280
testq %rax, %rax
je 0x8824
testq %r13, %r13
je 0x882d
movq %rax, %r12
movq %rbx, %rdi
movl %r14d, %esi
callq 0x7f3b
testl %eax, %eax
je 0x8857
movl $0x4, 0x18(%rbx)
leaq 0xc5(%rip), %rax        # 0x888d
movq %rax, 0x48(%rbx)
movq %rbx, 0x60(%rbx)
movq 0x68(%rbx), %rax
movq %r12, 0x70(%rax)
movq %r13, (%rbx)
movq %r15, 0x78(%rax)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8020
movl $0x1, %r12d
testl %eax, %eax
jne 0x8812
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7dd1
jmp 0x8812
testq %rbx, %rbx
je 0x880f
movl $0x18, 0x1c(%rbx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x11, 0x1c(%rbx)
jmp 0x880f
xorl %r12d, %r12d
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
movq %rax, %r13
callq 0x33f0
testl %eax, %eax
je 0x8861
movq %r13, %rdi
callq 0x3250
movl $0x16, 0x1c(%rbx)
jmp 0x8812
movq %r12, %rdi
callq 0x3250
jmp 0x880f
movq %r13, %rdi
callq 0x3370
movq %r13, %rcx
movq %rax, %r13
cmpq $0x15, %rax
movq %rcx, %rax
ja 0x87a4
movq %rax, %rdi
callq 0x3250
movl $0x8, 0x1c(%rbx)
jmp 0x8812
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_file_read_func(void*, unsigned long, void*, unsigned long)
static size_t mz_zip_file_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n)
{
    mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
    mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile);

    file_ofs += pZip->m_pState->m_file_archive_start_ofs;

    if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
        return 0;

    return MZ_FREAD(pBuf, 1, n, pZip->m_pState->m_pFile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq 0x68(%rdi), %rax
movq 0x70(%rax), %rdi
callq 0x3370
movq 0x68(%r15), %rcx
addq 0x78(%rcx), %r12
js 0x88d2
cmpq %r12, %rax
je 0x88e1
movq 0x70(%rcx), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x33f0
testl %eax, %eax
je 0x88dd
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x68(%r15), %rcx
movq 0x70(%rcx), %rcx
movl $0x1, %esi
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3360
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_init_cfile
mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags)
{
    mz_uint64 cur_file_ofs;

    if ((!pZip) || (!pFile))
        return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);

    cur_file_ofs = MZ_FTELL64(pFile);

    if (!archive_size)
    {
        if (MZ_FSEEK64(pFile, 0, SEEK_END))
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED);

        archive_size = MZ_FTELL64(pFile) - cur_file_ofs;

        if (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_init_internal(pZip, flags))
        return MZ_FALSE;

    pZip->m_zip_type = MZ_ZIP_TYPE_CFILE;
    pZip->m_pRead = mz_zip_file_read_func;

    pZip->m_pIO_opaque = pZip;
    pZip->m_pState->m_pFile = pFile;
    pZip->m_archive_size = archive_size;
    pZip->m_pState->m_file_archive_start_ofs = cur_file_ofs;

    if (!mz_zip_reader_read_central_dir(pZip, flags))
    {
        mz_zip_reader_end_internal(pZip, MZ_FALSE);
        return MZ_FALSE;
    }

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdi, %rbx
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
je 0x8994
movq %rdx, %r13
movq %rsi, %r15
movq %rsi, %rdi
callq 0x3370
movq %rax, -0x30(%rbp)
testq %r13, %r13
je 0x89a5
movq %rbx, %rdi
movl %r14d, %esi
callq 0x7f3b
testl %eax, %eax
je 0x89c4
movl $0x5, 0x18(%rbx)
leaq -0xc8(%rip), %rax       # 0x888d
movq %rax, 0x48(%rbx)
movq %rbx, 0x60(%rbx)
movq 0x68(%rbx), %rax
movq %r15, 0x70(%rax)
movq %r13, (%rbx)
movq -0x30(%rbp), %rcx
movq %rcx, 0x78(%rax)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8020
movl $0x1, %r12d
testl %eax, %eax
jne 0x89e9
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7dd1
jmp 0x89e9
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x89e9
movl $0x11, 0x1c(%rbx)
jmp 0x89e9
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x33f0
testl %eax, %eax
je 0x89c9
movl $0x16, 0x1c(%rbx)
jmp 0x89e9
xorl %r12d, %r12d
jmp 0x89e9
movq %r15, %rdi
callq 0x3370
movq %rax, %r13
subq -0x30(%rbp), %r13
cmpq $0x15, %r13
ja 0x8938
movl $0x8, 0x1c(%rbx)
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_is_file_encrypted
mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index)
{
    mz_uint m_bit_flag;
    const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
    if (!p)
    {
        mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
        return MZ_FALSE;
    }

    m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
    return (m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION)) != 0;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x8a39
pushq %rbp
movq %rsp, %rbp
movq 0x68(%rdi), %rcx
testq %rcx, %rcx
je 0x8a31
cmpl %esi, 0x10(%rdi)
jbe 0x8a31
movq (%rcx), %rdx
testq %rdx, %rdx
je 0x8a31
movq 0x20(%rcx), %rax
movl %esi, %ecx
movl (%rax,%rcx,4), %ecx
xorl %eax, %eax
testb $0x41, 0x8(%rdx,%rcx)
setne %al
jmp 0x8a38
movl $0x18, 0x1c(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_is_file_a_directory
mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index)
{
    mz_uint filename_len, attribute_mapping_id, external_attr;
    const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
    if (!p)
    {
        mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
        return MZ_FALSE;
    }

    filename_len = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
    if (filename_len)
    {
        if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/')
            return MZ_TRUE;
    }

    /* Bugfix: This code was also checking if the internal attribute was non-zero, which wasn't correct. */
    /* Most/all zip writers (hopefully) set DOS file/directory attributes in the low 16-bits, so check for the DOS directory flag and ignore the source OS ID in the created by field. */
    /* FIXME: Remove this check? Is it necessary - we already check the filename. */
    attribute_mapping_id = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS) >> 8;
    (void)attribute_mapping_id;

    external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS);
    if ((external_attr & MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG) != 0)
    {
        return MZ_TRUE;
    }

    return MZ_FALSE;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x8af5
pushq %rbp
movq %rsp, %rbp
movq 0x68(%rdi), %rdx
testq %rdx, %rdx
je 0x8aed
cmpl %esi, 0x10(%rdi)
jbe 0x8aed
movq (%rdx), %rcx
testq %rcx, %rcx
je 0x8aed
movq 0x20(%rdx), %rax
movl %esi, %edx
movl (%rax,%rdx,4), %eax
addq %rax, %rcx
movzwl 0x1c(%rcx), %edx
testq %rdx, %rdx
je 0x8ae2
movl $0x1, %eax
cmpb $0x2f, 0x2d(%rcx,%rdx)
je 0x8af4
movl 0x26(%rcx), %eax
shrl $0x4, %eax
andl $0x1, %eax
jmp 0x8af4
movl $0x18, 0x1c(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_extract_to_heap
void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags)
{
    mz_uint64 comp_size, uncomp_size, alloc_size;
    const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
    void *pBuf;

    if (pSize)
        *pSize = 0;

    if (!p)
    {
        mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
        return NULL;
    }

    comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
    uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);

    alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? comp_size : uncomp_size;
    if (((sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF))
    {
        mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
        return NULL;
    }

    if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size)))
    {
        mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
        return NULL;
    }

    if (!mz_zip_reader_extract_to_mem(pZip, file_index, pBuf, (size_t)alloc_size, flags))
    {
        pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
        return NULL;
    }

    if (pSize)
        *pSize = (size_t)alloc_size;
    return pBuf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %rbx
testq %rdi, %rdi
je 0x9462
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x9462
cmpl %esi, 0x10(%rbx)
jbe 0x9462
movq 0x20(%rdi), %rax
movl %esi, %edx
movl (%rax,%rdx,4), %eax
addq (%rdi), %rax
jmp 0x9464
xorl %eax, %eax
testq %r14, %r14
je 0x9470
movq $0x0, (%r14)
testq %rax, %rax
je 0x94cd
movl %esi, -0x2c(%rbp)
xorl %edx, %edx
btl $0xa, %ecx
setae %dl
movl 0x14(%rax,%rdx,4), %r15d
movq 0x40(%rbx), %rdi
movl $0x1, %esi
movq %r15, %rdx
movl %ecx, %r12d
callq *0x28(%rbx)
testq %rax, %rax
je 0x94db
movq %rax, %r13
movq $0x0, (%rsp)
movq %rbx, %rdi
movl -0x2c(%rbp), %esi
movq %rax, %rdx
movq %r15, %rcx
movl %r12d, %r8d
xorl %r9d, %r9d
callq 0x8f79
testl %eax, %eax
je 0x94e4
testq %r14, %r14
je 0x94f1
movq %r15, (%r14)
jmp 0x94f1
testq %rbx, %rbx
je 0x94ee
movl $0x18, 0x1c(%rbx)
jmp 0x94ee
movl $0x10, 0x1c(%rbx)
jmp 0x94ee
movq 0x40(%rbx), %rdi
movq %r13, %rsi
callq *0x30(%rbx)
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_extract_file_to_heap
void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags)
{
    mz_uint32 file_index;
    if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
    {
        if (pSize)
            *pSize = 0;
        return MZ_FALSE;
    }
    return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %rbx
movq %rdi, %r15
leaq -0x1c(%rbp), %r8
xorl %edx, %edx
callq 0x8b1a
testl %eax, %eax
je 0x9538
movl -0x1c(%rbp), %esi
movq %r15, %rdi
movq %rbx, %rdx
movl %r14d, %ecx
callq 0x942a
jmp 0x9546
testq %rbx, %rbx
je 0x9544
movq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_extract_iter_free
mz_bool mz_zip_reader_extract_iter_free(mz_zip_reader_extract_iter_state* pState)
{
    int status;

    /* Argument sanity check */
    if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState))
        return MZ_FALSE;

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

    /* Free buffers */
    if (!pState->pZip->m_pState->m_pMem)
        pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState->pRead_buf);
    if (pState->pWrite_buf)
        pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState->pWrite_buf);

    /* Save status */
    status = pState->status;

    /* Free context */
    pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState);

    return status == TINFL_STATUS_DONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %r14d, %r14d
testq %rdi, %rdi
je 0xa0a3
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0xa0a3
movq 0x68(%rax), %rcx
testq %rcx, %rcx
je 0xa0a3
cmpl $0x0, 0xc(%rbx)
jne 0xa05d
testb $0x4, 0x9(%rbx)
jne 0xa05d
movq 0x38(%rbx), %rsi
movl $0xd, %edx
cmpq 0x78(%rbx), %rsi
jne 0xa053
movl 0x10(%rbx), %esi
movl $0xb, %edx
cmpl 0x68(%rbx), %esi
je 0xa05d
movl %edx, 0x1c(%rax)
movl $0xffffffff, 0xc(%rbx)  # imm = 0xFFFFFFFF
cmpq $0x0, 0x80(%rcx)
jne 0xa078
movq 0x40(%rax), %rdi
movq 0x4a0(%rbx), %rsi
callq *0x30(%rax)
movq (%rbx), %rax
movq 0x4a8(%rbx), %rsi
testq %rsi, %rsi
je 0xa08e
movq 0x40(%rax), %rdi
callq *0x30(%rax)
movq (%rbx), %rax
movq 0x40(%rax), %rdi
xorl %r14d, %r14d
cmpl $0x0, 0xc(%rbx)
sete %r14b
movq %rbx, %rsi
callq *0x30(%rax)
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_extract_to_file
mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags)
{
    mz_bool status;
    mz_zip_archive_file_stat file_stat;
    MZ_FILE *pFile;

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

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

    pFile = MZ_FOPEN(pDst_filename, "wb");
    if (!pFile)
        return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);

    status = mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags);

    if (MZ_FCLOSE(pFile) == EOF)
    {
        if (status)
            mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED);

        status = MZ_FALSE;
    }

#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_STDIO)
    if (status)
        mz_zip_set_file_times(pDst_filename, file_stat.m_time, file_stat.m_time);
#endif

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
movl %ecx, %r12d
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %r14
leaq -0x498(%rbp), %rdx
callq 0x9351
xorl %ebx, %ebx
testl %eax, %eax
je 0xa193
cmpl $0x0, -0x44c(%rbp)
jne 0xa15d
cmpl $0x0, -0x444(%rbp)
je 0xa15d
leaq 0xd142(%rip), %rsi      # 0x1723c
movq %r15, -0x30(%rbp)
movq %r15, %rdi
callq 0x3280
testq %rax, %rax
je 0xa16c
movq %rax, %r15
leaq 0x92(%rip), %rdx        # 0xa1a7
movq %r14, %rdi
movl %r13d, %esi
movq %rax, %rcx
movl %r12d, %r8d
callq 0x9551
movl %eax, %r12d
movq %r15, %rdi
callq 0x3250
cmpl $-0x1, %eax
je 0xa17b
testl %r12d, %r12d
je 0xa193
movq -0x480(%rbp), %rax
leaq -0x40(%rbp), %rsi
movq %rax, (%rsi)
movq %rax, 0x8(%rsi)
movq -0x30(%rbp), %rdi
callq 0x3140
movl $0x1, %ebx
jmp 0xa193
testq %r14, %r14
je 0xa193
movl $0x6, 0x1c(%r14)
jmp 0xa193
testq %r14, %r14
je 0xa193
movl $0x11, 0x1c(%r14)
jmp 0xa193
testl %r12d, %r12d
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0xa193
movl $0x15, 0x1c(%r14)
movl %ebx, %eax
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_reader_extract_to_cfile
mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, MZ_FILE *pFile, mz_uint flags)
{
    mz_zip_archive_file_stat file_stat;

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

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

    return mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x460, %rsp            # imm = 0x460
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r15
leaq -0x478(%rbp), %rdx
callq 0x9351
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0xa278
cmpl $0x0, -0x42c(%rbp)
jne 0xa26b
cmpl $0x0, -0x424(%rbp)
je 0xa26b
leaq -0xb1(%rip), %rdx       # 0xa1a7
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rcx
movl %ebx, %r8d
callq 0x9551
jmp 0xa278
testq %r15, %r15
je 0xa278
movl $0x6, 0x1c(%r15)
addq $0x460, %rsp            # imm = 0x460
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_validate_archive
mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags)
{
    mz_zip_internal_state *pState;
    uint32_t i;

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

    pState = pZip->m_pState;

    /* Basic sanity checks */
    if (!pState->m_zip64)
    {
        if (pZip->m_total_files > MZ_UINT16_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);

        if (pZip->m_archive_size > MZ_UINT32_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
    }
    else
    {
        if (pZip->m_total_files >= MZ_UINT32_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);

        if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
    }

    for (i = 0; i < pZip->m_total_files; i++)
    {
        if (MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG & flags)
        {
            mz_uint32 found_index;
            mz_zip_archive_file_stat stat;

            if (!mz_zip_reader_file_stat(pZip, i, &stat))
                return MZ_FALSE;

            if (!mz_zip_reader_locate_file_v2(pZip, stat.m_filename, NULL, 0, &found_index))
                return MZ_FALSE;

            /* This check can fail if there are duplicate filenames in the archive (which we don't check for when writing - that's up to the user) */
            if (found_index != i)
                return mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
        }

        if (!mz_zip_validate_file(pZip, i, flags))
            return MZ_FALSE;
    }

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
xorl %ebx, %ebx
testq %rdi, %rdi
je 0xaaef
movq %rdi, %r14
movq 0x68(%rdi), %rax
testq %rax, %rax
je 0xaae7
cmpq $0x0, 0x28(%r14)
je 0xaae7
cmpq $0x0, 0x30(%r14)
je 0xaae7
cmpq $0x0, 0x48(%r14)
je 0xaae7
movl %esi, %r15d
cmpl $0x0, 0x64(%rax)
movl 0x10(%r14), %ecx
je 0xab03
cmpl $-0x1, %ecx
je 0xab12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, 0x8(%rax)
jae 0xab12
jmp 0xab1c
movl $0x18, 0x1c(%r14)
movl %ebx, %eax
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x10000, %ecx          # imm = 0x10000
jae 0xab12
cmpl $0x0, 0x4(%r14)
je 0xab1c
movl $0x1d, 0x1c(%r14)
jmp 0xaaef
movl $0x1, %ebx
testl %ecx, %ecx
je 0xaaef
xorl %r12d, %r12d
leaq -0x488(%rbp), %r13
btl $0xc, %r15d
jae 0xab69
movq %r14, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x9351
testl %eax, %eax
je 0xab91
movq %r14, %rdi
leaq -0x430(%rbp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq -0x2c(%rbp), %r8
callq 0x8b1a
testl %eax, %eax
je 0xab91
cmpl -0x2c(%rbp), %r12d
jne 0xab89
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0xa2d4
testl %eax, %eax
je 0xab91
incl %r12d
cmpl 0x10(%r14), %r12d
jb 0xab2f
jmp 0xaaef
movl $0x1e, 0x1c(%r14)
xorl %ebx, %ebx
jmp 0xaaef
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_validate_mem_archive
mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr)
{
    mz_bool success = MZ_TRUE;
    mz_zip_archive zip;
    mz_zip_error actual_err = MZ_ZIP_NO_ERROR;

    if ((!pMem) || (!size))
    {
        if (pErr)
            *pErr = MZ_ZIP_INVALID_PARAMETER;
        return MZ_FALSE;
    }

    mz_zip_zero_struct(&zip);

    if (!mz_zip_reader_init_mem(&zip, pMem, size, flags))
    {
        if (pErr)
            *pErr = zip.m_last_error;
        return MZ_FALSE;
    }

    if (!mz_zip_validate_archive(&zip, flags))
    {
        actual_err = zip.m_last_error;
        success = MZ_FALSE;
    }

    if (!mz_zip_reader_end_internal(&zip, success))
    {
        if (!actual_err)
            actual_err = zip.m_last_error;
        success = MZ_FALSE;
    }

    if (pErr)
        *pErr = actual_err;

    return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movq %rsi, %rdx
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
je 0xac2a
movq %rdi, %rsi
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, 0x60(%rdi)
movaps %xmm0, 0x50(%rdi)
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movl %r14d, %ecx
callq 0x863a
testl %eax, %eax
je 0xac3a
leaq -0x90(%rbp), %rdi
movl %r14d, %esi
callq 0xaa8c
testl %eax, %eax
je 0xac48
leaq -0x90(%rbp), %r15
movl $0x1, %r14d
movq %r15, %rdi
movl $0x1, %esi
callq 0x7dd1
xorl %r12d, %r12d
movl 0x1c(%r15), %ecx
jmp 0xac68
movl $0x18, %r12d
xorl %r14d, %r14d
testq %rbx, %rbx
jne 0xac79
jmp 0xac7c
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xac7c
movl -0x74(%rbp), %r12d
jmp 0xac79
leaq -0x90(%rbp), %rdi
movl 0x1c(%rdi), %r12d
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x7dd1
movl %r12d, %ecx
testl %r12d, %r12d
jne 0xac68
movl -0x74(%rbp), %ecx
testl %eax, %eax
cmovel %eax, %r14d
testq %rbx, %rbx
je 0xac7c
testl %eax, %eax
cmovel %ecx, %r12d
movl %r12d, (%rbx)
movl %r14d, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_validate_file_archive
mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr)
{
    mz_bool success = MZ_TRUE;
    mz_zip_archive zip;
    mz_zip_error actual_err = MZ_ZIP_NO_ERROR;

    if (!pFilename)
    {
        if (pErr)
            *pErr = MZ_ZIP_INVALID_PARAMETER;
        return MZ_FALSE;
    }

    mz_zip_zero_struct(&zip);

    if (!mz_zip_reader_init_file_v2(&zip, pFilename, flags, 0, 0))
    {
        if (pErr)
            *pErr = zip.m_last_error;
        return MZ_FALSE;
    }

    if (!mz_zip_validate_archive(&zip, flags))
    {
        actual_err = zip.m_last_error;
        success = MZ_FALSE;
    }

    if (!mz_zip_reader_end_internal(&zip, success))
    {
        if (!actual_err)
            actual_err = zip.m_last_error;
        success = MZ_FALSE;
    }

    if (pErr)
        *pErr = actual_err;

    return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdx, %rbx
testq %rdi, %rdi
je 0xad18
movl %esi, %r15d
movq %rdi, %rsi
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, 0x60(%rdi)
movaps %xmm0, 0x50(%rdi)
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %r14d, %r14d
movl %r15d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x8744
testl %eax, %eax
je 0xad28
leaq -0x90(%rbp), %rdi
movl %r15d, %esi
callq 0xaa8c
testl %eax, %eax
je 0xad36
leaq -0x90(%rbp), %r15
movl $0x1, %r14d
movq %r15, %rdi
movl $0x1, %esi
callq 0x7dd1
xorl %r12d, %r12d
movl 0x1c(%r15), %ecx
jmp 0xad56
movl $0x18, %r12d
xorl %r14d, %r14d
testq %rbx, %rbx
jne 0xad67
jmp 0xad6a
testq %rbx, %rbx
je 0xad6a
xorl %r14d, %r14d
movl -0x74(%rbp), %r12d
jmp 0xad67
leaq -0x90(%rbp), %rdi
movl 0x1c(%rdi), %r12d
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x7dd1
movl %r12d, %ecx
testl %r12d, %r12d
jne 0xad56
movl -0x74(%rbp), %ecx
testl %eax, %eax
cmovel %eax, %r14d
testq %rbx, %rbx
je 0xad6a
testl %eax, %eax
cmovel %ecx, %r12d
movl %r12d, (%rbx)
movl %r14d, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_writer_init_heap_v2
mz_bool mz_zip_writer_init_heap_v2(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size, mz_uint flags)
{
    pZip->m_pWrite = mz_zip_heap_write_func;
    pZip->m_pNeeds_keepalive = NULL;

    if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
        pZip->m_pRead = mz_zip_mem_read_func;

    pZip->m_pIO_opaque = pZip;

    if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
        return MZ_FALSE;

    pZip->m_zip_type = MZ_ZIP_TYPE_HEAP;

    if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning)))
    {
        if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size)))
        {
            mz_zip_writer_end_internal(pZip, MZ_FALSE);
            return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
        }
        pZip->m_pState->m_mem_capacity = initial_allocation_size;
    }

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x99(%rip), %rax        # 0xaf51
movq %rax, 0x50(%rdi)
movq $0x0, 0x58(%rdi)
testw %cx, %cx
jns 0xaed4
leaq -0x27da(%rip), %rax     # 0x86f6
movq %rax, 0x48(%rbx)
movq %rbx, 0x60(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl %ecx, %edx
callq 0xad7a
testl %eax, %eax
je 0xaf2a
cmpq %r14, %r15
cmovaq %r15, %r14
movl $0x3, 0x18(%rbx)
movl $0x1, %r15d
testq %r14, %r14
je 0xaf43
movq 0x40(%rbx), %rdi
movl $0x1, %esi
movq %r14, %rdx
callq *0x28(%rbx)
movq 0x68(%rbx), %rcx
movq %rax, 0x80(%rcx)
testq %rax, %rax
je 0xaf2f
movq %r14, 0x90(%rcx)
jmp 0xaf43
xorl %r15d, %r15d
jmp 0xaf43
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xb027
movl $0x10, 0x1c(%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_heap_write_func(void*, unsigned long, void const*, unsigned long)
static size_t mz_zip_heap_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n)
{
    mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
    mz_zip_internal_state *pState = pZip->m_pState;
    mz_uint64 new_size = MZ_MAX(file_ofs + n, pState->m_mem_size);

    if (!n)
        return 0;

    /* An allocation this big is likely to just fail on 32-bit systems, so don't even go there. */
    if ((sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF))
    {
        mz_zip_set_error(pZip, MZ_ZIP_FILE_TOO_LARGE);
        return 0;
    }

    if (new_size > pState->m_mem_capacity)
    {
        void *pNew_block;
        size_t new_capacity = MZ_MAX(64, pState->m_mem_capacity);

        while (new_capacity < new_size)
            new_capacity *= 2;

        if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity)))
        {
            mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
            return 0;
        }

        pState->m_pMem = pNew_block;
        pState->m_mem_capacity = new_capacity;
    }
    memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n);
    pState->m_mem_size = (size_t)new_size;
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x68(%rdi), %r14
leaq (%rcx,%rsi), %rax
movq 0x88(%r14), %r15
cmpq %r15, %rax
cmovaq %rax, %r15
testq %rcx, %rcx
je 0xb013
movq %rcx, %rbx
movq 0x90(%r14), %rcx
cmpq %rcx, %r15
jbe 0xafec
movq %rdi, %r12
movq %rsi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
cmpq $0x41, %rcx
movl $0x40, %eax
cmovaeq %rcx, %rax
movq %rax, %r13
addq %rax, %rax
cmpq %r15, %r13
jb 0xafa8
movq 0x40(%r12), %rdi
movq 0x80(%r14), %rsi
movl $0x1, %edx
movq %r13, %rcx
callq *0x38(%r12)
testq %rax, %rax
je 0xb00a
movq %rax, %rdi
movq %rax, 0x80(%r14)
movq %r13, 0x90(%r14)
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rsi
jmp 0xaff3
movq 0x80(%r14), %rdi
addq %rsi, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x31e0
movq %r15, 0x88(%r14)
jmp 0xb015
movl $0x10, 0x1c(%r12)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_writer_end_internal(mz_zip_archive*, int)
static mz_bool mz_zip_writer_end_internal(mz_zip_archive *pZip, mz_bool set_last_error)
{
    mz_zip_internal_state *pState;
    mz_bool status = MZ_TRUE;

    if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
    {
        if (set_last_error)
            mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
        return MZ_FALSE;
    }

    pState = pZip->m_pState;
    pZip->m_pState = NULL;
    mz_zip_array_clear(pZip, &pState->m_central_dir);
    mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
    mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);

#ifndef MINIZ_NO_STDIO
    if (pState->m_pFile)
    {
        if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
        {
            if (MZ_FCLOSE(pState->m_pFile) == EOF)
            {
                if (set_last_error)
                    mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED);
                status = MZ_FALSE;
            }
        }

        pState->m_pFile = NULL;
    }
#endif /* #ifndef MINIZ_NO_STDIO */

    if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem))
    {
        pZip->m_pFree(pZip->m_pAlloc_opaque, pState->m_pMem);
        pState->m_pMem = NULL;
    }

    pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
    pZip->m_zip_mode = MZ_ZIP_MODE_INVALID;
    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %r15d, %r15d
testq %rdi, %rdi
je 0xb145
movl %esi, %r12d
movq %rdi, %rbx
movq 0x68(%rdi), %r14
testq %r14, %r14
je 0xb139
cmpq $0x0, 0x28(%rbx)
je 0xb139
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0xb139
movl 0x14(%rbx), %ecx
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0xb139
movq $0x0, 0x68(%rbx)
movq 0x40(%rbx), %rdi
movq (%r14), %rsi
callq *%rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq 0x40(%rbx), %rdi
movq 0x20(%r14), %rsi
callq *0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movq 0x40(%rbx), %rdi
movq 0x40(%r14), %rsi
callq *0x30(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movq 0x70(%r14), %rdi
movl $0x1, %r15d
testq %rdi, %rdi
je 0xb0fb
cmpl $0x4, 0x18(%rbx)
jne 0xb0f3
callq 0x3250
cmpl $-0x1, %eax
jne 0xb0f3
xorl %r15d, %r15d
testl %r12d, %r12d
je 0xb0f3
movl $0x15, 0x1c(%rbx)
movq $0x0, 0x70(%r14)
leaq -0x1b1(%rip), %rax      # 0xaf51
cmpq %rax, 0x50(%rbx)
jne 0xb126
movq 0x80(%r14), %rsi
testq %rsi, %rsi
je 0xb126
movq 0x40(%rbx), %rdi
callq *0x30(%rbx)
movq $0x0, 0x80(%r14)
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq *0x30(%rbx)
movl $0x0, 0x14(%rbx)
jmp 0xb145
testl %r12d, %r12d
je 0xb145
movl $0x18, 0x1c(%rbx)
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_writer_init_file_v2
mz_bool mz_zip_writer_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags)
{
    MZ_FILE *pFile;

    pZip->m_pWrite = mz_zip_file_write_func;
    pZip->m_pNeeds_keepalive = NULL;

    if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
        pZip->m_pRead = mz_zip_file_read_func;

    pZip->m_pIO_opaque = pZip;

    if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
        return MZ_FALSE;

    if (NULL == (pFile = MZ_FOPEN(pFilename, (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) ? "w+b" : "wb")))
    {
        mz_zip_writer_end(pZip);
        return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);
    }

    pZip->m_pState->m_pFile = pFile;
    pZip->m_zip_type = MZ_ZIP_TYPE_FILE;

    if (size_to_reserve_at_beginning)
    {
        mz_uint64 cur_ofs = 0;
        char buf[4096];

        MZ_CLEAR_OBJ(buf);

        do
        {
            size_t n = (size_t)MZ_MIN(sizeof(buf), size_to_reserve_at_beginning);
            if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_ofs, buf, n) != n)
            {
                mz_zip_writer_end(pZip);
                return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
            }
            cur_ofs += n;
            size_to_reserve_at_beginning -= n;
        } while (size_to_reserve_at_beginning);
    }

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x109(%rip), %rax       # 0xb299
movq %rax, 0x50(%rdi)
movq $0x0, 0x58(%rdi)
testw %r13w, %r13w
jns 0xb1ad
leaq -0x291c(%rip), %rax     # 0x888d
movq %rax, 0x48(%rbx)
movq %rbx, 0x60(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl %r13d, %edx
callq 0xad7a
xorl %r15d, %r15d
testl %eax, %eax
je 0xb284
testw %r13w, %r13w
leaq 0xc067(%rip), %rax      # 0x1723c
leaq 0xc063(%rip), %rsi      # 0x1723f
cmovnsq %rax, %rsi
movq %r12, %rdi
callq 0x3280
testq %rax, %rax
je 0xb257
movq 0x68(%rbx), %rcx
movq %rax, 0x70(%rcx)
movl $0x4, 0x18(%rbx)
movl $0x1, %r15d
testq %r14, %r14
je 0xb284
leaq -0x1030(%rbp), %r12
xorl %r13d, %r13d
movl $0x1000, %edx           # imm = 0x1000
movq %r12, %rdi
xorl %esi, %esi
callq 0x3160
movl $0x1000, %eax           # imm = 0x1000
cmpq %rax, %r14
movl $0x1000, %r15d          # imm = 0x1000
cmovbq %r14, %r15
movq 0x60(%rbx), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq *0x50(%rbx)
cmpq %r15, %rax
jne 0xb26d
addq %r15, %r13
subq %r15, %r14
jne 0xb220
movl $0x1, %r15d
jmp 0xb284
movq %rbx, %rdi
movl $0x1, %esi
callq 0xb027
movl $0x11, 0x1c(%rbx)
jmp 0xb284
movq %rbx, %rdi
movl $0x1, %esi
callq 0xb027
movl $0x13, 0x1c(%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq