// File: /workspace/github_cpp_makefile_star2_O2/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 $0x158, %rsp            # imm = 0x158
movq %rcx, %r14
andw $0x0, -0x2c(%rbp)
andw $0x0, -0x2a(%rbp)
movq %rdi, %rbx
movl 0x18(%rbp), %ecx
movq (%rdi), %rdi
movq %r14, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
btl $0x10, %ecx
setae %r11b
testl %ecx, %ecx
pushq $0x6
popq %rax
cmovnsl %ecx, %eax
movq 0x68(%rbx), %r12
testq %r12, %r12
je 0xc536
testq %rsi, %rsi
je 0xc536
cmpl $0x2, 0x14(%rbx)
jne 0xc536
movq %r8, %r15
movl %eax, %r10d
andl $0xf, %r10d
cmpw $0x0, 0x10(%rbp)
sete %cl
testq %r9, %r9
setne %r8b
orb %cl, %r8b
cmpl $0xb, %r10d
setb %cl
testb %cl, %r8b
je 0xc536
movl 0x64(%r12), %r13d
testl %r13d, %r13d
setne %cl
movq %r14, %r8
shrq $0x20, %r8
sete %r8b
orb %cl, %r8b
jne 0xc4e9
movl $0x1, 0x64(%r12)
pushq $0x1
popq %r13
btl $0xa, %eax
jb 0xc536
movb %r11b, -0x44(%rbp)
movl %r10d, -0x40(%rbp)
movq %rdx, -0xe8(%rbp)
movq %rdi, -0x68(%rbp)
movq %r9, -0xf8(%rbp)
movq %rsi, -0x80(%rbp)
movq %rsi, %rdi
callq 0xbec4
testl %eax, %eax
je 0xc57c
movl 0x10(%rbx), %eax
testl %r13d, %r13d
je 0xc555
xorl %r13d, %r13d
cmpl $-0x1, %eax
movq -0x80(%rbp), %rdi
jne 0xc56f
movl $0x2, 0x1c(%rbx)
jmp 0xc540
movl $0x18, 0x1c(%rbx)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %r13b
cmpl $0xffff, %eax           # imm = 0xFFFF
movq -0x80(%rbp), %rdi
jne 0xc56f
movl $0x1, 0x64(%r12)
xorl %r13d, %r13d
callq 0x3100
cmpq $0x10000, %rax          # imm = 0x10000
jb 0xc585
movl $0x19, 0x1c(%rbx)
jmp 0xc53d
movq %rbx, %rdi
movq %rax, -0x78(%rbp)
callq 0xbf4c
movl %eax, %r9d
movq 0x8(%r12), %rax
movzwl 0x10(%rbp), %edi
movq -0x78(%rbp), %rcx
addq %rdi, %rcx
addq %rax, %rcx
addq $0x4a, %rcx
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
cmpq %rdx, %rcx
jbe 0xc5c1
movl $0xf, 0x1c(%rbx)
jmp 0xc53d
movl 0x28(%rbp), %ecx
movl %r9d, %r10d
movl %ecx, %r8d
testb %r13b, %r13b
movq -0x68(%rbp), %rsi
je 0xc602
movl 0x38(%rbp), %ecx
addq %rsi, %rcx
addq %rdi, %rcx
addq %r8, %rcx
movq -0x78(%rbp), %rdx
leaq (%rcx,%rdx,2), %rcx
addq %r10, %rcx
addq %rcx, %rax
addq $0x472, %rax            # imm = 0x472
shrq $0x20, %rax
je 0xc602
movl $0x1, 0x64(%r12)
movq %r10, -0x88(%rbp)
movq %r8, -0x38(%rbp)
movq %rdi, -0xf0(%rbp)
testq %r15, %r15
je 0xc637
movq (%r15), %rdi
leaq -0x2c(%rbp), %rsi
leaq -0x2a(%rbp), %rdx
movl %r9d, %r14d
callq 0xbef0
movl %r14d, %r9d
movq -0x68(%rbp), %rsi
movq -0x58(%rbp), %r14
xorl %r13d, %r13d
cmpq $0x4, %r14
movl -0x40(%rbp), %eax
cmovbl %r13d, %eax
movl %eax, -0x40(%rbp)
movq %rbx, %rdi
movl %r9d, %edx
movq %rsi, %r15
callq 0xbf6a
testl %eax, %eax
je 0xc71d
addq -0x88(%rbp), %r15
movq %r15, -0xb0(%rbp)
movq 0x20(%rbx), %rax
testq %rax, %rax
movq %r15, %r8
je 0xc684
decq %rax
testq %r8, %rax
jne 0xcd52
xorl %eax, %eax
movb -0x44(%rbp), %cl
movb %cl, %al
shll $0xb, %eax
orl $0x8, %eax
xorl %r15d, %r15d
movl -0x40(%rbp), %esi
testl %esi, %esi
setne %r15b
shll $0x3, %r15d
xorps %xmm0, %xmm0
movups %xmm0, -0xd2(%rbp)
movaps %xmm0, -0xe0(%rbp)
cmpl $0x0, 0x64(%r12)
pushq $0x14
popq %r13
movzwl %ax, %eax
movl %eax, -0x68(%rbp)
je 0xc729
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
cmpq %rdi, %r14
seta %al
cmpq %rdi, %r8
seta %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xc751
xorl %eax, %eax
cmpq %rdi, %r14
leaq -0x58(%rbp), %rsi
cmovbeq %rax, %rsi
leaq -0x50(%rbp), %rdx
cmovbeq %rax, %rdx
cmpq %rdi, %r8
leaq -0xb0(%rbp), %rcx
cmovbeq %rax, %rcx
leaq -0x120(%rbp), %rdi
movq %rdi, -0x70(%rbp)
movq %r8, %r14
callq 0xbffa
movl -0x40(%rbp), %esi
movq %r14, %r8
movl %eax, %r14d
jmp 0xc75c
movl $0x13, 0x1c(%rbx)
jmp 0xc540
cmpl $0x0, -0x4c(%rbp)
setne %al
movq %r8, %rcx
shrq $0x20, %rcx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xc855
movl $0x1d, 0x1c(%rbx)
jmp 0xc53d
movq $0x0, -0x70(%rbp)
xorl %r14d, %r14d
movl 0x28(%rbp), %eax
leal (%r14,%rax), %edi
testl %esi, %esi
movzwl -0x2c(%rbp), %eax
movzwl -0x2a(%rbp), %r9d
leaq -0xe0(%rbp), %rdx
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
movl %r13d, %ecx
cmovel %esi, %ecx
movb %cl, 0x4(%rdx)
movw $0x800, 0x5(%rdx)       # imm = 0x800
movl -0x68(%rbp), %ecx
movb %ch, -0xd9(%rbp)
movl %r15d, %r12d
movb %r15b, 0x8(%rdx)
movb $0x0, 0x9(%rdx)
movb %al, 0xa(%rdx)
movl %eax, -0x44(%rbp)
movb %ah, -0xd5(%rbp)
movl %r9d, %eax
movb %al, 0xc(%rdx)
movl %r9d, -0x88(%rbp)
movb %ah, -0xd3(%rbp)
andq $0x0, 0xe(%rdx)
andl $0x0, 0x16(%rdx)
movq -0x78(%rbp), %rax
movb %al, 0x1a(%rdx)
movq %rax, %r13
movb %ah, -0xc5(%rbp)
movl %edi, %eax
movb %al, 0x1c(%rdx)
movb %ah, -0xc3(%rbp)
movq 0x60(%rbx), %rdi
pushq $0x1e
popq %rcx
movq %r8, %rsi
movq %r8, %r15
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xca74
addq $0x1e, %r15
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movq -0x80(%rbp), %rdx
movq %r13, %rcx
callq *0x50(%rbx)
cmpq %r13, %rax
jne 0xca74
addq %r13, %r15
movq 0x60(%rbx), %rdi
movq %r14, -0xa8(%rbp)
movl %r14d, %r14d
leaq -0x120(%rbp), %rdx
movq %r15, %rsi
movq %r14, %rcx
callq *0x50(%rbx)
cmpq %r14, %rax
jne 0xca74
addq %r14, %r15
movq %r15, %rsi
movl %r12d, %r15d
pushq $0x14
popq %r13
jmp 0xc919
testl %esi, %esi
movzwl -0x2c(%rbp), %ecx
movzwl -0x2a(%rbp), %edi
leaq -0xe0(%rbp), %rdx
pushq $0x14
popq %rax
cmovel %esi, %eax
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
movb %al, 0x4(%rdx)
movb $0x8, 0x6(%rdx)
movl -0x68(%rbp), %eax
movb %ah, -0xd9(%rbp)
movb %r15b, 0x8(%rdx)
movb %cl, 0xa(%rdx)
movl %ecx, -0x44(%rbp)
movb %ch, -0xd5(%rbp)
movl %edi, %eax
movb %al, 0xc(%rdx)
movl %edi, -0x88(%rbp)
movb %ah, -0xd3(%rbp)
andq $0x0, 0xe(%rdx)
andl $0x0, 0x16(%rdx)
movq -0x78(%rbp), %rax
movb %al, 0x1a(%rdx)
movq %rax, %r12
movb %ah, -0xc5(%rbp)
movl 0x28(%rbp), %eax
movb %al, 0x1c(%rdx)
movb %ah, -0xc3(%rbp)
movq 0x60(%rbx), %rdi
pushq $0x1e
popq %rcx
movq %r8, %rsi
movq %r8, %r14
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xca74
addq $0x1e, %r14
movq 0x60(%rbx), %rdi
movq %r14, %rsi
movq -0x80(%rbp), %rdx
movq %r12, %rcx
callq *0x50(%rbx)
cmpq %r12, %rax
jne 0xca74
addq %r12, %r14
movq $0x0, -0x70(%rbp)
movq $0x0, -0xa8(%rbp)
movq %r14, %rsi
movl 0x28(%rbp), %eax
testl %eax, %eax
movq -0x38(%rbp), %rcx
je 0xc945
movq 0x20(%rbp), %rdx
movq 0x60(%rbx), %rdi
movq %rsi, %r14
callq *0x50(%rbx)
movq -0x38(%rbp), %rcx
cmpq %rcx, %rax
jne 0xca74
addq %rcx, %r14
movq %r14, %rsi
movq -0x58(%rbp), %r14
testq %r14, %r14
je 0xca80
movq %rsi, %r12
movq 0x40(%rbx), %rdi
pushq $0x1
popq %rsi
movl $0x10000, %edx          # imm = 0x10000
callq *0x28(%rbx)
movq %rax, -0x60(%rbp)
testq %rax, %rax
je 0xcb1b
movl %r15d, -0xb4(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0xca87
movq 0x40(%rbx), %rdi
pushq $0x1
popq %rsi
movl $0x4df78, %edx          # imm = 0x4DF78
callq *0x28(%rbx)
testq %rax, %rax
je 0xcb10
movq %rax, %r15
leaq -0xa0(%rbp), %rax
movq %rbx, (%rax)
movq %r12, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %rax, %r12
pushq $-0xf
popq %rsi
movq $0x0, -0x38(%rbp)
movl -0x40(%rbp), %edi
xorl %edx, %edx
callq 0x38b4
leaq -0x97e(%rip), %rsi      # 0xc051
movq %r15, -0x40(%rbp)
movq %r15, %rdi
movq %r12, %rdx
movl %eax, %ecx
callq 0x3932
movq -0x60(%rbp), %r15
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r14
movl $0x10000, %r12d         # imm = 0x10000
cmovbq %r14, %r12
movq %r15, %rdi
pushq $0x1
popq %rsi
movq %r12, %rdx
movq -0xe8(%rbp), %rcx
callq 0x3380
cmpq %r12, %rax
jne 0xcb31
movl -0x38(%rbp), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x36e2
movq %rax, -0x38(%rbp)
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0xca41
movq 0x60(%rbx), %rdi
callq *%rax
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal (%rcx,%rcx,2), %ecx
jmp 0xca43
xorl %ecx, %ecx
movq -0x40(%rbp), %rdi
subq %r12, %r14
pushq $0x4
popq %rax
cmovel %eax, %ecx
movq -0x60(%rbp), %r15
movq %r15, %rsi
movq %r12, %rdx
callq 0x72f1
testl %eax, %eax
je 0xc9e4
cmpl $0x1, %eax
jne 0xcb2d
xorl %r14d, %r14d
jmp 0xcb38
movl $0x13, 0x1c(%rbx)
jmp 0xc53d
xorl %ecx, %ecx
jmp 0xcb83
movq $0x0, -0x38(%rbp)
movq %r12, %r13
movq -0x60(%rbp), %r12
testq %r14, %r14
movq -0xe8(%rbp), %rcx
je 0xcb27
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r14
movl $0x10000, %r15d         # imm = 0x10000
cmovbq %r14, %r15
movq %r12, %rdi
pushq $0x1
popq %rsi
movq %r15, %rdx
callq 0x3380
cmpq %r15, %rax
jne 0xcafa
movq 0x60(%rbx), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq *0x50(%rbx)
cmpq %r15, %rax
jne 0xcafa
movl -0x38(%rbp), %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x36e2
movq %rax, -0x38(%rbp)
subq %r15, %r14
addq %r15, %r13
jmp 0xca96
movq 0x40(%rbx), %rdi
movq %r12, %rsi
callq *0x30(%rbx)
movl $0x14, 0x1c(%rbx)
jmp 0xc53d
movq 0x40(%rbx), %rdi
movq -0x60(%rbp), %rsi
callq *0x30(%rbx)
movl $0x10, 0x1c(%rbx)
jmp 0xc53d
movq -0x58(%rbp), %rax
jmp 0xcb66
pushq $0xc
popq %r13
movl %r13d, 0x1c(%rbx)
movb $0x1, %r14b
movq 0x40(%rbx), %rdi
movq -0x40(%rbp), %rsi
callq *0x30(%rbx)
testb %r14b, %r14b
je 0xcb58
movq 0x40(%rbx), %rdi
movq -0x60(%rbp), %rsi
callq *0x30(%rbx)
jmp 0xc53d
movq -0x98(%rbp), %r13
movq -0x90(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x40(%rbx), %rdi
movq -0x60(%rbp), %rsi
callq *0x30(%rbx)
movq %r13, %rsi
movl -0xb4(%rbp), %r15d
movq -0x38(%rbp), %rcx
movl $0x8074b50, -0xa0(%rbp) # imm = 0x8074B50
movb %cl, -0x9c(%rbp)
movb %ch, -0x9b(%rbp)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, -0x9a(%rbp)
movq %rcx, -0x38(%rbp)
movl %ecx, %eax
shrl $0x18, %eax
movb %al, -0x99(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0xcc0c
leaq -0x89(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, -0xf(%rax)
movq -0x58(%rbp), %rcx
movb %cl, -0x7(%rax)
movb %ch, -0x8f(%rbp)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, -0x5(%rax)
movl %ecx, %edx
shrl $0x18, %edx
movb %dl, -0x4(%rax)
movq %rcx, %rdx
shrq $0x20, %rdx
movb %dl, -0x3(%rax)
movq %rcx, %rdx
shrq $0x28, %rdx
movb %dl, -0x2(%rax)
movq %rcx, %rdx
shrq $0x30, %rdx
movb %dl, -0x1(%rax)
shrq $0x38, %rcx
pushq $0x18
jmp 0xcc42
movq -0x50(%rbp), %rcx
movq %rcx, %rax
shrq $0x20, %rax
jne 0xc745
leaq -0x91(%rbp), %rax
movl %ecx, -0x7(%rax)
movq -0x58(%rbp), %rcx
movb %cl, -0x3(%rax)
movb %ch, -0x93(%rbp)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, -0x1(%rax)
shrq $0x18, %rcx
pushq $0x10
popq %r14
movb %cl, (%rax)
movq 0x60(%rbx), %rdi
leaq -0xa0(%rbp), %rdx
movq %rsi, %r12
movq %r14, %rcx
callq *0x50(%rbx)
xorl %r13d, %r13d
cmpq %r14, %rax
jne 0xc540
cmpq $0x0, -0x70(%rbp)
je 0xcca8
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 0xbffa
movq %rax, -0xa8(%rbp)
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
movq -0xb0(%rbp), %rdx
movzwl -0x88(%rbp), %esi
movl -0x68(%rbp), %edi
movl %edi, 0x28(%rsp)
movl 0x38(%rbp), %edi
movl %edi, 0x58(%rsp)
movq 0x30(%rbp), %rdi
movq %rdi, 0x50(%rsp)
movzwl -0x44(%rbp), %edi
movq %rdx, 0x40(%rsp)
movl %esi, 0x38(%rsp)
movl %edi, 0x30(%rsp)
movzwl %r15w, %edx
movl %edx, 0x20(%rsp)
movq -0x38(%rbp), %rdx
movl %edx, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq -0xf0(%rbp), %rax
movl %eax, (%rsp)
andl $0x0, 0x48(%rsp)
movl $0xffff, %edx           # imm = 0xFFFF
movq -0xa8(%rbp), %r8
andl %edx, %r8d
andl -0x78(%rbp), %edx
movq -0xf8(%rbp), %r9
movq %rbx, %rdi
movq -0x80(%rbp), %rsi
movq -0x70(%rbp), %rcx
callq 0xc090
testl %eax, %eax
je 0xc540
pushq $0x1
popq %r13
addq %r12, %r14
incl 0x10(%rbx)
movq %r14, (%rbx)
jmp 0xc540
leaq 0x9606(%rip), %rdi      # 0x1635f
leaq 0x93be(%rip), %rsi      # 0x1611e
leaq 0x963a(%rip), %rcx      # 0x163a1
movl $0x18ff, %edx           # imm = 0x18FF
callq 0x3190