// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
movq %rdi, %rbx
movl 0x18(%rbp), %edi
xorl %r14d, %r14d
movw %r14w, -0x2c(%rbp)
movw %r14w, -0x2a(%rbp)
movq (%rbx), %r8
movq %rcx, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
xorl %r11d, %r11d
btl $0x10, %edi
setae %al
testl %edi, %edi
movl $0x6, %r13d
cmovnsl %edi, %r13d
movq 0x68(%rbx), %r12
testq %r12, %r12
je 0xc802
testq %rsi, %rsi
je 0xc802
cmpl $0x2, 0x14(%rbx)
jne 0xc802
movq %rbx, -0x38(%rbp)
movl %r13d, %ebx
andl $0xf, %ebx
cmpw $0x0, 0x10(%rbp)
movq %rdx, -0x40(%rbp)
sete %r10b
testq %r9, %r9
setne %dil
orb %r10b, %dil
movl %ebx, -0x30(%rbp)
cmpl $0xb, %ebx
movq -0x38(%rbp), %rbx
setb %r10b
testb %r10b, %dil
je 0xc802
shrq $0x20, %rcx
je 0xc7e2
cmpl $0x0, 0x64(%r12)
jne 0xc7e2
movl $0x1, 0x64(%r12)
btl $0xa, %r13d
jb 0xc7ff
cmpb $0x2f, (%rsi)
jne 0xc823
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xc80e
movl $0x19, 0x1c(%rbx)
jmp 0xc80e
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xc80e
movl $0x18, 0x1c(%rbx)
movl %r14d, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb %al, %r11b
shll $0xb, %r11d
orl $0x8, %r11d
leaq -0x71(%rbp), %r14
movq %rsi, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0xc84b
cmpl $0x3a, %ecx
je 0xc7ee
cmpl $0x5c, %ecx
je 0xc7ee
incq %rax
jmp 0xc835
cmpl $0x0, 0x64(%r12)
movl 0x10(%rbx), %eax
je 0xc86c
cmpl $-0x1, %eax
jne 0xc87c
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xc80e
movl $0x2, 0x1c(%rbx)
jmp 0xc80e
cmpl $0xffff, %eax           # imm = 0xFFFF
jne 0xc87c
movl $0x1, 0x64(%r12)
movl %r11d, -0x64(%rbp)
movq %r9, -0xf8(%rbp)
movq %r8, -0x48(%rbp)
movq %rsi, -0xa8(%rbp)
movq %rsi, %rdi
callq 0x3110
cmpq $0x10000, %rax          # imm = 0x10000
jae 0xc7ee
movq %r14, -0xe8(%rbp)
movq 0x20(%rbx), %rdi
leaq -0x1(%rdi), %rcx
movq %rax, -0x90(%rbp)
movl %ecx, %edx
movq -0x48(%rbp), %rsi
andl %esi, %edx
movl %edi, %r8d
subl %edx, %r8d
andl %ecx, %r8d
xorl %r14d, %r14d
cmpq $0x1, %rdi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
cmovbl %r14d, %r8d
movq 0x8(%r12), %rax
movzwl 0x10(%rbp), %edi
movq -0x90(%rbp), %rcx
addq %rdi, %rcx
addq %rax, %rcx
addq $0x4a, %rcx
cmpq %rdx, %rcx
jbe 0xc911
testq %rbx, %rbx
je 0xc80e
movl $0xf, 0x1c(%rbx)
jmp 0xc80e
cmpl $0x0, 0x64(%r12)
movl %r8d, %r13d
jne 0xc956
movl 0x28(%rbp), %ecx
movl %ecx, %ecx
movl 0x38(%rbp), %edx
movl %edx, %edx
addq %rdi, %rcx
addq %rdx, %rcx
addq %rsi, %rcx
movq -0x90(%rbp), %rdx
leaq (%rcx,%rdx,2), %rcx
addq %rax, %rcx
leaq (%rcx,%r13), %rax
addq $0x472, %rax            # imm = 0x472
shrq $0x20, %rax
je 0xc956
movl $0x1, 0x64(%r12)
movq %rdi, -0xf0(%rbp)
testq %r15, %r15
je 0xc97c
movq (%r15), %rdi
leaq -0x2c(%rbp), %rsi
leaq -0x2a(%rbp), %rdx
movl %r8d, %r14d
callq 0xc1cb
movl %r14d, %r8d
movq -0x48(%rbp), %rsi
xorl %r14d, %r14d
cmpq $0x4, -0x50(%rbp)
movl -0x30(%rbp), %eax
cmovbl %r14d, %eax
movl %eax, -0x30(%rbp)
movq %rbx, %rdi
movl %r8d, %edx
movq %rsi, %r15
callq 0xc227
testl %eax, %eax
je 0xce29
addq %r13, %r15
movq %r15, -0xb0(%rbp)
movq 0x20(%rbx), %rax
testq %rax, %rax
movq %r15, %r8
je 0xc9c6
decq %rax
testq %r8, %rax
jne 0xd171
movq -0x50(%rbp), %rax
testq %rax, %rax
sete %cl
cmpl $0x0, -0x30(%rbp)
sete %r15b
orb %cl, %r15b
movl %r15d, %ecx
xorb $0x1, %cl
movzbl %cl, %r13d
shll $0x3, %r13d
xorps %xmm0, %xmm0
movaps %xmm0, -0xe0(%rbp)
movups %xmm0, -0xd2(%rbp)
cmpl $0x0, 0x64(%r12)
movl -0x64(%rbp), %ecx
movl $0xfffffffe, %r9d       # imm = 0xFFFFFFFE
je 0xca2f
cmpq %r9, %rax
ja 0xcb26
cmpq %r9, %r8
ja 0xcb26
movq $0x0, -0x88(%rbp)
xorl %eax, %eax
jmp 0xcb65
cmpl $0x0, -0x54(%rbp)
jne 0xce3e
movq %r8, %rax
shrq $0x20, %rax
jne 0xce3e
leaq -0xe0(%rbp), %rdx
movaps %xmm0, (%rdx)
movups %xmm0, 0xe(%rdx)
xorl %r14d, %r14d
testb %r15b, %r15b
movl $0x14, %eax
cmovnel %r14d, %eax
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
movb %al, 0x4(%rdx)
movw $0x800, 0x5(%rdx)       # imm = 0x800
movzwl %cx, %eax
movb %ah, -0xd9(%rbp)
movzwl -0x2c(%rbp), %eax
movb %r13b, 0x8(%rdx)
movb $0x0, 0x9(%rdx)
movb %al, 0xa(%rdx)
movb %ah, -0xd5(%rbp)
movzwl -0x2a(%rbp), %eax
movb %al, 0xc(%rdx)
movb %ah, -0xd3(%rbp)
movl %r14d, 0x16(%rdx)
movq $0x0, 0xe(%rdx)
movq -0x90(%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
movl $0x1e, %ecx
movq %r8, %rsi
movq %r8, %r15
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xce29
addq $0x1e, %r15
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movq -0xa8(%rbp), %rdx
movq %r12, %rcx
callq *0x50(%rbx)
cmpq %r12, %rax
jne 0xce59
addq %r12, %r15
movq $0x0, -0x88(%rbp)
movq $0x0, -0x98(%rbp)
movq %r15, %r12
jmp 0xcc5c
xorl %edi, %edi
cmpq %r9, %rax
leaq -0x50(%rbp), %rsi
cmovbeq %rdi, %rsi
leaq -0x58(%rbp), %rdx
cmovbeq %rdi, %rdx
cmpq %r9, %r8
leaq -0xb0(%rbp), %rcx
cmovbeq %rdi, %rcx
leaq -0x120(%rbp), %rdi
movq %rdi, -0x88(%rbp)
movq %r8, %r14
callq 0xc2c3
movl -0x64(%rbp), %ecx
movq %r14, %r8
xorps %xmm0, %xmm0
leaq -0xe0(%rbp), %rdx
movaps %xmm0, (%rdx)
movups %xmm0, 0xe(%rdx)
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
xorl %r14d, %r14d
testb %r15b, %r15b
movl $0x14, %esi
cmovnel %r14d, %esi
movb %sil, 0x4(%rdx)
movw $0x800, 0x5(%rdx)       # imm = 0x800
movzwl %cx, %ecx
movb %ch, -0xd9(%rbp)
movzwl -0x2c(%rbp), %ecx
movb %r13b, 0x8(%rdx)
movb $0x0, 0x9(%rdx)
movb %cl, 0xa(%rdx)
movb %ch, -0xd5(%rbp)
movzwl -0x2a(%rbp), %ecx
movb %cl, 0xc(%rdx)
movb %ch, -0xd3(%rbp)
movq %rax, -0x98(%rbp)
movl 0x28(%rbp), %ecx
leal (%rax,%rcx), %eax
movl %r14d, 0x16(%rdx)
movq $0x0, 0xe(%rdx)
movq -0x90(%rbp), %rcx
movb %cl, 0x1a(%rdx)
movq %rcx, %r15
movb %ch, -0xc5(%rbp)
movb %al, 0x1c(%rdx)
movb %ah, -0xc3(%rbp)
movq 0x60(%rbx), %rdi
movl $0x1e, %ecx
movq %r8, %rsi
movq %r8, %r12
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xce29
addq $0x1e, %r12
movq 0x60(%rbx), %rdi
movq %r12, %rsi
movq -0xa8(%rbp), %rdx
movq %r15, %rcx
callq *0x50(%rbx)
cmpq %r15, %rax
jne 0xce29
addq %r15, %r12
movq 0x60(%rbx), %rdi
movl -0x98(%rbp), %r15d
leaq -0x120(%rbp), %rdx
movq %r12, %rsi
movq %r15, %rcx
callq *0x50(%rbx)
cmpq %r15, %rax
jne 0xce29
addq %r15, %r12
movl 0x28(%rbp), %eax
testl %eax, %eax
movl %r13d, -0xb4(%rbp)
je 0xcc8a
movq 0x60(%rbx), %rdi
movl %eax, %r14d
movq %r12, %rsi
movq 0x20(%rbp), %rdx
movq %r14, %rcx
callq *0x50(%rbx)
cmpq %r14, %rax
jne 0xce56
addq %r14, %r12
movq %r12, -0x48(%rbp)
movq -0x50(%rbp), %r14
testq %r14, %r14
je 0xce72
movq 0x40(%rbx), %rdi
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
callq *0x28(%rbx)
movq %rax, -0x60(%rbp)
testq %rax, %rax
je 0xce7a
cmpl $0x0, -0x30(%rbp)
je 0xce96
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rdi
movl $0x1, %esi
movl $0x4df78, %edx          # imm = 0x4DF78
callq *0x28(%rax)
movq %rax, -0xa0(%rbp)
testq %rax, %rax
je 0xcf31
leaq -0x80(%rbp), %rdx
movq -0x38(%rbp), %rbx
movq %rbx, (%rdx)
movq -0x48(%rbp), %rax
movq %rax, 0x8(%rdx)
movl -0x30(%rbp), %edi
cmpl $0xa, %edi
movl $0xa, %eax
cmovll %edi, %eax
movq $0x0, 0x10(%rdx)
leaq 0x97e8(%rip), %rsi      # 0x16500
xorl %ecx, %ecx
cmpl $0x4, %edi
setb %cl
shll $0xe, %ecx
orl (%rsi,%rax,4), %ecx
leaq -0xa13(%rip), %rsi      # 0xc31a
movq -0xa0(%rbp), %rdi
callq 0x397f
xorl %r13d, %r13d
movl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rcx
movq -0x60(%rbp), %r12
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r14
movl $0x10000, %r15d         # imm = 0x10000
cmovbq %r14, %r15
movl $0x1, %esi
movq %r12, %rdi
movq %r15, %rdx
callq 0x3360
cmpq %r15, %rax
jne 0xcd9e
movl %r13d, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3715
movq %rax, %r13
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0xcdac
movq 0x60(%rbx), %rdi
callq *%rax
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal (%rcx,%rcx,2), %ecx
jmp 0xcdae
testq %rbx, %rbx
je 0xcdec
movl $0x14, 0x1c(%rbx)
jmp 0xcdec
xorl %ecx, %ecx
subq %r15, %r14
movl $0x4, %eax
cmovel %eax, %ecx
movq -0xa0(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %r15, %rdx
callq 0x75b4
testl %eax, %eax
je 0xcddc
cmpl $0x1, %eax
jne 0xcde0
xorl %edx, %edx
movl %eax, -0x30(%rbp)
jmp 0xcdee
movb $0x1, %dl
jmp 0xcdee
testq %rbx, %rbx
je 0xcdec
movl $0xc, 0x1c(%rbx)
xorl %edx, %edx
movq -0x40(%rbp), %rcx
testb %dl, %dl
jne 0xcd4b
movq 0x40(%rbx), %rdi
movq -0xa0(%rbp), %rsi
callq *0x30(%rbx)
cmpl $0x0, -0x30(%rbp)
je 0xcf61
movq -0x78(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $0x1, %al
jmp 0xcf72
testq %rbx, %rbx
je 0xc80e
movl $0x13, 0x1c(%rbx)
jmp 0xc80e
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xc80e
movl $0x1d, 0x1c(%rbx)
jmp 0xc80e
xorl %r14d, %r14d
testq %rbx, %rbx
je 0xc80e
movq -0x38(%rbp), %rax
movl $0x13, 0x1c(%rax)
jmp 0xc80e
xorl %r13d, %r13d
jmp 0xcf96
cmpq $0x0, -0x38(%rbp)
je 0xce8c
movq -0x38(%rbp), %rax
movl $0x10, 0x1c(%rax)
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0xcf8b
xorl %r13d, %r13d
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rbx
movq -0x60(%rbp), %r12
testq %r14, %r14
je 0xcf57
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %r14
movl $0x10000, %r15d         # imm = 0x10000
cmovbq %r14, %r15
movl $0x1, %esi
movq %r12, %rdi
movq %r15, %rdx
callq 0x3360
cmpq %r15, %rax
jne 0xcf07
movq 0x60(%rbx), %rdi
movq -0x48(%rbp), %rsi
movq %r12, %rdx
movq %r15, %rcx
callq *0x50(%rbx)
cmpq %r15, %rax
jne 0xcf07
movl %r13d, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3715
movq %rax, %r13
subq %r15, %r14
addq %r15, -0x48(%rbp)
movb $0x1, %al
jmp 0xcf1f
movq 0x40(%rbx), %rdi
movq %r12, %rsi
callq *0x30(%rbx)
testq %rbx, %rbx
je 0xcf1d
movl $0x14, 0x1c(%rbx)
xorl %eax, %eax
movq -0x40(%rbp), %rcx
testb %al, %al
movq -0x60(%rbp), %r12
jne 0xcea5
jmp 0xcf89
movq -0x38(%rbp), %rbx
movq 0x40(%rbx), %rdi
movq -0x60(%rbp), %rsi
callq *0x30(%rbx)
testq %rbx, %rbx
je 0xcf50
movq -0x38(%rbp), %rax
movl $0x10, 0x1c(%rax)
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0xcf72
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0xcf76
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x60(%rbp), %rsi
callq *0x30(%rax)
xorl %eax, %eax
testb %al, %al
je 0xcf89
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x60(%rbp), %rsi
callq *0x30(%rax)
movb $0x1, %al
jmp 0xcf8b
xorl %eax, %eax
xorl %r14d, %r14d
testb %al, %al
je 0xc80e
movl $0x8074b50, -0x80(%rbp) # imm = 0x8074B50
movq %r13, %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, -0x88(%rbp)
je 0xd017
movq -0x58(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%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 0xd059
movq -0x58(%rbp), %rax
movq %rax, %rcx
shrq $0x20, %rcx
je 0xd03a
cmpq $0x0, -0x38(%rbp)
je 0xd036
movq -0x38(%rbp), %rax
movl $0x1d, 0x1c(%rax)
xorl %eax, %eax
jmp 0xd08e
movl %eax, -0x78(%rbp)
movq -0x50(%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 -0x38(%rbp), %rax
movq 0x60(%rax), %rdi
leaq -0x80(%rbp), %rdx
movq -0x48(%rbp), %r15
movq %r15, %rsi
movq %r14, %rcx
callq *0x50(%rax)
xorl %ecx, %ecx
cmpq %r14, %rax
sete %al
cmoveq %r14, %rcx
addq %rcx, %r15
movq %r15, -0x48(%rbp)
xorl %r14d, %r14d
testb %al, %al
je 0xc80e
cmpq $0x0, -0x88(%rbp)
je 0xd0de
xorl %ecx, %ecx
leaq -0x50(%rbp), %rsi
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
cmpq %rdi, (%rsi)
cmovbeq %rcx, %rsi
leaq -0x58(%rbp), %rdx
cmovbeq %rcx, %rdx
leaq -0xb0(%rbp), %rax
cmpq %rdi, (%rax)
cmovaq %rax, %rcx
leaq -0x120(%rbp), %rdi
callq 0xc2c3
movq %rax, -0x98(%rbp)
movzwl -0x2c(%rbp), %eax
movzwl -0x2a(%rbp), %r10d
movzwl -0x64(%rbp), %r11d
movzwl -0xb4(%rbp), %r15d
movl $0xffff, %edx           # imm = 0xFFFF
movq -0x98(%rbp), %r8
andl %edx, %r8d
andl -0x90(%rbp), %edx
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movq -0xa8(%rbp), %rsi
movq -0x88(%rbp), %rcx
movq -0xf8(%rbp), %r9
movl 0x38(%rbp), %r12d
pushq %r12
pushq 0x30(%rbp)
pushq $0x0
pushq -0xb0(%rbp)
pushq %r10
pushq %rax
pushq %r11
pushq %r15
pushq %r13
pushq -0x58(%rbp)
pushq -0x50(%rbp)
pushq -0xf0(%rbp)
callq 0xc35b
addq $0x60, %rsp
testl %eax, %eax
je 0xc80e
incl 0x10(%rbx)
movq -0x48(%rbp), %rax
movq %rax, (%rbx)
movl $0x1, %r14d
jmp 0xc80e
leaq 0xa207(%rip), %rdi      # 0x1737f
leaq 0x9fbf(%rip), %rsi      # 0x1713e
leaq 0xa23b(%rip), %rcx      # 0x173c1
movl $0x18ff, %edx           # imm = 0x18FF
callq 0x3170