// File: /workspace/github_cpp_makefile_star2_O2/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, %r12d
movq %rcx, %r10
movq 0x18(%rbp), %rax
andw $0x0, -0x3c(%rbp)
andw $0x0, -0x3a(%rbp)
movl 0x10(%rbp), %ecx
movq (%rdi), %r9
movq %r9, -0x90(%rbp)
andq $0x0, -0x60(%rbp)
testl %ecx, %ecx
pushq $0x6
popq %r15
cmovnsl %ecx, %r15d
testq %rax, %rax
je 0xb45d
movl %r15d, %r13d
andl $0x400, %r13d           # imm = 0x400
movw $0x8, %cx
jmp 0xb47b
testq %r10, %r10
setne %cl
movl %r15d, %r13d
andl $0x400, %r13d           # imm = 0x400
sete %r11b
andb %cl, %r11b
movzbl %r11b, %ecx
shll $0x3, %ecx
movzwl %cx, %ebx
leal 0x800(%rbx), %ecx
btl $0x10, %r15d
cmovael %ecx, %ebx
andl $0xf, %r15d
sete -0x29(%rbp)
testl %r13d, %r13d
setne -0x58(%rbp)
movq 0x68(%rdi), %r14
testq %r14, %r14
je 0xb532
cmpl $0x2, 0x14(%rdi)
jne 0xb532
testq %r10, %r10
sete %cl
testq %rdx, %rdx
setne %r11b
testq %rsi, %rsi
je 0xb532
orb %cl, %r11b
je 0xb532
testw %r12w, %r12w
sete %cl
testq %r8, %r8
setne %r11b
orb %cl, %r11b
cmpl $0xb, %r15d
setb %cl
testb %cl, %r11b
je 0xb532
cmpl $0x0, 0x64(%r14)
movl 0x10(%rdi), %ecx
je 0xb4fe
cmpl $-0x1, %ecx
jne 0xb522
movl $0x2, 0x1c(%rdi)
jmp 0xb539
cmpl $0xffff, %ecx           # imm = 0xFFFF
setne %cl
movq %rax, %r11
orq %r10, %r11
shrq $0x20, %r11
sete %r11b
testb %cl, %r11b
jne 0xb522
movl $0x1, 0x64(%r14)
testl %r13d, %r13d
setne %cl
testq %rax, %rax
sete %al
orb %cl, %al
jne 0xb551
movl $0x18, 0x1c(%rdi)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, -0xf8(%rbp)
movq %r10, -0x68(%rbp)
movq %r9, -0x50(%rbp)
movq %r8, -0x110(%rbp)
movq %rdi, -0x38(%rbp)
movq %rsi, -0x70(%rbp)
movq %rsi, %rdi
callq 0xbec4
testl %eax, %eax
je 0xb5b8
movq 0x28(%rbp), %rax
testq %rax, %rax
jne 0xb597
leaq -0xf0(%rbp), %rdi
callq 0x3220
leaq -0xf0(%rbp), %rax
movq (%rax), %rdi
leaq -0x3c(%rbp), %rsi
leaq -0x3a(%rbp), %rdx
callq 0xbef0
movq -0x70(%rbp), %rdi
callq 0x3100
cmpq $0x10000, %rax          # imm = 0x10000
jb 0xb5c8
movq -0x38(%rbp), %rax
movl $0x19, 0x1c(%rax)
jmp 0xb539
movq -0x38(%rbp), %rdi
movq %rax, -0x88(%rbp)
callq 0xbf4c
movq 0x8(%r14), %r11
movzwl %r12w, %r12d
movq -0x88(%rbp), %rcx
addq %r12, %rcx
leaq (%r11,%rcx), %rdx
addq $0x4a, %rdx
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
cmpq %rsi, %rdx
jbe 0xb60c
movq -0x38(%rbp), %rax
movl $0xf, 0x1c(%rax)
jmp 0xb539
movl 0x48(%rbp), %r9d
movl 0x38(%rbp), %esi
pushq $0x1c
popq %rdx
cmpl $0x0, 0x64(%r14)
movl %eax, -0x80(%rbp)
movl %eax, %r8d
movl %esi, %eax
movq %r8, -0x48(%rbp)
je 0xb62f
movq -0x38(%rbp), %rdi
jmp 0xb688
movq -0x38(%rbp), %rdi
movq (%rdi), %rsi
movq %rsi, -0x78(%rbp)
movl %r9d, %r10d
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
leaq (%r12,%rsi), %r9
addq %rax, %r9
addq %r9, %r10
movq -0x88(%rbp), %r9
leaq (%r10,%r9,2), %r9
addq %r8, %r9
addq %r11, %r9
movq -0x78(%rbp), %rsi
addq %r9, %rsi
addq $0x72, %rsi
movabsq $-0x100000000, %r8      # imm = 0xFFFFFFFF00000000
cmpq %r8, %rsi
jae 0xb686
movl $0x1, 0x64(%r14)
jmp 0xb688
xorl %edx, %edx
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %r10
xorl %r9d, %r9d
movq -0x88(%rbp), %r8
testq %r8, %r8
je 0xb6b8
cmpb $0x2f, -0x1(%rsi,%r8)
jne 0xb6b8
movq 0x18(%rbp), %rsi
orq %r10, %rsi
jne 0xb532
pushq $0x10
popq %r9
movq %rax, -0x78(%rbp)
movq %r9, -0x108(%rbp)
addq %r11, %rcx
addq %rcx, %rdx
addq $0x2e, %rdx
cmpq %rdx, 0x10(%r14)
jae 0xb6ea
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0xf595
movq -0x38(%rbp), %rdi
testl %eax, %eax
je 0xb862
movq 0x28(%r14), %rdx
incq %rdx
cmpq %rdx, 0x30(%r14)
jae 0xb70f
leaq 0x20(%r14), %rsi
pushq $0x1
popq %rcx
callq 0xf595
movq -0x38(%rbp), %rdi
testl %eax, %eax
je 0xb862
movb -0x29(%rbp), %cl
orb -0x58(%rbp), %cl
cmpq $0x0, -0x68(%rbp)
sete %al
movb %cl, -0x29(%rbp)
orb %cl, %al
je 0xb72c
xorl %eax, %eax
movq -0x50(%rbp), %rsi
jmp 0xb750
movq 0x40(%rdi), %rdi
pushq $0x1
popq %rsi
movl $0x4df78, %edx          # imm = 0x4DF78
movq -0x38(%rbp), %rax
callq *0x28(%rax)
movq -0x38(%rbp), %rdi
testq %rax, %rax
movq -0x50(%rbp), %rsi
je 0xb862
movq %rax, -0x58(%rbp)
movq %r12, -0x100(%rbp)
movl -0x80(%rbp), %edx
movq %rdi, %r12
callq 0xbf6a
testl %eax, %eax
je 0xb86e
movq -0x90(%rbp), %rsi
movq -0x48(%rbp), %rcx
addq %rcx, %rsi
movq %rsi, -0x90(%rbp)
movq 0x20(%r12), %rax
testq %rax, %rax
movq %r12, %r8
je 0xb79c
decq %rax
testq %rsi, %rax
jne 0xbe86
movq -0x50(%rbp), %rdx
addq %rcx, %rdx
xorps %xmm0, %xmm0
movups %xmm0, -0xe2(%rbp)
movaps %xmm0, -0xf0(%rbp)
xorl %r12d, %r12d
movl %r13d, %eax
orl %r15d, %eax
setne %r12b
movl %r12d, %r9d
shll $0x3, %r9d
cmpl $0x0, 0x64(%r14)
movzwl %bx, %eax
movq %rax, -0x80(%rbp)
pushq $0x14
popq %r10
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
je 0xb881
movq %rdx, -0x50(%rbp)
movq 0x18(%rbp), %rax
cmpq %rcx, %rax
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
seta %cl
cmpq %rdi, %rsi
seta %dl
orb %cl, %dl
xorl %r11d, %r11d
cmpb $0x1, %dl
jne 0xb8aa
xorl %ecx, %ecx
cmpq %rdi, %rax
leaq 0x18(%rbp), %rax
cmovbeq %rcx, %rax
leaq -0x60(%rbp), %rdx
cmovbeq %rcx, %rdx
cmpq %rdi, %rsi
leaq -0x90(%rbp), %rsi
cmovaq %rsi, %rcx
leaq -0x130(%rbp), %rdi
movq %rdi, -0x48(%rbp)
movq %rax, %rsi
movl %r9d, %r14d
movl %r10d, %ebx
callq 0xbffa
xorl %r11d, %r11d
movl %ebx, %r10d
movl %r14d, %r9d
movq -0x38(%rbp), %r8
movl %eax, %r14d
leaq -0x90(%rbp), %rax
movq (%rax), %rsi
jmp 0xb8b5
movl $0x10, 0x1c(%rdi)
jmp 0xb539
movq 0x40(%r12), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%r12)
jmp 0xb539
cmpl $0x0, -0x5c(%rbp)
setne %al
movq %rdx, %rcx
shrq $0x20, %rcx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xb9ca
movl $0x1d, 0x1c(%r8)
jmp 0xb539
movq $0x0, -0x48(%rbp)
xorl %r14d, %r14d
movl 0x38(%rbp), %eax
leal (%r14,%rax), %edi
movzwl -0x3c(%rbp), %eax
movzwl -0x3a(%rbp), %ebx
leaq -0xf0(%rbp), %rdx
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
testb %r12b, %r12b
cmovel %r11d, %r10d
movb %r10b, 0x4(%rdx)
movb %r11b, 0x5(%rdx)
movq -0x80(%rbp), %rcx
movb %cl, 0x6(%rdx)
movb %ch, -0xe9(%rbp)
movl %r9d, -0xbc(%rbp)
movb %r9b, 0x8(%rdx)
movb %r11b, 0x9(%rdx)
movb %al, 0xa(%rdx)
movl %eax, -0xb8(%rbp)
movb %ah, -0xe5(%rbp)
movb %bl, 0xc(%rdx)
movl %ebx, -0xb4(%rbp)
movb %bh, -0xe3(%rbp)
andq $0x0, 0xe(%rdx)
andl $0x0, 0x16(%rdx)
movq -0x88(%rbp), %rax
movb %al, 0x1a(%rdx)
movq %rax, %r12
movb %ah, -0xd5(%rbp)
movl %edi, %eax
movb %al, 0x1c(%rdx)
movb %ah, -0xd3(%rbp)
movq 0x60(%r8), %rdi
pushq $0x1e
popq %rcx
movq %r8, %rbx
callq *0x50(%r8)
cmpq $0x1e, %rax
jne 0xbc78
movq %r14, -0xc8(%rbp)
movq -0x50(%rbp), %r14
addq $0x1e, %r14
movq 0x60(%rbx), %rdi
movq %r14, %rsi
movq -0x70(%rbp), %rdx
movq %r12, %rcx
callq *0x50(%rbx)
cmpq %r12, %rax
jne 0xbc6d
addq %r12, %r14
cmpq $0x0, -0x48(%rbp)
movq %r14, %rsi
je 0xbaa2
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rdi
movl -0xc8(%rbp), %r14d
leaq -0x130(%rbp), %rdx
movq %r14, %rcx
movq %rsi, %rbx
callq *0x50(%rax)
cmpq %r14, %rax
jne 0xbae1
addq %r14, %rbx
movq -0x38(%rbp), %rax
movq %rbx, %rsi
jmp 0xbaae
movq %rdx, -0x50(%rbp)
movzwl -0x3c(%rbp), %ecx
movzwl -0x3a(%rbp), %ebx
leaq -0xf0(%rbp), %rdx
xorl %r14d, %r14d
testb %r12b, %r12b
cmovel %r14d, %r10d
movl $0x4034b50, (%rdx)      # imm = 0x4034B50
movb %r10b, 0x4(%rdx)
movq -0x80(%rbp), %rax
movb %al, 0x6(%rdx)
movb %ah, -0xe9(%rbp)
movl %r9d, -0xbc(%rbp)
movb %r9b, 0x8(%rdx)
movb %cl, 0xa(%rdx)
movl %ecx, -0xb8(%rbp)
movb %ch, -0xe5(%rbp)
movb %bl, 0xc(%rdx)
movl %ebx, -0xb4(%rbp)
movb %bh, -0xe3(%rbp)
andq $0x0, 0xe(%rdx)
andl $0x0, 0x16(%rdx)
movq -0x88(%rbp), %rax
movb %al, 0x1a(%rdx)
movq %rax, %r12
movb %ah, -0xd5(%rbp)
movl 0x38(%rbp), %eax
movb %al, 0x1c(%rdx)
movb %ah, -0xd3(%rbp)
movq 0x60(%r8), %rdi
pushq $0x1e
popq %rcx
movq %r8, %rbx
callq *0x50(%r8)
cmpq $0x1e, %rax
jne 0xbb00
movq -0x50(%rbp), %rsi
addq $0x1e, %rsi
movq 0x60(%rbx), %rdi
movq %rsi, -0x50(%rbp)
movq -0x70(%rbp), %rdx
movq %r12, %rcx
callq *0x50(%rbx)
cmpq %r12, %rax
jne 0xbaf1
movq -0x50(%rbp), %rsi
addq %r12, %rsi
movq $0x0, -0x48(%rbp)
movq $0x0, -0xc8(%rbp)
jmp 0xbaaa
movq $0x0, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq -0x78(%rbp), %rcx
movl 0x38(%rbp), %edx
testl %edx, %edx
je 0xbad6
movq 0x30(%rbp), %rdx
movq 0x60(%rax), %rdi
movq %rsi, %rbx
callq *0x50(%rax)
movq -0x78(%rbp), %rcx
cmpq %rcx, %rax
jne 0xbae1
addq %rcx, %rbx
movq %rbx, %rsi
testl %r13d, %r13d
je 0xbb0c
movl 0x20(%rbp), %r13d
jmp 0xbb43
movq -0x38(%rbp), %rax
movl $0x13, 0x1c(%rax)
jmp 0xb539
movq -0x38(%rbp), %rbx
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
movl $0x13, 0x1c(%rbx)
jmp 0xb53c
movq %rsi, %rbx
xorl %edi, %edi
movq -0xf8(%rbp), %rsi
movq -0x68(%rbp), %r14
movq %r14, %rdx
callq 0x36e2
movq %rax, %r13
movq %r14, 0x18(%rbp)
cmpq $0x4, %r14
setae %al
movb -0x29(%rbp), %cl
xorb $0x1, %cl
testb %cl, %al
jne 0xbc84
movq %rbx, %rsi
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0xf8(%rbp), %rdx
movq -0x68(%rbp), %rbx
movq %rbx, %rcx
movq %rsi, %r15
callq *0x50(%rax)
cmpq %rbx, %rax
jne 0xbc69
addq %rbx, %r15
movq %rbx, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rax)
movq 0x18(%rbp), %rbx
testq %rbx, %rbx
je 0xbcf8
testb $0x8, -0x80(%rbp)
je 0xbea5
movl $0x8074b50, -0xb0(%rbp) # imm = 0x8074B50
movq %r13, %rcx
movb %cl, -0xac(%rbp)
movb %ch, -0xab(%rbp)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, -0xaa(%rbp)
movl %ecx, %eax
shrl $0x18, %eax
movb %al, -0xa9(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xbcff
leaq -0x99(%rbp), %rsi
leaq -0x9a(%rbp), %rdi
leaq -0x9b(%rbp), %r8
movq -0x60(%rbp), %rax
movb %al, -0xd(%r8)
movb %ah, -0xa7(%rbp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, -0xb(%r8)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, -0xa(%r8)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, -0x9(%r8)
movq %rax, %rcx
shrq $0x28, %rcx
movb %cl, -0x8(%r8)
movq %rax, %rcx
shrq $0x30, %rcx
movb %cl, -0x7(%r8)
shrq $0x38, %rax
movb %al, -0x6(%r8)
movb %bl, -0x5(%r8)
movb %bh, -0x9f(%rbp)
movl %ebx, %eax
shrl $0x10, %eax
movb %al, -0x3(%r8)
movl %ebx, %eax
shrl $0x18, %eax
movb %al, -0x2(%r8)
leaq -0x9c(%rbp), %r9
movq %rbx, %r10
shrq $0x20, %r10
pushq $0x18
popq %r14
pushq $0x38
popq %rax
pushq $0x30
popq %rdx
pushq $0x28
popq %rcx
jmp 0xbd66
movq -0x38(%rbp), %rbx
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
movl $0x13, 0x1c(%rbx)
jmp 0xb539
leaq -0xb0(%rbp), %r12
movq -0x38(%rbp), %rax
movq %rax, (%r12)
movq %rbx, 0x8(%r12)
andq $0x0, 0x10(%r12)
pushq $-0xf
popq %rsi
xorl %r14d, %r14d
movl %r15d, %edi
xorl %edx, %edx
callq 0x38b4
leaq 0x39c(%rip), %rsi       # 0xc051
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
movl %eax, %ecx
callq 0x3932
pushq $0x4
popq %rcx
movq %rbx, %rdi
movq -0xf8(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x72f1
cmpl $0x1, %eax
jne 0xbd1c
movq -0xa8(%rbp), %r15
movq -0xa0(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0xbb6f
xorl %eax, %eax
jmp 0xbdac
movq -0x60(%rbp), %rax
movq %rax, %rcx
shrq $0x20, %rcx
je 0xbd37
movq -0x38(%rbp), %rax
movl $0x1d, 0x1c(%rax)
jmp 0xb539
movq -0x38(%rbp), %rbx
movq 0x40(%rbx), %rdi
movq -0x58(%rbp), %rsi
callq *0x30(%rbx)
movl $0xc, 0x1c(%rbx)
jmp 0xb53c
leaq -0xa1(%rbp), %rsi
leaq -0xa2(%rbp), %rdi
leaq -0xa3(%rbp), %r8
movl %eax, -0x5(%r8)
pushq $0x18
popq %rax
pushq $0x10
popq %rdx
pushq $0x8
popq %rcx
leaq -0xa4(%rbp), %r9
movq %rbx, %r10
movq %rdx, %r14
movb %r10b, (%r9)
movq %rbx, %r9
shrq %cl, %r9
movq %rbx, %r10
movl %edx, %ecx
shrq %cl, %r10
movl %eax, %ecx
shrq %cl, %rbx
movb %r9b, (%r8)
movb %r10b, (%rdi)
movb %bl, (%rsi)
movq -0x38(%rbp), %rax
movq 0x60(%rax), %rdi
leaq -0xb0(%rbp), %rdx
movq %r15, %rsi
movq %r14, %rcx
callq *0x50(%rax)
cmpq %r14, %rax
jne 0xb539
addq %r14, %r15
movq 0x18(%rbp), %rax
movq 0x40(%rbp), %rbx
cmpq $0x0, -0x48(%rbp)
je 0xbdfa
xorl %ecx, %ecx
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
cmpq %rdi, %rax
leaq 0x18(%rbp), %r14
movl $0x0, %esi
cmovaq %r14, %rsi
leaq -0x60(%rbp), %rdx
cmovbeq %rcx, %rdx
leaq -0x90(%rbp), %rax
cmpq %rdi, (%rax)
cmovaq %rax, %rcx
leaq -0x130(%rbp), %rdi
callq 0xbffa
movq %rax, -0xc8(%rbp)
movq (%r14), %rax
movzwl -0xb4(%rbp), %r10d
movzwl -0xb8(%rbp), %r11d
movzwl -0xbc(%rbp), %r14d
movl $0xffff, %edx           # imm = 0xFFFF
movq -0xc8(%rbp), %r8
andl %edx, %r8d
andl -0x88(%rbp), %edx
movq -0x38(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x48(%rbp), %rcx
movq -0x110(%rbp), %r9
movl 0x48(%rbp), %r12d
pushq %r12
pushq %rbx
pushq -0x108(%rbp)
pushq -0x90(%rbp)
pushq %r10
pushq %r11
pushq -0x80(%rbp)
pushq %r14
pushq %r13
pushq -0x60(%rbp)
pushq %rax
pushq -0x100(%rbp)
callq 0xc090
addq $0x60, %rsp
testl %eax, %eax
je 0xb539
movq -0x38(%rbp), %rax
incl 0x10(%rax)
movq %r15, (%rax)
pushq $0x1
popq %r14
jmp 0xb53c
leaq 0xa39a(%rip), %rdi      # 0x16227
leaq 0xa28a(%rip), %rsi      # 0x1611e
leaq 0xa3ce(%rip), %rcx      # 0x16269
movl $0x17fb, %edx           # imm = 0x17FB
callq 0x3190
leaq 0xa487(%rip), %rdi      # 0x16333
leaq 0xa26b(%rip), %rsi      # 0x1611e
leaq 0xa3af(%rip), %rcx      # 0x16269
movl $0x1873, %edx           # imm = 0x1873
callq 0x3190