// File: /workspace/github_cpp_makefile_star2_O1/jimmiebergmann[P]fbx-file/miniz.c
// Function: mz_zip_writer_add_mem_ex_v2
mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size,
                                    mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified,
                                    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 method = 0, dos_time = 0, dos_date = 0;
    mz_uint level, ext_attributes = 0, num_alignment_padding_bytes;
    mz_uint64 local_dir_header_ofs = pZip->m_archive_size, cur_archive_file_ofs = pZip->m_archive_size, comp_size = 0;
    size_t archive_name_size;
    mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
    tdefl_compressor *pComp = NULL;
    mz_bool store_data_uncompressed;
    mz_zip_internal_state *pState;
    mz_uint8 *pExtra_data = NULL;
    mz_uint32 extra_size = 0;
    mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
    mz_uint16 bit_flags = 0;

    if ((int)level_and_flags < 0)
        level_and_flags = MZ_DEFAULT_LEVEL;

    if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
        bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;

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

    level = level_and_flags & 0xF;
    store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA));

    if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!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)
    {
        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); */
        }
        if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
        {
            pState->m_zip64 = MZ_TRUE;
            /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
        }
    }

    if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size))
        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);

#ifndef MINIZ_NO_TIME
    if (last_modified != NULL)
    {
        mz_zip_time_t_to_dos_time(*last_modified, &dos_time, &dos_date);
    }
    else
    {
        MZ_TIME_T cur_time;
        time(&cur_time);
        mz_zip_time_t_to_dos_time(cur_time, &dos_time, &dos_date);
    }
#endif /* #ifndef MINIZ_NO_TIME */

    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 + user_extra_data_central_len
			+ MZ_ZIP_DATA_DESCRIPTER_SIZE32) > 0xFFFFFFFF)
        {
            pState->m_zip64 = MZ_TRUE;
            /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
        }
    }

    if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
    {
        /* Set DOS Subdirectory attribute bit. */
        ext_attributes |= MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG;

        /* Subdirectories cannot contain data. */
        if ((buf_size) || (uncomp_size))
            return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
    }

    /* Try to do any allocations before writing to the archive, so if an allocation fails the file remains unmodified. (A good idea if we're doing an in-place modification.) */
    if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + (pState->m_zip64 ? MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE : 0))) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1)))
        return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);

    if ((!store_data_uncompressed) && (buf_size))
    {
        if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor))))
            return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
    }

    if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
    {
        pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
        return MZ_FALSE;
    }

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

    MZ_CLEAR_OBJ(local_dir_header);

    if (!store_data_uncompressed || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
    {
        method = MZ_DEFLATED;
    }

    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, bit_flags, dos_time, dos_date))
            return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);

        if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_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)
        {
            pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
        }
        cur_archive_file_ofs += archive_name_size;

        if (pExtra_data != NULL)
        {
            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, bit_flags, dos_time, dos_date))
            return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);

        if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_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)
        {
            pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
            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 (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
    {
        uncomp_crc32 = (mz_uint32)mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, buf_size);
        uncomp_size = buf_size;
        if (uncomp_size <= 3)
        {
            level = 0;
            store_data_uncompressed = MZ_TRUE;
        }
    }

    if (store_data_uncompressed)
    {
        if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size)
        {
            pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
            return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
        }

        cur_archive_file_ofs += buf_size;
        comp_size = buf_size;
    }
    else if (buf_size)
    {
        mz_zip_writer_add_state state;

        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) ||
            (tdefl_compress_buffer(pComp, pBuf, buf_size, TDEFL_FINISH) != TDEFL_STATUS_DONE))
        {
            pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
            return mz_zip_set_error(pZip, MZ_ZIP_COMPRESSION_FAILED);
        }

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

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

    if (uncomp_size)
    {
        mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64];
        mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32;

        MZ_ASSERT(bit_flags & MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR);

        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, bit_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 $0x108, %rsp            # imm = 0x108
movl %r9d, %r15d
movq %rcx, %r10
movq %rdi, %rbx
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %ecx
xorl %edi, %edi
movw %di, -0x2e(%rbp)
movw %di, -0x2c(%rbp)
movq (%rbx), %rdi
movq %rdi, -0x70(%rbp)
movq $0x0, -0x48(%rbp)
testl %ecx, %ecx
movl $0x6, %r13d
cmovnsl %ecx, %r13d
testq %rax, %rax
jne 0xb71b
testq %r10, %r10
sete %cl
movl %r13d, %r9d
shrl $0xa, %r9d
andl $0x1, %r9d
orb %cl, %r9b
jne 0xb7ae
movw $0x8, %cx
movzwl %cx, %r9d
leal 0x800(%r9), %ecx
btl $0x10, %r13d
cmovael %ecx, %r9d
movl %r13d, %r14d
andl $0xf, %r14d
sete -0x29(%rbp)
movq 0x68(%rbx), %r12
testq %r12, %r12
je 0xb7ed
cmpl $0x2, 0x14(%rbx)
jne 0xb7ed
testq %r10, %r10
sete %cl
testq %rdx, %rdx
setne %r11b
testq %rsi, %rsi
je 0xb7ed
orb %cl, %r11b
je 0xb7ed
testw %r15w, %r15w
sete %cl
testq %r8, %r8
setne %r11b
orb %cl, %r11b
cmpl $0xb, %r14d
setb %cl
testb %cl, %r11b
je 0xb7ed
cmpl $0x0, 0x64(%r12)
movl 0x10(%rbx), %ecx
je 0xb7b5
cmpl $-0x1, %ecx
jne 0xb7da
xorl %r12d, %r12d
testq %rbx, %rbx
je 0xb7fc
movl $0x2, 0x1c(%rbx)
jmp 0xb7fc
xorl %ecx, %ecx
jmp 0xb71f
cmpl $0xffff, %ecx           # imm = 0xFFFF
setne %cl
movq %rax, %r11
orq %r10, %r11
shrq $0x20, %r11
sete %r11b
testb %cl, %r11b
jne 0xb7da
movl $0x1, 0x64(%r12)
movl %r13d, %ecx
shrl $0xa, %ecx
andl $0x1, %ecx
testq %rax, %rax
sete %al
orb %cl, %al
jne 0xb811
xorl %r12d, %r12d
testq %rbx, %rbx
je 0xb7fc
movl $0x18, 0x1c(%rbx)
movl %r12d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, -0xe0(%rbp)
cmpb $0x2f, (%rsi)
jne 0xb82e
xorl %r12d, %r12d
testq %rbx, %rbx
je 0xb7fc
movl $0x19, 0x1c(%rbx)
jmp 0xb7fc
movq 0x28(%rbp), %rax
movl 0x20(%rbp), %edx
movq %rdx, -0xd8(%rbp)
leaq -0x81(%rbp), %r11
leaq -0x82(%rbp), %rdx
movq %rdx, -0xf8(%rbp)
leaq -0x83(%rbp), %rdx
movq %rdx, -0xf0(%rbp)
orb %cl, -0x29(%rbp)
movq %rsi, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0xb87b
cmpl $0x3a, %edx
je 0xb81d
cmpl $0x5c, %edx
je 0xb81d
incq %rcx
jmp 0xb865
movq %r11, -0xe8(%rbp)
movq %r10, -0x60(%rbp)
movq %r9, -0xa8(%rbp)
movq %rsi, -0x68(%rbp)
movq %r8, -0x110(%rbp)
movq %rdi, -0x38(%rbp)
testq %rax, %rax
jne 0xb8b4
leaq -0xd0(%rbp), %rdi
callq 0x3210
leaq -0xd0(%rbp), %rax
movq (%rax), %rdi
leaq -0x2e(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0xc1cb
movq -0x68(%rbp), %rdi
callq 0x3110
cmpq $0x10000, %rax          # imm = 0x10000
jae 0xb81d
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0xb8ef
leal -0x1(%rdi), %edx
movl (%rbx), %ecx
andl %edx, %ecx
subl %ecx, %edi
andl %edx, %edi
jmp 0xb8f1
xorl %edi, %edi
movq -0x68(%rbp), %r10
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movq 0x8(%r12), %r11
movzwl %r15w, %r9d
movq %rax, -0x40(%rbp)
leaq (%r9,%rax), %rcx
leaq (%r11,%rcx), %rdx
addq $0x4a, %rdx
cmpq %rsi, %rdx
jbe 0xb930
xorl %r12d, %r12d
testq %rbx, %rbx
je 0xb7fc
movl $0xf, 0x1c(%rbx)
jmp 0xb7fc
cmpl $0x0, 0x64(%r12)
jne 0xb98b
movq (%rbx), %rdx
movl %edi, %esi
movl 0x38(%rbp), %eax
movq %rdi, %r15
movl %eax, %edi
movl 0x48(%rbp), %r8d
movl %r8d, %r8d
addq %rdi, %r8
movabsq $-0x100000000, %rdi     # imm = 0xFFFFFFFF00000000
movq %r9, %rax
addq %rdi, %r9
addq %r9, %r8
movq %rax, %r9
movq -0x40(%rbp), %rax
leaq (%r8,%rax,2), %r8
addq %rsi, %r8
addq %r11, %r8
addq %r8, %rdx
addq $0x72, %rdx
cmpq %rdi, %rdx
movq %r15, %rdi
jae 0xb98b
movl $0x1, 0x64(%r12)
xorl %esi, %esi
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0xb9b1
cmpb $0x2f, -0x1(%r10,%rax)
jne 0xb9b1
movl $0x10, %esi
movq 0x18(%rbp), %rdx
orq -0x60(%rbp), %rdx
jne 0xb7ed
movq %r9, -0x108(%rbp)
movq %rdi, %r15
movq %rsi, -0x100(%rbp)
cmpl $0x0, 0x64(%r12)
leaq (%rcx,%r11), %rsi
leaq 0x1c(%r11,%rcx), %rdx
cmoveq %rsi, %rdx
addq $0x2e, %rdx
cmpq %rdx, 0x10(%r12)
jae 0xb9f8
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %ecx
callq 0xffe4
testl %eax, %eax
je 0xbaf5
movq 0x28(%r12), %rdx
incq %rdx
cmpq %rdx, 0x30(%r12)
jae 0xba21
leaq 0x20(%r12), %rsi
movq %rbx, %rdi
movl $0x1, %ecx
callq 0xffe4
testl %eax, %eax
je 0xbaf5
cmpq $0x0, -0x60(%rbp)
sete %al
orb -0x29(%rbp), %al
je 0xba36
xorl %eax, %eax
movq -0x38(%rbp), %rsi
jmp 0xba54
movq 0x40(%rbx), %rdi
movl $0x1, %esi
movl $0x4df78, %edx          # imm = 0x4DF78
callq *0x28(%rbx)
testq %rax, %rax
movq -0x38(%rbp), %rsi
je 0xbaf5
movq %rax, -0x58(%rbp)
movq %rbx, %rdi
movl %r15d, %edx
callq 0xc227
testl %eax, %eax
je 0xbb0d
movl %r15d, %eax
movq -0x70(%rbp), %rsi
addq %rax, %rsi
movq %rsi, -0x70(%rbp)
movq 0x20(%rbx), %rcx
testq %rcx, %rcx
je 0xba8e
decq %rcx
testq %rsi, %rcx
jne 0xc18d
movl %r13d, %ecx
andl $0x400, %ecx            # imm = 0x400
movq -0x38(%rbp), %rdx
addq %rax, %rdx
xorps %xmm0, %xmm0
movups %xmm0, -0xc2(%rbp)
movaps %xmm0, -0xd0(%rbp)
xorl %r15d, %r15d
orl %r14d, %ecx
setne %r15b
movl %r15d, %edi
shll $0x3, %edi
cmpl $0x0, 0x64(%r12)
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
je 0xbb20
movq %rdx, -0x38(%rbp)
movq 0x18(%rbp), %rax
cmpq %rcx, %rax
ja 0xbc22
cmpq %rcx, %rsi
ja 0xbc22
movq $0x0, -0x50(%rbp)
xorl %ecx, %ecx
jmp 0xbc5d
xorl %r12d, %r12d
testq %rbx, %rbx
je 0xb7fc
movl $0x10, 0x1c(%rbx)
jmp 0xb7fc
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
xorl %r12d, %r12d
jmp 0xb7fc
cmpl $0x0, -0x44(%rbp)
jne 0xbd77
movq %rdx, %rax
shrq $0x20, %rax
jne 0xbd77
movq %rdx, -0x38(%rbp)
leaq -0xd0(%rbp), %rdx
movaps %xmm0, (%rdx)
movups %xmm0, 0xe(%rdx)
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
xorl %r12d, %r12d
testb %r15b, %r15b
movl $0x14, %eax
cmovel %r12d, %eax
movb %al, 0x4(%rdx)
movb %r12b, 0x5(%rdx)
movq -0xa8(%rbp), %rcx
movzwl %cx, %eax
movb %cl, 0x6(%rdx)
movb %ah, -0xc9(%rbp)
movzwl -0x2e(%rbp), %eax
movl %edi, -0x94(%rbp)
movb %dil, 0x8(%rdx)
movb %r12b, 0x9(%rdx)
movb %al, 0xa(%rdx)
movb %ah, -0xc5(%rbp)
movzwl -0x2c(%rbp), %eax
movb %al, 0xc(%rdx)
movb %ah, -0xc3(%rbp)
movl %r12d, 0x16(%rdx)
movq $0x0, 0xe(%rdx)
movq -0x40(%rbp), %rax
movb %al, 0x1a(%rdx)
movb %ah, -0xb5(%rbp)
movl 0x38(%rbp), %eax
movb %al, 0x1c(%rdx)
movb %ah, -0xb3(%rbp)
movq 0x60(%rbx), %rdi
movl $0x1e, %ecx
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xbee1
movq -0x38(%rbp), %rsi
addq $0x1e, %rsi
movq 0x60(%rbx), %rdi
movq %rsi, -0x38(%rbp)
movq -0x68(%rbp), %rdx
movq -0x40(%rbp), %r15
movq %r15, %rcx
callq *0x50(%rbx)
cmpq %r15, %rax
jne 0xbd67
movq -0x40(%rbp), %rax
addq %rax, -0x38(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0xa0(%rbp)
jmp 0xbd97
movl %edi, %r12d
xorl %edi, %edi
cmpq %rcx, %rax
leaq 0x18(%rbp), %rax
cmovbeq %rdi, %rax
leaq -0x48(%rbp), %rdx
cmovbeq %rdi, %rdx
cmpq %rcx, %rsi
leaq -0x70(%rbp), %rcx
cmovbeq %rdi, %rcx
leaq -0x130(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movq %rax, %rsi
callq 0xc2c3
movl %r12d, %edi
movl %eax, %ecx
xorps %xmm0, %xmm0
leaq -0xd0(%rbp), %rdx
movaps %xmm0, (%rdx)
movups %xmm0, 0xe(%rdx)
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
xorl %r12d, %r12d
testb %r15b, %r15b
movl $0x14, %eax
cmovel %r12d, %eax
movb %al, 0x4(%rdx)
movb %r12b, 0x5(%rdx)
movzwl -0xa8(%rbp), %eax
movb %al, 0x6(%rdx)
movb %ah, -0xc9(%rbp)
movzwl -0x2e(%rbp), %eax
movl %edi, -0x94(%rbp)
movb %dil, 0x8(%rdx)
movb %r12b, 0x9(%rdx)
movb %al, 0xa(%rdx)
movb %ah, -0xc5(%rbp)
movzwl -0x2c(%rbp), %eax
movb %al, 0xc(%rdx)
movb %ah, -0xc3(%rbp)
movl 0x38(%rbp), %eax
movq %rcx, -0xa0(%rbp)
leal (%rcx,%rax), %eax
movl %r12d, 0x16(%rdx)
movq $0x0, 0xe(%rdx)
movq -0x40(%rbp), %rcx
movb %cl, 0x1a(%rdx)
movb %ch, -0xb5(%rbp)
movb %al, 0x1c(%rdx)
movb %ah, -0xb3(%rbp)
movq 0x60(%rbx), %rdi
movq -0x70(%rbp), %rsi
movl $0x1e, %ecx
callq *0x50(%rbx)
cmpq $0x1e, %rax
jne 0xbee1
movq -0x38(%rbp), %r15
addq $0x1e, %r15
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movq -0x68(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq *0x50(%rbx)
movq -0x40(%rbp), %rcx
cmpq %rcx, %rax
jne 0xbd67
addq %rcx, %r15
movq %r15, -0x38(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xbd8f
movq 0x60(%rbx), %rdi
movl -0xa0(%rbp), %r12d
leaq -0x130(%rbp), %rdx
movq -0x38(%rbp), %rsi
movq %r12, %rcx
callq *0x50(%rbx)
cmpq %r12, %rax
jne 0xbede
addq %r12, -0x38(%rbp)
jmp 0xbd97
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
jmp 0xbee1
xorl %r12d, %r12d
testq %rbx, %rbx
je 0xb7fc
movl $0x1d, 0x1c(%rbx)
jmp 0xb7fc
movq $0x0, -0x50(%rbp)
movl 0x38(%rbp), %eax
testl %eax, %eax
je 0xbdc3
movq 0x60(%rbx), %rdi
movl 0x38(%rbp), %eax
movl %eax, %r12d
movq -0x38(%rbp), %rsi
movq 0x30(%rbp), %rdx
movq %r12, %rcx
callq *0x50(%rbx)
cmpq %r12, %rax
jne 0xbede
addq %r12, -0x38(%rbp)
btl $0xa, %r13d
jb 0xbdfb
xorl %r12d, %r12d
xorl %edi, %edi
movq -0xe0(%rbp), %rsi
movq -0x60(%rbp), %r15
movq %r15, %rdx
callq 0x3715
movq %rax, -0xd8(%rbp)
movq %r15, 0x18(%rbp)
cmpq $0x4, %r15
setb %al
cmovbl %r12d, %r14d
orb %al, -0x29(%rbp)
cmpb $0x0, -0x29(%rbp)
je 0xbe34
movq 0x60(%rbx), %rdi
movq -0x38(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq -0x60(%rbp), %r14
movq %r14, %rcx
callq *0x50(%rbx)
cmpq %r14, %rax
jne 0xbed3
movq -0x60(%rbp), %rax
addq %rax, -0x38(%rbp)
movq %rax, -0x48(%rbp)
jmp 0xbf17
cmpq $0x0, -0x60(%rbp)
je 0xbf17
leaq -0x90(%rbp), %rdx
movq %rbx, (%rdx)
movq -0x38(%rbp), %rax
movq %rax, 0x8(%rdx)
movq $0x0, 0x10(%rdx)
cmpl $0xa, %r14d
movl $0xa, %eax
cmovll %r14d, %eax
leaq 0xa693(%rip), %rcx      # 0x16500
xorl %esi, %esi
cmpl $0x4, %r14d
setl %sil
shll $0xe, %esi
orl (%rcx,%rax,4), %esi
movl %esi, %ecx
orl $0x80000, %ecx          # imm = 0x80000
testl %r14d, %r14d
cmovnel %esi, %ecx
leaq 0x488(%rip), %rsi       # 0xc31a
movq -0x58(%rbp), %r14
movq %r14, %rdi
callq 0x397f
movq %r14, %rdi
movq -0xe0(%rbp), %rsi
movq -0x60(%rbp), %rdx
movl $0x4, %ecx
callq 0x75b4
movl %eax, %r12d
cmpl $0x1, %eax
jne 0xbef6
movq -0x88(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xbf0d
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
xorl %r12d, %r12d
testq %rbx, %rbx
je 0xb7fc
movl $0x13, 0x1c(%rbx)
jmp 0xb7fc
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
testq %rbx, %rbx
je 0xbf0d
movl $0xc, 0x1c(%rbx)
cmpl $0x1, %r12d
jne 0xbb18
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
movq 0x18(%rbp), %rax
testq %rax, %rax
je 0xc0c0
movzwl -0xa8(%rbp), %ecx
testb $0x8, %cl
je 0xc1ac
movl $0x8074b50, -0x90(%rbp) # imm = 0x8074B50
movq -0xd8(%rbp), %rdx
movb %dl, -0x8c(%rbp)
movb %dh, -0x8b(%rbp)
movl %edx, %ecx
shrl $0x10, %ecx
movb %cl, -0x8a(%rbp)
movl %edx, %ecx
shrl $0x18, %ecx
movb %cl, -0x89(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xc018
movq -0x48(%rbp), %rcx
leaq -0x7c(%rbp), %rdi
movb %cl, -0xc(%rdi)
movb %ch, -0x87(%rbp)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, -0xa(%rdi)
movl %ecx, %edx
shrl $0x18, %edx
movb %dl, -0x9(%rdi)
movq %rcx, %rdx
shrq $0x20, %rdx
movb %dl, -0x8(%rdi)
movq %rcx, %rdx
shrq $0x28, %rdx
movb %dl, -0x7(%rdi)
movq %rcx, %rdx
shrq $0x30, %rdx
movb %dl, -0x6(%rdi)
shrq $0x38, %rcx
movb %cl, -0x5(%rdi)
movb %al, -0x4(%rdi)
movb %ah, -0x7f(%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, -0x2(%rdi)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, -0x1(%rdi)
movq %rax, %r8
shrq $0x20, %r8
movl $0x18, %r12d
movl $0x38, %esi
movl $0x30, %edx
movl $0x28, %ecx
leaq -0x7b(%rbp), %r9
movq %r9, -0xf0(%rbp)
leaq -0x7a(%rbp), %r9
movq %r9, -0xf8(%rbp)
leaq -0x79(%rbp), %r9
movq %r9, -0xe8(%rbp)
jmp 0xc05a
movq -0x48(%rbp), %rcx
movq %rcx, %rdx
shrq $0x20, %rdx
je 0xc038
testq %rbx, %rbx
je 0xc031
movl $0x1d, 0x1c(%rbx)
xorl %eax, %eax
jmp 0xc0b8
leaq -0x84(%rbp), %rdi
movl %ecx, -0x4(%rdi)
movl $0x18, %esi
movl $0x10, %edx
movl $0x8, %ecx
movq %rax, %r8
movl $0x10, %r12d
movb %r8b, (%rdi)
movq %rax, %rdi
shrq %cl, %rdi
movq %rax, %r8
movl %edx, %ecx
shrq %cl, %r8
movl %esi, %ecx
shrq %cl, %rax
movq -0xf0(%rbp), %rcx
movb %dil, (%rcx)
movq -0xf8(%rbp), %rcx
movb %r8b, (%rcx)
movq -0xe8(%rbp), %rcx
movb %al, (%rcx)
movq 0x60(%rbx), %rdi
leaq -0x90(%rbp), %rdx
movq -0x38(%rbp), %r14
movq %r14, %rsi
movq %r12, %rcx
callq *0x50(%rbx)
xorl %ecx, %ecx
cmpq %r12, %rax
sete %al
cmoveq %r12, %rcx
addq %rcx, %r14
movq %r14, -0x38(%rbp)
testb %al, %al
je 0xbb18
cmpq $0x0, -0x50(%rbp)
je 0xc0ff
xorl %ecx, %ecx
leaq 0x18(%rbp), %rsi
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
cmpq %rdi, (%rsi)
cmovbeq %rcx, %rsi
leaq -0x48(%rbp), %rdx
cmovbeq %rcx, %rdx
leaq -0x70(%rbp), %rax
cmpq %rdi, (%rax)
cmovaq %rax, %rcx
leaq -0x130(%rbp), %rdi
callq 0xc2c3
movq %rax, -0xa0(%rbp)
movzwl -0x2e(%rbp), %eax
movzwl -0x2c(%rbp), %r10d
movzwl -0xa8(%rbp), %r11d
movzwl -0x94(%rbp), %r14d
movl $0xffff, %edx           # imm = 0xFFFF
movq -0xa0(%rbp), %r8
andl %edx, %r8d
andl -0x40(%rbp), %edx
movq %rbx, %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rcx
movq -0x110(%rbp), %r9
movl 0x48(%rbp), %r12d
pushq %r12
pushq 0x40(%rbp)
pushq -0x100(%rbp)
pushq -0x70(%rbp)
pushq %r10
pushq %rax
pushq %r11
pushq %r14
pushq -0xd8(%rbp)
pushq -0x48(%rbp)
pushq 0x18(%rbp)
pushq -0x108(%rbp)
callq 0xc35b
addq $0x60, %rsp
testl %eax, %eax
je 0xbb18
incl 0x10(%rbx)
movq -0x38(%rbp), %rax
movq %rax, (%rbx)
movl $0x1, %r12d
jmp 0xb7fc
leaq 0xb0b3(%rip), %rdi      # 0x17247
leaq 0xafa3(%rip), %rsi      # 0x1713e
leaq 0xb0e7(%rip), %rcx      # 0x17289
movl $0x17fb, %edx           # imm = 0x17FB
callq 0x3170
leaq 0xb1a0(%rip), %rdi      # 0x17353
leaq 0xaf84(%rip), %rsi      # 0x1713e
leaq 0xb0c8(%rip), %rcx      # 0x17289
movl $0x1873, %edx           # imm = 0x1873
callq 0x3170