// File: /workspace/github_cpp_makefile_star2_O1/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 0xabf8
movq %rdi, %r14
movq 0x68(%rdi), %rax
testq %rax, %rax
je 0xabeb
cmpq $0x0, 0x28(%r14)
je 0xabeb
cmpq $0x0, 0x30(%r14)
je 0xabeb
cmpq $0x0, 0x48(%r14)
je 0xabeb
movl %esi, %r15d
cmpl $0x0, 0x64(%rax)
movl 0x10(%r14), %ecx
je 0xac0c
cmpl $-0x1, %ecx
je 0xac1b
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, 0x8(%rax)
jae 0xac1b
jmp 0xac25
testq %r14, %r14
je 0xabf8
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 0xac1b
cmpl $0x0, 0x4(%r14)
je 0xac25
movl $0x1d, 0x1c(%r14)
jmp 0xabf8
movl $0x1, %ebx
cmpl $0x0, 0x10(%r14)
je 0xabf8
xorl %r12d, %r12d
leaq -0x488(%rbp), %r13
btl $0xc, %r15d
jae 0xac75
movq %r14, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x9372
testl %eax, %eax
je 0xac9d
movq %r14, %rdi
leaq -0x430(%rbp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
leaq -0x2c(%rbp), %r8
callq 0x8ad3
testl %eax, %eax
je 0xac9d
cmpl -0x2c(%rbp), %r12d
jne 0xac95
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0xa34d
testl %eax, %eax
je 0xac9d
incl %r12d
cmpl 0x10(%r14), %r12d
jb 0xac3b
jmp 0xabf8
movl $0x1e, 0x1c(%r14)
xorl %ebx, %ebx
jmp 0xabf8