// File: jimmiebergmann[P]fbx-file/miniz.c
// Function: tdefl_compress_fast(tdefl_compressor*)
static mz_bool tdefl_compress_fast(tdefl_compressor *d)
{
    /* Faster, minimally featured LZRW1-style match+parse loop with better register utilization. Intended for applications where raw throughput is valued more highly than ratio. */
    mz_uint lookahead_pos = d->m_lookahead_pos, lookahead_size = d->m_lookahead_size, dict_size = d->m_dict_size, total_lz_bytes = d->m_total_lz_bytes, num_flags_left = d->m_num_flags_left;
    mz_uint8 *pLZ_code_buf = d->m_pLZ_code_buf, *pLZ_flags = d->m_pLZ_flags;
    mz_uint cur_pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK;

    while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size)))
    {
        const mz_uint TDEFL_COMP_FAST_LOOKAHEAD_SIZE = 4096;
        mz_uint dst_pos = (lookahead_pos + lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK;
        mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(d->m_src_buf_left, TDEFL_COMP_FAST_LOOKAHEAD_SIZE - lookahead_size);
        d->m_src_buf_left -= num_bytes_to_process;
        lookahead_size += num_bytes_to_process;

        while (num_bytes_to_process)
        {
            mz_uint32 n = MZ_MIN(TDEFL_LZ_DICT_SIZE - dst_pos, num_bytes_to_process);
            memcpy(d->m_dict + dst_pos, d->m_pSrc, n);
            if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
                memcpy(d->m_dict + TDEFL_LZ_DICT_SIZE + dst_pos, d->m_pSrc, MZ_MIN(n, (TDEFL_MAX_MATCH_LEN - 1) - dst_pos));
            d->m_pSrc += n;
            dst_pos = (dst_pos + n) & TDEFL_LZ_DICT_SIZE_MASK;
            num_bytes_to_process -= n;
        }

        dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - lookahead_size, dict_size);
        if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE))
            break;

        while (lookahead_size >= 4)
        {
            mz_uint cur_match_dist, cur_match_len = 1;
            mz_uint8 *pCur_dict = d->m_dict + cur_pos;
            mz_uint first_trigram = (*(const mz_uint32 *)pCur_dict) & 0xFFFFFF;
            mz_uint hash = (first_trigram ^ (first_trigram >> (24 - (TDEFL_LZ_HASH_BITS - 8)))) & TDEFL_LEVEL1_HASH_SIZE_MASK;
            mz_uint probe_pos = d->m_hash[hash];
            d->m_hash[hash] = (mz_uint16)lookahead_pos;

            if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <= dict_size) && ((*(const mz_uint32 *)(d->m_dict + (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) & 0xFFFFFF) == first_trigram))
            {
                const mz_uint16 *p = (const mz_uint16 *)pCur_dict;
                const mz_uint16 *q = (const mz_uint16 *)(d->m_dict + probe_pos);
                mz_uint32 probe_len = 32;
                do
                {
                } while ((TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) &&
                         (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
                cur_match_len = ((mz_uint)(p - (const mz_uint16 *)pCur_dict) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q);
                if (!probe_len)
                    cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0;

                if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)))
                {
                    cur_match_len = 1;
                    *pLZ_code_buf++ = (mz_uint8)first_trigram;
                    *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
                    d->m_huff_count[0][(mz_uint8)first_trigram]++;
                }
                else
                {
                    mz_uint32 s0, s1;
                    cur_match_len = MZ_MIN(cur_match_len, lookahead_size);

                    MZ_ASSERT((cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) && (cur_match_dist <= TDEFL_LZ_DICT_SIZE));

                    cur_match_dist--;

                    pLZ_code_buf[0] = (mz_uint8)(cur_match_len - TDEFL_MIN_MATCH_LEN);
                    *(mz_uint16 *)(&pLZ_code_buf[1]) = (mz_uint16)cur_match_dist;
                    pLZ_code_buf += 3;
                    *pLZ_flags = (mz_uint8)((*pLZ_flags >> 1) | 0x80);

                    s0 = s_tdefl_small_dist_sym[cur_match_dist & 511];
                    s1 = s_tdefl_large_dist_sym[cur_match_dist >> 8];
                    d->m_huff_count[1][(cur_match_dist < 512) ? s0 : s1]++;

                    d->m_huff_count[0][s_tdefl_len_sym[cur_match_len - TDEFL_MIN_MATCH_LEN]]++;
                }
            }
            else
            {
                *pLZ_code_buf++ = (mz_uint8)first_trigram;
                *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
                d->m_huff_count[0][(mz_uint8)first_trigram]++;
            }

            if (--num_flags_left == 0)
            {
                num_flags_left = 8;
                pLZ_flags = pLZ_code_buf++;
            }

            total_lz_bytes += cur_match_len;
            lookahead_pos += cur_match_len;
            dict_size = MZ_MIN(dict_size + cur_match_len, (mz_uint)TDEFL_LZ_DICT_SIZE);
            cur_pos = (cur_pos + cur_match_len) & TDEFL_LZ_DICT_SIZE_MASK;
            MZ_ASSERT(lookahead_size >= cur_match_len);
            lookahead_size -= cur_match_len;

            if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8])
            {
                int n;
                d->m_lookahead_pos = lookahead_pos;
                d->m_lookahead_size = lookahead_size;
                d->m_dict_size = dict_size;
                d->m_total_lz_bytes = total_lz_bytes;
                d->m_pLZ_code_buf = pLZ_code_buf;
                d->m_pLZ_flags = pLZ_flags;
                d->m_num_flags_left = num_flags_left;
                if ((n = tdefl_flush_block(d, 0)) != 0)
                    return (n < 0) ? MZ_FALSE : MZ_TRUE;
                total_lz_bytes = d->m_total_lz_bytes;
                pLZ_code_buf = d->m_pLZ_code_buf;
                pLZ_flags = d->m_pLZ_flags;
                num_flags_left = d->m_num_flags_left;
            }
        }

        while (lookahead_size)
        {
            mz_uint8 lit = d->m_dict[cur_pos];

            total_lz_bytes++;
            *pLZ_code_buf++ = lit;
            *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
            if (--num_flags_left == 0)
            {
                num_flags_left = 8;
                pLZ_flags = pLZ_code_buf++;
            }

            d->m_huff_count[0][lit]++;

            lookahead_pos++;
            dict_size = MZ_MIN(dict_size + 1, (mz_uint)TDEFL_LZ_DICT_SIZE);
            cur_pos = (cur_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK;
            lookahead_size--;

            if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8])
            {
                int n;
                d->m_lookahead_pos = lookahead_pos;
                d->m_lookahead_size = lookahead_size;
                d->m_dict_size = dict_size;
                d->m_total_lz_bytes = total_lz_bytes;
                d->m_pLZ_code_buf = pLZ_code_buf;
                d->m_pLZ_flags = pLZ_flags;
                d->m_num_flags_left = num_flags_left;
                if ((n = tdefl_flush_block(d, 0)) != 0)
                    return (n < 0) ? MZ_FALSE : MZ_TRUE;
                total_lz_bytes = d->m_total_lz_bytes;
                pLZ_code_buf = d->m_pLZ_code_buf;
                pLZ_flags = d->m_pLZ_flags;
                num_flags_left = d->m_num_flags_left;
            }
        }
    }

    d->m_lookahead_pos = lookahead_pos;
    d->m_lookahead_size = lookahead_size;
    d->m_dict_size = dict_size;
    d->m_total_lz_bytes = total_lz_bytes;
    d->m_pLZ_code_buf = pLZ_code_buf;
    d->m_pLZ_flags = pLZ_flags;
    d->m_num_flags_left = num_flags_left;
    return MZ_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rcx
movb $0x1, %al
cmpq $0x0, 0xb8(%rcx)
movb %al, -0x99(%rbp)
jne 0x7e08
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0xa8(%rcx)
movb %al, -0x9a(%rbp)
je 0x7dfc
cmpl $0x0, -0x18(%rbp)
setne %al
movb %al, -0x9a(%rbp)
movb -0x9a(%rbp), %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x7e17
jmp 0x8765
movl $0x1000, -0x40(%rbp)    # imm = 0x1000
movl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rax
movl $0x1000, %ecx           # imm = 0x1000
subl -0x18(%rbp), %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x7e5a
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0x7e6b
movl $0x1000, %eax           # imm = 0x1000
subl -0x18(%rbp), %eax
movl %eax, %eax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0xb8(%rax)
movl -0x48(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0x7fac
movl $0x8000, %eax           # imm = 0x8000
subl -0x44(%rbp), %eax
cmpl -0x48(%rbp), %eax
jae 0x7ebf
movl $0x8000, %eax           # imm = 0x8000
subl -0x44(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x7ec8
movl -0x48(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rdi
addq $0xc8, %rdi
movl -0x44(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rsi
movl -0x4c(%rbp), %eax
movl %eax, %edx
callq 0x3280
cmpl $0x101, -0x44(%rbp)     # imm = 0x101
jae 0x7f74
movq -0x10(%rbp), %rax
addq $0xc8, %rax
addq $0x8000, %rax           # imm = 0x8000
movl -0x44(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0xb8(%rbp)
movl -0x4c(%rbp), %eax
movl $0x101, %ecx            # imm = 0x101
subl -0x44(%rbp), %ecx
cmpl %ecx, %eax
jae 0x7f49
movl -0x4c(%rbp), %eax
movl %eax, -0xc4(%rbp)
jmp 0x7f57
movl $0x101, %eax            # imm = 0x101
subl -0x44(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0xb8(%rbp), %rsi
movq -0xc0(%rbp), %rdi
movl -0xc4(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
callq 0x3280
movl -0x4c(%rbp), %edx
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rcx
movl %edx, %edx
addq %rdx, %rcx
movq %rcx, 0xb0(%rax)
movl -0x44(%rbp), %eax
addl -0x4c(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x44(%rbp)
movl -0x4c(%rbp), %ecx
movl -0x48(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x48(%rbp)
jmp 0x7e98
movl $0x8000, %eax           # imm = 0x8000
subl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x7fc9
movl $0x8000, %eax           # imm = 0x8000
subl -0x18(%rbp), %eax
movl %eax, -0xc8(%rbp)
jmp 0x7fd2
movl -0x1c(%rbp), %eax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xa8(%rax)
jne 0x7ff6
cmpl $0x1000, -0x18(%rbp)    # imm = 0x1000
jae 0x7ff6
jmp 0x8765
jmp 0x7ff8
cmpl $0x4, -0x18(%rbp)
jb 0x85ac
movl $0x1, -0x54(%rbp)
movq -0x10(%rbp), %rax
addq $0xc8, %rax
movl -0x3c(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl (%rax), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl -0x64(%rbp), %ecx
shrl $0x11, %ecx
xorl %ecx, %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl -0x68(%rbp), %ecx
movzwl 0x292aa(%rax,%rcx,2), %eax
movl %eax, -0x6c(%rbp)
movl -0x14(%rbp), %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movl -0x68(%rbp), %ecx
movw %dx, 0x292aa(%rax,%rcx,2)
movl -0x14(%rbp), %eax
subl -0x6c(%rbp), %eax
movzwl %ax, %eax
movl %eax, -0x50(%rbp)
cmpl -0x1c(%rbp), %eax
ja 0x83ef
movq -0x10(%rbp), %rax
movl -0x6c(%rbp), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movl %ecx, -0x6c(%rbp)
movl %ecx, %ecx
movl 0xc8(%rax,%rcx), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
cmpl -0x64(%rbp), %eax
jne 0x83ef
movq -0x60(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
addq $0xc8, %rax
movl -0x6c(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movl $0x20, -0x84(%rbp)
jmp 0x80c9
movq -0x78(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x78(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x80(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x80(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xc9(%rbp)
jne 0x81b0
movq -0x78(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x78(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x80(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x80(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xc9(%rbp)
jne 0x81b0
movq -0x78(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x78(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x80(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x80(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xc9(%rbp)
jne 0x81b0
movq -0x78(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x78(%rbp)
movzwl 0x2(%rax), %ecx
movq -0x80(%rbp), %rax
movq %rax, %rdx
addq $0x2, %rdx
movq %rdx, -0x80(%rbp)
movzwl 0x2(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xc9(%rbp)
jne 0x81b0
movl -0x84(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x84(%rbp)
cmpl $0x0, %eax
seta %al
movb %al, -0xc9(%rbp)
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x80c7
movq -0x78(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
sarq %rax
shll %eax
movq -0x78(%rbp), %rcx
movzbl (%rcx), %ecx
movq -0x80(%rbp), %rdx
movzbl (%rdx), %edx
cmpl %edx, %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x84(%rbp)
jne 0x8208
movl -0x50(%rbp), %edx
xorl %eax, %eax
movl $0x102, %ecx            # imm = 0x102
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x54(%rbp)
cmpl $0x3, -0x54(%rbp)
jb 0x821d
cmpl $0x3, -0x54(%rbp)
jne 0x826e
cmpl $0x2000, -0x50(%rbp)    # imm = 0x2000
jb 0x826e
movl $0x1, -0x54(%rbp)
movl -0x64(%rbp), %eax
movb %al, %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
sarl %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl -0x64(%rbp), %ecx
movzbl %cl, %ecx
movw 0x81ca(%rax,%rcx,2), %dx
addw $0x1, %dx
movw %dx, 0x81ca(%rax,%rcx,2)
jmp 0x83ed
movl -0x54(%rbp), %eax
cmpl -0x18(%rbp), %eax
jae 0x8281
movl -0x54(%rbp), %eax
movl %eax, -0xd0(%rbp)
jmp 0x828a
movl -0x18(%rbp), %eax
movl %eax, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
movl %eax, -0x54(%rbp)
xorl %eax, %eax
cmpl $0x3, -0x54(%rbp)
movb %al, -0xd1(%rbp)
jb 0x82bf
xorl %eax, %eax
cmpl $0x1, -0x50(%rbp)
movb %al, -0xd1(%rbp)
jb 0x82bf
cmpl $0x8000, -0x50(%rbp)    # imm = 0x8000
setbe %al
movb %al, -0xd1(%rbp)
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x82cb
jmp 0x82cd
jmp 0x82ec
leaq 0x2e484(%rip), %rdi     # 0x36758
leaq 0x2de43(%rip), %rsi     # 0x3611e
movl $0x5f2, %edx            # imm = 0x5F2
leaq 0x2e4db(%rip), %rcx     # 0x367c2
callq 0x31d0
movl -0x50(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x50(%rbp)
movl -0x54(%rbp), %eax
subl $0x3, %eax
movb %al, %cl
movq -0x30(%rbp), %rax
movb %cl, (%rax)
movl -0x50(%rbp), %eax
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, 0x1(%rax)
movq -0x30(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
sarl %eax
orl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movl -0x50(%rbp), %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, %eax
movl %eax, %ecx
leaq 0x2d4fa(%rip), %rax     # 0x35840
movzbl (%rax,%rcx), %eax
movl %eax, -0x88(%rbp)
movl -0x50(%rbp), %eax
shrl $0x8, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x2d6df(%rip), %rax     # 0x35a40
movzbl (%rax,%rcx), %eax
movl %eax, -0x8c(%rbp)
movq -0x10(%rbp), %rax
addq $0x81ca, %rax           # imm = 0x81CA
addq $0x240, %rax            # imm = 0x240
movq %rax, -0xe0(%rbp)
cmpl $0x200, -0x50(%rbp)     # imm = 0x200
jae 0x8399
movl -0x88(%rbp), %eax
movl %eax, -0xe4(%rbp)
jmp 0x83a5
movl -0x8c(%rbp), %eax
movl %eax, -0xe4(%rbp)
movq -0xe0(%rbp), %rax
movl -0xe4(%rbp), %ecx
movl %ecx, %ecx
movw (%rax,%rcx,2), %dx
addw $0x1, %dx
movw %dx, (%rax,%rcx,2)
movq -0x10(%rbp), %rax
movl -0x54(%rbp), %ecx
subl $0x3, %ecx
movl %ecx, %ecx
movl %ecx, %edx
leaq 0x2d6eb(%rip), %rcx     # 0x35ac0
movzwl (%rcx,%rdx,2), %ecx
movw 0x81ca(%rax,%rcx,2), %dx
addw $0x1, %dx
movw %dx, 0x81ca(%rax,%rcx,2)
jmp 0x8434
movl -0x64(%rbp), %eax
movb %al, %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
sarl %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl -0x64(%rbp), %ecx
movzbl %cl, %ecx
movw 0x81ca(%rax,%rcx,2), %dx
addw $0x1, %dx
movw %dx, 0x81ca(%rax,%rcx,2)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jne 0x845c
movl $0x8, -0x24(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movl -0x54(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x54(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
addl -0x54(%rbp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jae 0x8489
movl -0x1c(%rbp), %eax
addl -0x54(%rbp), %eax
movl %eax, -0xe8(%rbp)
jmp 0x8496
movl $0x8000, %eax           # imm = 0x8000
movl %eax, -0xe8(%rbp)
jmp 0x8496
movl -0xe8(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x3c(%rbp), %eax
addl -0x54(%rbp), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x3c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x54(%rbp), %eax
jb 0x84b7
jmp 0x84d6
leaq 0x2e334(%rip), %rdi     # 0x367f2
leaq 0x2dc59(%rip), %rsi     # 0x3611e
movl $0x613, %edx            # imm = 0x613
leaq 0x2e2f1(%rip), %rcx     # 0x367c2
callq 0x31d0
movl -0x54(%rbp), %ecx
movl -0x18(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x92aa, %rcx           # imm = 0x92AA
addq $0xfff8, %rcx           # imm = 0xFFF8
cmpq %rcx, %rax
jbe 0x85a7
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x9e80
movl %eax, -0x90(%rbp)
cmpl $0x0, %eax
je 0x857b
movl -0x90(%rbp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovll %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x87b6
movq -0x10(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x7ff8
jmp 0x85ae
cmpl $0x0, -0x18(%rbp)
je 0x8760
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movb 0xc8(%rax,%rcx), %al
movb %al, -0x91(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movb -0x91(%rbp), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
sarl %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jne 0x8625
movl $0x8, -0x24(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x91(%rbp), %ecx
movw 0x81ca(%rax,%rcx,2), %dx
addw $0x1, %dx
movw %dx, 0x81ca(%rax,%rcx,2)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cmpl $0x8000, %eax           # imm = 0x8000
jae 0x8668
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x8675
movl $0x8000, %eax           # imm = 0x8000
movl %eax, -0xec(%rbp)
jmp 0x8675
movl -0xec(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movl %eax, -0x3c(%rbp)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x92aa, %rcx           # imm = 0x92AA
addq $0xfff8, %rcx           # imm = 0xFFF8
cmpq %rcx, %rax
jbe 0x875b
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x9e80
movl %eax, -0x98(%rbp)
cmpl $0x0, %eax
je 0x872f
movl -0x98(%rbp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovll %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x87b6
movq -0x10(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x85ae
jmp 0x7dc4
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x50(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)