// File: /workspace/github_cpp_makefile_star2_O3/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_writer_add_cfile
mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add, const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
                                const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
{
    mz_uint16 gen_flags = MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
    mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes;
    mz_uint16 method = 0, dos_time = 0, dos_date = 0, ext_attributes = 0;
    mz_uint64 local_dir_header_ofs, cur_archive_file_ofs = pZip->m_archive_size, uncomp_size = size_to_add, comp_size = 0;
    size_t archive_name_size;
    mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
    mz_uint8 *pExtra_data = NULL;
    mz_uint32 extra_size = 0;
    mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
    mz_zip_internal_state *pState;

    if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
        gen_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;

    if ((int)level_and_flags < 0)
        level_and_flags = MZ_DEFAULT_LEVEL;
    level = level_and_flags & 0xF;

    /* Sanity checks */
    if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    pState = pZip->m_pState;

    if ((!pState->m_zip64) && (uncomp_size > MZ_UINT32_MAX))
    {
        /* Source file is too large for non-zip64 */
        /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
        pState->m_zip64 = MZ_TRUE;
    }

    /* We could support this, but why? */
    if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);

    if (!mz_zip_writer_validate_archive_name(pArchive_name))
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);

    if (pState->m_zip64)
    {
        if (pZip->m_total_files == MZ_UINT32_MAX)
            return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
    }
    else
    {
        if (pZip->m_total_files == MZ_UINT16_MAX)
        {
            pState->m_zip64 = MZ_TRUE;
            /*return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); */
        }
    }

    archive_name_size = strlen(pArchive_name);
    if (archive_name_size > MZ_UINT16_MAX)
        return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);

    num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);

    /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */
    if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX)
        return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);

    if (!pState->m_zip64)
    {
        /* Bail early if the archive would obviously become too large */
        if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE 
			+ archive_name_size + comment_size + user_extra_data_len + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 1024
			+ MZ_ZIP_DATA_DESCRIPTER_SIZE32 + user_extra_data_central_len) > 0xFFFFFFFF)
        {
            pState->m_zip64 = MZ_TRUE;
            /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
        }
    }

#ifndef MINIZ_NO_TIME
    if (pFile_time)
    {
        mz_zip_time_t_to_dos_time(*pFile_time, &dos_time, &dos_date);
    }
#endif

    if (uncomp_size <= 3)
        level = 0;

    if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
    {
        return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
    }

    cur_archive_file_ofs += num_alignment_padding_bytes;
    local_dir_header_ofs = cur_archive_file_ofs;

    if (pZip->m_file_offset_alignment)
    {
        MZ_ASSERT((cur_archive_file_ofs & (pZip->m_file_offset_alignment - 1)) == 0);
    }

    if (uncomp_size && level)
    {
        method = MZ_DEFLATED;
    }

    MZ_CLEAR_OBJ(local_dir_header);
    if (pState->m_zip64)
    {
        if (uncomp_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
        {
            pExtra_data = extra_data;
            extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
                                                               (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
        }

        if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, extra_size + user_extra_data_len, 0, 0, 0, method, gen_flags, dos_time, dos_date))
            return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);

        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);

        cur_archive_file_ofs += sizeof(local_dir_header);

        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
        {
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
        }

        cur_archive_file_ofs += archive_name_size;

        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);

        cur_archive_file_ofs += extra_size;
    }
    else
    {
        if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX))
            return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
        if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, user_extra_data_len, 0, 0, 0, method, gen_flags, dos_time, dos_date))
            return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);

        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);

        cur_archive_file_ofs += sizeof(local_dir_header);

        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
        {
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
        }

        cur_archive_file_ofs += archive_name_size;
    }

    if (user_extra_data_len > 0)
    {
        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len)
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);

        cur_archive_file_ofs += user_extra_data_len;
    }

    if (uncomp_size)
    {
        mz_uint64 uncomp_remaining = uncomp_size;
        void *pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, MZ_ZIP_MAX_IO_BUF_SIZE);
        if (!pRead_buf)
        {
            return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
        }

        if (!level)
        {
            while (uncomp_remaining)
            {
                mz_uint n = (mz_uint)MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, uncomp_remaining);
                if ((MZ_FREAD(pRead_buf, 1, n, pSrc_file) != n) || (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n))
                {
                    pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
                    return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
                }
                uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n);
                uncomp_remaining -= n;
                cur_archive_file_ofs += n;
            }
            comp_size = uncomp_size;
        }
        else
        {
            mz_bool result = MZ_FALSE;
            mz_zip_writer_add_state state;
            tdefl_compressor *pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor));
            if (!pComp)
            {
                pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
                return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
            }

            state.m_pZip = pZip;
            state.m_cur_archive_file_ofs = cur_archive_file_ofs;
            state.m_comp_size = 0;

            if (tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY)
            {
                pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
                pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
                return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
            }

            for (;;)
            {
                size_t in_buf_size = (mz_uint32)MZ_MIN(uncomp_remaining, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE);
                tdefl_status status;
                tdefl_flush flush = TDEFL_NO_FLUSH;

                if (MZ_FREAD(pRead_buf, 1, in_buf_size, pSrc_file) != in_buf_size)
                {
                    mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
                    break;
                }

                uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, in_buf_size);
                uncomp_remaining -= in_buf_size;

                if (pZip->m_pNeeds_keepalive != NULL && pZip->m_pNeeds_keepalive(pZip->m_pIO_opaque))
                    flush = TDEFL_FULL_FLUSH;

                status = tdefl_compress_buffer(pComp, pRead_buf, in_buf_size, uncomp_remaining ? flush : TDEFL_FINISH);
                if (status == TDEFL_STATUS_DONE)
                {
                    result = MZ_TRUE;
                    break;
                }
                else if (status != TDEFL_STATUS_OKAY)
                {
                    mz_zip_set_error(pZip, MZ_ZIP_COMPRESSION_FAILED);
                    break;
                }
            }

            pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);

            if (!result)
            {
                pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
                return MZ_FALSE;
            }

            comp_size = state.m_comp_size;
            cur_archive_file_ofs = state.m_cur_archive_file_ofs;
        }

        pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
    }

    {
        mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64];
        mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32;

        MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID);
        MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32);
        if (pExtra_data == NULL)
        {
            if (comp_size > MZ_UINT32_MAX)
                return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);

            MZ_WRITE_LE32(local_dir_footer + 8, comp_size);
            MZ_WRITE_LE32(local_dir_footer + 12, uncomp_size);
        }
        else
        {
            MZ_WRITE_LE64(local_dir_footer + 8, comp_size);
            MZ_WRITE_LE64(local_dir_footer + 16, uncomp_size);
            local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE64;
        }

        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size)
            return MZ_FALSE;

        cur_archive_file_ofs += local_dir_footer_size;
    }

    if (pExtra_data != NULL)
    {
        extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
                                                           (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
    }

    if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, pExtra_data, extra_size, pComment, comment_size,
                                          uncomp_size, comp_size, uncomp_crc32, method, gen_flags, dos_time, dos_date, local_dir_header_ofs, ext_attributes,
                                          user_extra_data_central, user_extra_data_central_len))
        return MZ_FALSE;

    pZip->m_total_files++;
    pZip->m_archive_size = cur_archive_file_ofs;

    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r8, -0x48(%rbp)
movq %rcx, %r12
movq %rdi, %rbx
movl 0x18(%rbp), %eax
xorl %r13d, %r13d
movw %r13w, -0x34(%rbp)
movw %r13w, -0x32(%rbp)
movq (%rdi), %r11
movq %rcx, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
xorl %r10d, %r10d
btl $0x10, %eax
setae %cl
testl %eax, %eax
movl $0x6, %r14d
cmovnsl %eax, %r14d
movq 0x68(%rdi), %r15
testq %r15, %r15
je 0xc6b5
testq %rsi, %rsi
je 0xc6b5
cmpl $0x2, 0x14(%rbx)
jne 0xc6b5
movl %r14d, %r8d
andl $0xf, %r8d
cmpw $0x0, 0x10(%rbp)
sete %al
testq %r9, %r9
setne %dil
orb %al, %dil
cmpl $0xb, %r8d
setb %al
testb %al, %dil
jne 0xc6d1
movl $0x18, 0x1c(%rbx)
movl %r13d, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r8d, -0x30(%rbp)
movq %rdx, -0xf0(%rbp)
movl 0x64(%r15), %eax
testl %eax, %eax
setne %r8b
movq %r12, %rdi
shrq $0x20, %rdi
sete %dil
orb %r8b, %dil
jne 0xc703
movl $0x1, 0x64(%r15)
movl $0x1, %eax
btl $0xa, %r14d
jb 0xc740
movb (%rsi), %dl
cmpb $0x2f, %dl
je 0xc7b4
movb %cl, %r10b
shll $0xb, %r10d
orl $0x8, %r10d
leaq -0x71(%rbp), %rdi
leaq 0x1(%rsi), %rcx
testb %dl, %dl
je 0xc750
movzbl %dl, %edx
cmpl $0x3a, %edx
je 0xc749
cmpl $0x5c, %edx
je 0xc749
movb (%rcx), %dl
incq %rcx
jmp 0xc728
movl $0x18, 0x1c(%rbx)
jmp 0xc7bb
testq %rbx, %rbx
jne 0xc7b4
jmp 0xc7bb
movl 0x10(%rbx), %ecx
testl %eax, %eax
je 0xc771
xorl %r13d, %r13d
movl $0x0, %r14d
cmpl $-0x1, %ecx
jne 0xc787
movl $0x2, 0x1c(%rbx)
jmp 0xc6bc
movb $0x1, %r14b
cmpl $0xffff, %ecx           # imm = 0xFFFF
jne 0xc787
movl $0x1, 0x64(%r15)
xorl %r14d, %r14d
movq %rdi, -0xe8(%rbp)
movq %r11, -0x40(%rbp)
movl %r10d, -0x5c(%rbp)
movq %r9, -0x100(%rbp)
movq %rsi, -0xa8(%rbp)
movq %rsi, %rdi
callq 0x3110
cmpq $0x10000, %rax          # imm = 0x10000
jb 0xc7c3
movl $0x19, 0x1c(%rbx)
xorl %r13d, %r13d
jmp 0xc6bc
movl %r14d, %r9d
movq 0x20(%rbx), %rdi
leaq -0x1(%rdi), %rcx
movq %rax, -0x88(%rbp)
movl %ecx, %edx
movq -0x40(%rbp), %rsi
andl %esi, %edx
movl %edi, %r14d
subl %edx, %r14d
andl %ecx, %r14d
xorl %r13d, %r13d
cmpq $0x1, %rdi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
cmovbl %r13d, %r14d
movq 0x8(%r15), %rax
movzwl 0x10(%rbp), %edi
movq -0x88(%rbp), %rcx
addq %rdi, %rcx
addq %rax, %rcx
addq $0x4a, %rcx
cmpq %rdx, %rcx
jbe 0xc820
movl $0xf, 0x1c(%rbx)
jmp 0xc6bc
movl %r14d, %r8d
testb %r9b, %r9b
je 0xc861
movl 0x28(%rbp), %ecx
movl %ecx, %ecx
movl 0x38(%rbp), %edx
movl %edx, %edx
addq %rdi, %rcx
addq %rdx, %rcx
addq %rsi, %rcx
movq -0x88(%rbp), %rdx
leaq (%rcx,%rdx,2), %rcx
addq %rax, %rcx
leaq (%r8,%rcx), %rax
addq $0x472, %rax            # imm = 0x472
shrq $0x20, %rax
je 0xc861
movl $0x1, 0x64(%r15)
movq %r8, -0x98(%rbp)
movq %rdi, -0xf8(%rbp)
movq -0x48(%rbp), %rax
testq %rax, %rax
je 0xc890
movq (%rax), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x32(%rbp), %rdx
callq 0xc0e3
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %r12
xorl %r13d, %r13d
cmpq $0x4, %r12
movl -0x30(%rbp), %eax
cmovbl %r13d, %eax
movl %eax, -0x30(%rbp)
movq %rbx, %rdi
movl %r14d, %edx
movq %rsi, %r14
callq 0xc13f
testl %eax, %eax
je 0xc92a
addq -0x98(%rbp), %r14
movq %r14, -0xb0(%rbp)
movq 0x20(%rbx), %rax
testq %rax, %rax
movq %r14, %r8
je 0xc8d9
decq %rax
testq %r8, %rax
jne 0xcf84
xorl %r13d, %r13d
cmpl $0x0, -0x30(%rbp)
setne %r13b
shll $0x3, %r13d
xorps %xmm0, %xmm0
movups %xmm0, -0xd2(%rbp)
movaps %xmm0, -0xe0(%rbp)
cmpl $0x0, 0x64(%r15)
movl -0x5c(%rbp), %esi
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
je 0xc936
cmpq %rcx, %r12
ja 0xca27
cmpq %rcx, %r8
ja 0xca27
movq $0x0, -0x48(%rbp)
xorl %r14d, %r14d
jmp 0xca66
movl $0x13, 0x1c(%rbx)
jmp 0xc6bc
cmpl $0x0, -0x4c(%rbp)
jne 0xce10
movq %r8, %rax
shrq $0x20, %rax
jne 0xce10
movl -0x30(%rbp), %edi
testl %edi, %edi
movzwl -0x34(%rbp), %ecx
leaq -0xe0(%rbp), %rdx
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
movl $0x14, %eax
cmovel %edi, %eax
movb %al, 0x4(%rdx)
movb $0x8, 0x6(%rdx)
movzwl %si, %eax
movb %ah, -0xd9(%rbp)
movzwl -0x32(%rbp), %eax
movb %r13b, 0x8(%rdx)
movb %cl, 0xa(%rdx)
movl %ecx, -0x98(%rbp)
movb %ch, -0xd5(%rbp)
movb %al, 0xc(%rdx)
movl %eax, -0x8c(%rbp)
movb %ah, -0xd3(%rbp)
movq $0x0, 0xe(%rdx)
movl $0x0, 0x16(%rdx)
movq -0x88(%rbp), %rax
movb %al, 0x1a(%rdx)
movq %rax, %r15
movb %ah, -0xc5(%rbp)
movl 0x28(%rbp), %eax
movb %al, 0x1c(%rdx)
movb %ah, -0xc3(%rbp)
movq 0x60(%rbx), %rdi
movl $0x1e, %ecx
movq %r8, %rsi
movq %r8, %r14
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xcce3
addq $0x1e, %r14
movq 0x60(%rbx), %rdi
movq %r14, %rsi
movq -0xa8(%rbp), %rdx
movq %r15, %rcx
callq *0x50(%rbx)
cmpq %r15, %rax
jne 0xcce3
addq %r15, %r14
xorl %ecx, %ecx
movq $0x0, -0xa0(%rbp)
movq %r14, %r15
movl 0x28(%rbp), %eax
jmp 0xcb66
xorl %eax, %eax
cmpq %rcx, %r12
leaq -0x58(%rbp), %rsi
cmovbeq %rax, %rsi
leaq -0x50(%rbp), %rdx
cmovbeq %rax, %rdx
cmpq %rcx, %r8
leaq -0xb0(%rbp), %rcx
cmovbeq %rax, %rcx
leaq -0x120(%rbp), %rdi
movq %rdi, -0x48(%rbp)
movq %r8, %r14
callq 0xc1da
movq %r14, %r8
movl -0x5c(%rbp), %esi
movl %eax, %r14d
movl 0x28(%rbp), %eax
leal (%r14,%rax), %r9d
movl -0x30(%rbp), %edi
testl %edi, %edi
movzwl -0x34(%rbp), %eax
leaq -0xe0(%rbp), %rdx
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
movl $0x14, %ecx
cmovel %edi, %ecx
movb %cl, 0x4(%rdx)
movw $0x800, 0x5(%rdx)       # imm = 0x800
movzwl %si, %ecx
movb %ch, -0xd9(%rbp)
movzwl -0x32(%rbp), %ecx
movb %r13b, 0x8(%rdx)
movb $0x0, 0x9(%rdx)
movb %al, 0xa(%rdx)
movl %eax, -0x98(%rbp)
movb %ah, -0xd5(%rbp)
movb %cl, 0xc(%rdx)
movl %ecx, -0x8c(%rbp)
movb %ch, -0xd3(%rbp)
movq $0x0, 0xe(%rdx)
movl $0x0, 0x16(%rdx)
movq -0x88(%rbp), %rax
movb %al, 0x1a(%rdx)
movq %rax, %r12
movb %ah, -0xc5(%rbp)
movl %r9d, %eax
movb %al, 0x1c(%rdx)
movb %ah, -0xc3(%rbp)
movq 0x60(%rbx), %rdi
movl $0x1e, %ecx
movq %r8, %rsi
movq %r8, %r15
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xcce3
addq $0x1e, %r15
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movq -0xa8(%rbp), %rdx
movq %r12, %rcx
callq *0x50(%rbx)
cmpq %r12, %rax
jne 0xcce3
addq %r12, %r15
movq 0x60(%rbx), %rdi
movq %r14, -0xa0(%rbp)
movl %r14d, %r14d
leaq -0x120(%rbp), %rdx
movq %r15, %rsi
movq %r14, %rcx
callq *0x50(%rbx)
cmpq %r14, %rax
jne 0xcce3
addq %r14, %r15
movl 0x28(%rbp), %eax
movq -0x48(%rbp), %rcx
testl %eax, %eax
movl %r13d, -0xb4(%rbp)
movq %rcx, -0x48(%rbp)
je 0xcb95
movq 0x60(%rbx), %rdi
movl %eax, %r14d
movq %r15, %rsi
movq 0x20(%rbp), %rdx
movq %r14, %rcx
callq *0x50(%rbx)
cmpq %r14, %rax
jne 0xcce3
addq %r14, %r15
movq %r15, -0x40(%rbp)
movq -0x58(%rbp), %r15
testq %r15, %r15
je 0xccef
movq 0x40(%rbx), %rdi
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
callq *0x28(%rbx)
testq %rax, %rax
je 0xce3c
movq %rax, %r12
cmpl $0x0, -0x30(%rbp)
je 0xccfc
movq 0x40(%rbx), %rdi
movl $0x1, %esi
movl $0x4df78, %edx          # imm = 0x4DF78
callq *0x28(%rbx)
testq %rax, %rax
je 0xce32
movq %rax, %r14
leaq -0x80(%rbp), %rdx
movq %rbx, (%rdx)
movq -0x40(%rbp), %rax
movq %rax, 0x8(%rdx)
movl -0x30(%rbp), %edi
cmpl $0xa, %edi
movl $0xa, %eax
cmovbl %edi, %eax
movq $0x0, 0x10(%rdx)
leaq 0x98ea(%rip), %rsi      # 0x16500
xorl %ecx, %ecx
cmpl $0x4, %edi
setb %cl
shll $0xe, %ecx
orl (%rsi,%rax,4), %ecx
leaq -0x9fa(%rip), %rsi      # 0xc231
movq %r14, %rdi
callq 0x3982
movq $0x0, -0x30(%rbp)
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r15
movl $0x10000, %r13d         # imm = 0x10000
cmovbq %r15, %r13
movl $0x1, %esi
movq %r12, %rdi
movq %r13, %rdx
movq -0xf0(%rbp), %rcx
callq 0x3360
cmpq %r13, %rax
jne 0xcf63
movq -0x30(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3715
movq %rax, -0x30(%rbp)
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0xcc9b
movq 0x60(%rbx), %rdi
callq *%rax
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal (%rcx,%rcx,2), %ecx
jmp 0xcc9d
xorl %ecx, %ecx
subq %r13, %r15
movl $0x4, %eax
cmovel %eax, %ecx
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x75de
testl %eax, %eax
je 0xcc3b
movl $0xc, %ecx
cmpl $0x1, %eax
jne 0xcf68
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq *0x30(%rbx)
movq -0x78(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x70(%rbp), %rax
jmp 0xcd76
movl $0x13, 0x1c(%rbx)
jmp 0xc7bb
movq $0x0, -0x30(%rbp)
jmp 0xcd84
movq $0x0, -0x30(%rbp)
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r15
movl $0x10000, %r14d         # imm = 0x10000
cmovbq %r15, %r14
movl $0x1, %esi
movq %r12, %rdi
movq %r14, %rdx
movq -0xf0(%rbp), %rcx
callq 0x3360
cmpq %r14, %rax
movq -0x40(%rbp), %r13
jne 0xce1c
movq 0x60(%rbx), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq *0x50(%rbx)
cmpq %r14, %rax
jne 0xce1c
movq -0x30(%rbp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x3715
movq %rax, -0x30(%rbp)
addq %r14, %r13
movq %r13, -0x40(%rbp)
subq %r14, %r15
jne 0xcd04
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x40(%rbx), %rdi
movq %r12, %rsi
callq *0x30(%rbx)
movl $0x8074b50, -0x80(%rbp) # imm = 0x8074B50
movq -0x30(%rbp), %rcx
movb %cl, -0x7c(%rbp)
movb %ch, -0x7b(%rbp)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, -0x7a(%rbp)
movl %ecx, %eax
shrl $0x18, %eax
movb %al, -0x79(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xce03
movq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movb %al, -0x70(%rbp)
movb %ah, -0x6f(%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, -0x6e(%rbp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, -0x6d(%rbp)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, -0x6c(%rbp)
movq %rax, %rcx
shrq $0x28, %rcx
movb %cl, -0x6b(%rbp)
movq %rax, %rcx
shrq $0x30, %rcx
movb %cl, -0x6a(%rbp)
shrq $0x38, %rax
movl $0x18, %r14d
leaq -0x69(%rbp), %rcx
movq %rcx, -0xe8(%rbp)
jmp 0xce67
movq -0x50(%rbp), %rax
movq %rax, %rcx
shrq $0x20, %rcx
je 0xce48
movl $0x1d, 0x1c(%rbx)
jmp 0xc7bb
movq 0x40(%rbx), %rdi
movq %r12, %rsi
callq *0x30(%rbx)
movl $0x14, 0x1c(%rbx)
jmp 0xc7bb
movq 0x40(%rbx), %rdi
movq %r12, %rsi
callq *0x30(%rbx)
movl $0x10, 0x1c(%rbx)
jmp 0xc7bb
movl %eax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movb %al, -0x74(%rbp)
movb %ah, -0x73(%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, -0x72(%rbp)
shrq $0x18, %rax
movl $0x10, %r14d
movq -0xe8(%rbp), %rcx
movb %al, (%rcx)
movq 0x60(%rbx), %rdi
leaq -0x80(%rbp), %rdx
movq -0x40(%rbp), %rsi
movq %r14, %rcx
callq *0x50(%rbx)
xorl %r13d, %r13d
cmpq %r14, %rax
jne 0xc6bc
cmpq $0x0, -0x48(%rbp)
je 0xced0
xorl %ecx, %ecx
leaq -0x58(%rbp), %rsi
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
cmpq %rdi, (%rsi)
cmovbeq %rcx, %rsi
leaq -0x50(%rbp), %rdx
cmovbeq %rcx, %rdx
leaq -0xb0(%rbp), %rax
cmpq %rdi, (%rax)
cmovaq %rax, %rcx
leaq -0x120(%rbp), %rdi
callq 0xc1da
movq %rax, -0xa0(%rbp)
movzwl -0x8c(%rbp), %eax
movzwl -0x98(%rbp), %r10d
movzwl -0x5c(%rbp), %r11d
movzwl -0xb4(%rbp), %r15d
movl $0xffff, %edx           # imm = 0xFFFF
movq -0xa0(%rbp), %r8
andl %edx, %r8d
andl -0x88(%rbp), %edx
movq %rbx, %rdi
movq -0xa8(%rbp), %rsi
movq -0x48(%rbp), %rcx
movq -0x100(%rbp), %r9
movl 0x38(%rbp), %r12d
pushq %r12
pushq 0x30(%rbp)
pushq $0x0
pushq -0xb0(%rbp)
pushq %rax
pushq %r10
pushq %r11
pushq %r15
pushq -0x30(%rbp)
pushq -0x50(%rbp)
pushq -0x58(%rbp)
pushq -0xf8(%rbp)
callq 0xc272
addq $0x60, %rsp
testl %eax, %eax
je 0xc6bc
incl 0x10(%rbx)
addq -0x40(%rbp), %r14
movq %r14, (%rbx)
movl $0x1, %r13d
jmp 0xc6bc
movl $0x14, %ecx
movl %ecx, 0x1c(%rbx)
movq 0x40(%rbx), %rdi
movq %r14, %rsi
callq *0x30(%rbx)
movq 0x40(%rbx), %rdi
movq %r12, %rsi
callq *0x30(%rbx)
jmp 0xc7bb
leaq 0xa3f4(%rip), %rdi      # 0x1737f
leaq 0xa1ac(%rip), %rsi      # 0x1713e
leaq 0xa428(%rip), %rcx      # 0x173c1
movl $0x18ff, %edx           # imm = 0x18FF
callq 0x3170