// File: jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_writer_create_central_dir_header(mz_zip_archive*, unsigned char*, unsigned short, unsigned short, unsigned short, unsigned long, unsigned long, unsigned int, unsigned short, unsigned short, unsigned short, unsigned short, unsigned long, unsigned int)
static mz_bool mz_zip_writer_create_central_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst,
                                                       mz_uint16 filename_size, mz_uint16 extra_size, mz_uint16 comment_size,
                                                       mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32,
                                                       mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date,
                                                       mz_uint64 local_header_ofs, mz_uint32 ext_attributes)
{
    (void)pZip;
    memset(pDst, 0, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE);
    MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_SIG_OFS, MZ_ZIP_CENTRAL_DIR_HEADER_SIG);
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0);
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_BIT_FLAG_OFS, bit_flags);
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_METHOD_OFS, method);
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_TIME_OFS, dos_time);
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_DATE_OFS, dos_date);
    MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_CRC32_OFS, uncomp_crc32);
    MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
    MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILENAME_LEN_OFS, filename_size);
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_EXTRA_LEN_OFS, extra_size);
    MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_COMMENT_LEN_OFS, comment_size);
    MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS, ext_attributes);
    MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_MIN(local_header_ofs, MZ_UINT32_MAX));
    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movw %r8w, %ax
movl 0x48(%rbp), %r8d
movq 0x40(%rbp), %r8
movw 0x38(%rbp), %r8w
movw 0x30(%rbp), %r8w
movw 0x28(%rbp), %r8w
movw 0x20(%rbp), %r8w
movl 0x18(%rbp), %r8d
movq 0x10(%rbp), %r8
movq %rdi, -0xe8(%rbp)
movq %rsi, -0xf0(%rbp)
movw %dx, -0xf2(%rbp)
movw %cx, -0xf4(%rbp)
movw %ax, -0xf6(%rbp)
movq %r9, -0x100(%rbp)
movq -0xf0(%rbp), %rdi
xorl %esi, %esi
movl $0x2e, %edx
callq 0x3190
movq -0xf0(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x2014b50, -0x8c(%rbp) # imm = 0x2014B50
movl -0x8c(%rbp), %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movb %cl, (%rax)
movl -0x8c(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x8c(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x8c(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0xf0(%rbp), %rcx
addq $0x6, %rcx
movw 0x20(%rbp), %si
xorl %eax, %eax
movl $0x14, %edx
cmpw $0x0, %si
cmovnel %edx, %eax
movq %rcx, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movw -0xa(%rbp), %ax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movzwl -0xa(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0x8, %rcx
movw 0x28(%rbp), %ax
movq %rcx, -0x18(%rbp)
movw %ax, -0x1a(%rbp)
movw -0x1a(%rbp), %ax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movzwl -0x1a(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0xa, %rcx
movw 0x20(%rbp), %ax
movq %rcx, -0x28(%rbp)
movw %ax, -0x2a(%rbp)
movw -0x2a(%rbp), %ax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movzwl -0x2a(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0xc, %rcx
movw 0x30(%rbp), %ax
movq %rcx, -0x38(%rbp)
movw %ax, -0x3a(%rbp)
movw -0x3a(%rbp), %ax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movzwl -0x3a(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0xe, %rcx
movw 0x38(%rbp), %ax
movq %rcx, -0x48(%rbp)
movw %ax, -0x4a(%rbp)
movw -0x4a(%rbp), %ax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, (%rax)
movzwl -0x4a(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0x10, %rcx
movl 0x18(%rbp), %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movb %al, %cl
movq -0x98(%rbp), %rax
movb %cl, (%rax)
movl -0x9c(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x98(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x9c(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x98(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x9c(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x98(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0xf0(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x108(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, 0x10(%rbp)
jae 0x205ba
movq 0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0x205c8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x110(%rbp)
jmp 0x205c8
movq -0x108(%rbp), %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, (%rax)
movl -0xac(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0xac(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0xac(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0xa8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0xf0(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x118(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x100(%rbp)
jae 0x20663
movq -0x100(%rbp), %rax
movq %rax, -0x120(%rbp)
jmp 0x20671
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x120(%rbp)
jmp 0x20671
movq -0x118(%rbp), %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movb %al, %cl
movq -0xb8(%rbp), %rax
movb %cl, (%rax)
movl -0xbc(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0xb8(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0xbc(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0xb8(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0xbc(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0xb8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0xf0(%rbp), %rcx
addq $0x1c, %rcx
movw -0xf2(%rbp), %ax
movq %rcx, -0x58(%rbp)
movw %ax, -0x5a(%rbp)
movw -0x5a(%rbp), %ax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
movzwl -0x5a(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0x1e, %rcx
movw -0xf4(%rbp), %ax
movq %rcx, -0x68(%rbp)
movw %ax, -0x6a(%rbp)
movw -0x6a(%rbp), %ax
movb %al, %cl
movq -0x68(%rbp), %rax
movb %cl, (%rax)
movzwl -0x6a(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0x20, %rcx
movw -0xf6(%rbp), %ax
movq %rcx, -0x78(%rbp)
movw %ax, -0x7a(%rbp)
movw -0x7a(%rbp), %ax
movb %al, %cl
movq -0x78(%rbp), %rax
movb %cl, (%rax)
movzwl -0x7a(%rbp), %eax
sarl $0x8, %eax
movb %al, %cl
movq -0x78(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0xf0(%rbp), %rcx
addq $0x26, %rcx
movl 0x48(%rbp), %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
movb %al, %cl
movq -0xc8(%rbp), %rax
movb %cl, (%rax)
movl -0xcc(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0xc8(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0xcc(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0xc8(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0xcc(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0xc8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0xf0(%rbp), %rax
addq $0x2a, %rax
movq %rax, -0x128(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, 0x40(%rbp)
jae 0x20813
movq 0x40(%rbp), %rax
movq %rax, -0x130(%rbp)
jmp 0x20821
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x130(%rbp)
jmp 0x20821
movq -0x128(%rbp), %rcx
movq -0x130(%rbp), %rax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %eax
movb %al, %cl
movq -0xd8(%rbp), %rax
movb %cl, (%rax)
movl -0xdc(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0xd8(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0xdc(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0xd8(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0xdc(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0xd8(%rbp), %rax
movb %cl, 0x3(%rax)
movl $0x1, %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw (%rax,%rax)