// File: Alcaro[P]bridges/arlib/deps/miniz.c
// Function: tdefl_flush_block
static int tdefl_flush_block(tdefl_compressor *d, int flush)
{
  mz_uint saved_bit_buf, saved_bits_in;
  mz_uint8 *pSaved_output_buf;
  mz_bool comp_block_succeeded = MZ_FALSE;
  int n, use_raw_block = ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) && (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size;
  mz_uint8 *pOutput_buf_start = ((d->m_pPut_buf_func == NULL) && ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE)) ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs) : d->m_output_buf;

  d->m_pOutput_buf = pOutput_buf_start;
  d->m_pOutput_buf_end = d->m_pOutput_buf + TDEFL_OUT_BUF_SIZE - 16;

  MZ_ASSERT(!d->m_output_flush_remaining);
  d->m_output_flush_ofs = 0;
  d->m_output_flush_remaining = 0;

  *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> d->m_num_flags_left);
  d->m_pLZ_code_buf -= (d->m_num_flags_left == 8);

  if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index))
  {
    TDEFL_PUT_BITS(0x78, 8); TDEFL_PUT_BITS(0x01, 8);
  }

  TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);

  pSaved_output_buf = d->m_pOutput_buf; saved_bit_buf = d->m_bit_buffer; saved_bits_in = d->m_bits_in;

  if (!use_raw_block)
    comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48));

  // If the block gets expanded, forget the current contents of the output buffer and send a raw block instead.
  if ( ((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
       ((d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size) )
  {
    mz_uint i; d->m_pOutput_buf = pSaved_output_buf; d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in;
    TDEFL_PUT_BITS(0, 2);
    if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); }
    for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF)
    {
      TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
    }
    for (i = 0; i < d->m_total_lz_bytes; ++i)
    {
      TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
    }
  }
  // Check for the extremely unlikely (if not impossible) case of the compressed block not fitting into the output buffer when using dynamic codes.
  else if (!comp_block_succeeded)
  {
    d->m_pOutput_buf = pSaved_output_buf; d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in;
    tdefl_compress_block(d, MZ_TRUE);
  }

  if (flush)
  {
    if (flush == TDEFL_FINISH)
    {
      if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); }
      if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER) { mz_uint i, a = d->m_adler32; for (i = 0; i < 4; i++) { TDEFL_PUT_BITS((a >> 24) & 0xFF, 8); a <<= 8; } }
    }
    else
    {
      mz_uint i, z = 0; TDEFL_PUT_BITS(0, 3); if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); } for (i = 2; i; --i, z ^= 0xFFFF) { TDEFL_PUT_BITS(z & 0xFFFF, 16); }
    }
  }

  MZ_ASSERT(d->m_pOutput_buf < d->m_pOutput_buf_end);

  memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0);
  memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1);

  d->m_pLZ_code_buf = d->m_lz_code_buf + 1; d->m_pLZ_flags = d->m_lz_code_buf; d->m_num_flags_left = 8; d->m_lz_code_buf_dict_pos += d->m_total_lz_bytes; d->m_total_lz_bytes = 0; d->m_block_index++;

  if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0)
  {
    if (d->m_pPut_buf_func)
    {
      *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf;
      if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user))
        return (d->m_prev_return_status = TDEFL_STATUS_PUT_BUF_FAILED);
    }
    else if (pOutput_buf_start == d->m_output_buf)
    {
      int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs));
      memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf, bytes_to_copy);
      d->m_out_buf_ofs += bytes_to_copy;
      if ((n -= bytes_to_copy) != 0)
      {
        d->m_output_flush_ofs = bytes_to_copy;
        d->m_output_flush_remaining = n;
      }
    }
    else
    {
      d->m_out_buf_ofs += n;
    }
  }

  return d->m_output_flush_remaining;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
andl $0x80000, %ecx          # imm = 0x80000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xb9(%rbp)
je 0x5ecb1
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x58(%rcx), %eax
movq -0x10(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
setbe %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x5ed09
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
subq 0xc0(%rcx), %rax
cmpq $0x14ccc, %rax          # imm = 0x14CCC
jb 0x5ed09
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0xc0(%rcx), %rax
movq %rax, -0xc8(%rbp)
jmp 0x5ed1a
movq -0x10(%rbp), %rax
addq $0x392aa, %rax          # imm = 0x392AA
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
addq $0x14ccc, %rcx          # imm = 0x14CCC
addq $-0x10, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jne 0x5ed58
jmp 0x5ed77
leaq 0xc515(%rip), %rdi      # 0x6b274
leaq 0xc276(%rip), %rsi      # 0x6afdc
movl $0x2c7, %edx            # imm = 0x2C7
leaq 0xc51f(%rip), %rcx      # 0x6b291
callq 0x4200
movq -0x10(%rbp), %rax
movl $0x0, 0x70(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x74(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movzbl (%rax), %eax
movq -0x10(%rbp), %rcx
movl 0x50(%rcx), %ecx
sarl %cl, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x50(%rax)
sete %al
andb $0x1, %al
movzbl %al, %edx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
movslq %edx, %rsi
xorl %edx, %edx
subq %rsi, %rdx
addq %rdx, %rcx
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x5ef81
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
jne 0x5ef81
jmp 0x5edf9
movl $0x78, -0x44(%rbp)
movl $0x8, -0x48(%rbp)
movl -0x44(%rbp), %eax
movl -0x48(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5ee1f
jmp 0x5ee3e
leaq 0xc49a(%rip), %rdi      # 0x6b2c0
leaq 0xc1af(%rip), %rsi      # 0x6afdc
movl $0x2d0, %edx            # imm = 0x2D0
leaq 0xc458(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x44(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x48(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5eeb9
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5ee9d
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5ee63
jmp 0x5eebb
jmp 0x5eebd
movl $0x1, -0x4c(%rbp)
movl $0x8, -0x50(%rbp)
movl -0x4c(%rbp), %eax
movl -0x50(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5eee3
jmp 0x5ef02
leaq 0xc3d6(%rip), %rdi      # 0x6b2c0
leaq 0xc0eb(%rip), %rsi      # 0x6afdc
movl $0x2d0, %edx            # imm = 0x2D0
leaq 0xc394(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x4c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x50(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5ef7d
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5ef61
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5ef27
jmp 0x5ef7f
jmp 0x5ef81
jmp 0x5ef83
cmpl $0x4, -0x14(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x54(%rbp)
movl $0x1, -0x58(%rbp)
movl -0x54(%rbp), %eax
movl -0x58(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5efb1
jmp 0x5efd0
leaq 0xc308(%rip), %rdi      # 0x6b2c0
leaq 0xc01d(%rip), %rsi      # 0x6afdc
movl $0x2d3, %edx            # imm = 0x2D3
leaq 0xc2c6(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x54(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x58(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f04b
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f02f
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5eff5
jmp 0x5f04d
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x5f0c3
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
andl $0x40000, %ecx          # imm = 0x40000
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0xc9(%rbp)
jne 0x5f0a9
movq -0x10(%rbp), %rax
cmpl $0x30, 0x54(%rax)
setb %al
movb %al, -0xc9(%rbp)
movq -0xd8(%rbp), %rdi
movb -0xc9(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x602f0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x5f0fa
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x5f4d7
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
movl 0x54(%rcx), %ecx
cmpq %rcx, %rax
jl 0x5f4d7
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x58(%rcx), %eax
movq -0x10(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
ja 0x5f4d7
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x60(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x5c(%rax)
movl $0x0, -0x60(%rbp)
movl $0x2, -0x64(%rbp)
movl -0x60(%rbp), %eax
movl -0x64(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f15b
jmp 0x5f17a
leaq 0xc15e(%rip), %rdi      # 0x6b2c0
leaq 0xbe73(%rip), %rsi      # 0x6afdc
movl $0x2df, %edx            # imm = 0x2DF
leaq 0xc11c(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x60(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x64(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f1f5
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f1d9
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f19f
jmp 0x5f1f7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
je 0x5f2d3
jmp 0x5f207
movl $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rcx
movl $0x8, %eax
subl 0x5c(%rcx), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %eax
movl -0x6c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f235
jmp 0x5f254
leaq 0xc084(%rip), %rdi      # 0x6b2c0
leaq 0xbd99(%rip), %rsi      # 0x6afdc
movl $0x2e0, %edx            # imm = 0x2E0
leaq 0xc042(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x68(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x6c(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f2cf
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f2b3
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f279
jmp 0x5f2d1
jmp 0x5f2d3
movl $0x2, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
je 0x5f3d0
jmp 0x5f2e6
movq -0x10(%rbp), %rax
movl 0x54(%rax), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x70(%rbp)
movl $0x10, -0x74(%rbp)
movl -0x70(%rbp), %eax
movl -0x74(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f314
jmp 0x5f333
leaq 0xbfa5(%rip), %rdi      # 0x6b2c0
leaq 0xbcba(%rip), %rsi      # 0x6afdc
movl $0x2e3, %edx            # imm = 0x2E3
leaq 0xbf63(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x70(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x74(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f3ae
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f392
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f358
jmp 0x5f3b0
jmp 0x5f3b2
movl -0x5c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movl 0x54(%rax), %ecx
xorl $0xffff, %ecx           # imm = 0xFFFF
movl %ecx, 0x54(%rax)
jmp 0x5f2da
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x54(%rcx), %eax
jae 0x5f4d5
jmp 0x5f3e9
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x58(%rcx), %ecx
addl -0x5c(%rbp), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movl %ecx, %ecx
movzbl 0xc8(%rax,%rcx), %eax
movl %eax, -0x78(%rbp)
movl $0x8, -0x7c(%rbp)
movl -0x78(%rbp), %eax
movl -0x7c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f429
jmp 0x5f448
leaq 0xbe90(%rip), %rdi      # 0x6b2c0
leaq 0xbba5(%rip), %rsi      # 0x6afdc
movl $0x2e7, %edx            # imm = 0x2E7
leaq 0xbe4e(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x78(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x7c(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f4c3
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f4a7
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f46d
jmp 0x5f4c5
jmp 0x5f4c7
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x5f3d7
jmp 0x5f50d
cmpl $0x0, -0x2c(%rbp)
jne 0x5f50b
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x60(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x602f0
jmp 0x5f50d
cmpl $0x0, -0x14(%rbp)
je 0x5fa34
cmpl $0x4, -0x14(%rbp)
jne 0x5f749
movq -0x10(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
je 0x5f606
jmp 0x5f531
movl $0x0, -0x80(%rbp)
movq -0x10(%rbp), %rcx
movl $0x8, %eax
subl 0x5c(%rcx), %eax
movl %eax, -0x84(%rbp)
movl -0x80(%rbp), %eax
movl -0x84(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f565
jmp 0x5f584
leaq 0xbd54(%rip), %rdi      # 0x6b2c0
leaq 0xba69(%rip), %rsi      # 0x6afdc
movl $0x2f5, %edx            # imm = 0x2F5
leaq 0xbd12(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x80(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x84(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f602
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f5e6
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f5ac
jmp 0x5f604
jmp 0x5f606
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x5f744
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x8c(%rbp)
movl $0x0, -0x88(%rbp)
cmpl $0x4, -0x88(%rbp)
jae 0x5f742
jmp 0x5f641
movl -0x8c(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movl %eax, -0x90(%rbp)
movl $0x8, -0x94(%rbp)
movl -0x90(%rbp), %eax
movl -0x94(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f67d
jmp 0x5f69c
leaq 0xbc3c(%rip), %rdi      # 0x6b2c0
leaq 0xb951(%rip), %rsi      # 0x6afdc
movl $0x2f6, %edx            # imm = 0x2F6
leaq 0xbbfa(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0x90(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0x94(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f71d
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f701
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f6c7
jmp 0x5f71f
movl -0x8c(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x8c(%rbp)
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x5f632
jmp 0x5f744
jmp 0x5fa32
movl $0x0, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl $0x3, -0xa4(%rbp)
movl -0xa0(%rbp), %eax
movl -0xa4(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f785
jmp 0x5f7a4
leaq 0xbb34(%rip), %rdi      # 0x6b2c0
leaq 0xb849(%rip), %rsi      # 0x6afdc
movl $0x2fa, %edx            # imm = 0x2FA
leaq 0xbaf2(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0xa0(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0xa4(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f825
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f809
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f7cf
jmp 0x5f827
movq -0x10(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
je 0x5f915
jmp 0x5f837
movl $0x0, -0xa8(%rbp)
movq -0x10(%rbp), %rcx
movl $0x8, %eax
subl 0x5c(%rcx), %eax
movl %eax, -0xac(%rbp)
movl -0xa8(%rbp), %eax
movl -0xac(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f871
jmp 0x5f890
leaq 0xba48(%rip), %rdi      # 0x6b2c0
leaq 0xb75d(%rip), %rsi      # 0x6afdc
movl $0x2fa, %edx            # imm = 0x2FA
leaq 0xba06(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0xa8(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0xac(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5f911
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f8f5
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f8bb
jmp 0x5f913
jmp 0x5f915
movl $0x2, -0x98(%rbp)
cmpl $0x0, -0x98(%rbp)
je 0x5fa30
jmp 0x5f92e
movl -0x9c(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0xb0(%rbp)
movl $0x10, -0xb4(%rbp)
movl -0xb0(%rbp), %eax
movl -0xb4(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
ja 0x5f967
jmp 0x5f986
leaq 0xb952(%rip), %rdi      # 0x6b2c0
leaq 0xb667(%rip), %rsi      # 0x6afdc
movl $0x2fa, %edx            # imm = 0x2FA
leaq 0xb910(%rip), %rcx      # 0x6b291
callq 0x4200
movl -0xb0(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x5c(%rcx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl 0x60(%rax), %ecx
movl %ecx, 0x60(%rax)
movl -0xb4(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movl %ecx, 0x5c(%rax)
movq -0x10(%rbp), %rax
cmpl $0x8, 0x5c(%rax)
jb 0x5fa07
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5f9eb
movq -0x10(%rbp), %rax
movl 0x60(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rdx
movq 0x40(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rdx)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x5c(%rax), %ecx
subl $0x8, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x5f9b1
jmp 0x5fa09
jmp 0x5fa0b
movl -0x98(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x98(%rbp)
movl -0x9c(%rbp), %eax
xorl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x9c(%rbp)
jmp 0x5f91f
jmp 0x5fa32
jmp 0x5fa34
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x5fa48
jmp 0x5fa67
leaq 0xb88c(%rip), %rdi      # 0x6b2db
leaq 0xb586(%rip), %rsi      # 0x6afdc
movl $0x2fe, %edx            # imm = 0x2FE
leaq 0xb82f(%rip), %rcx      # 0x6b291
callq 0x4200
movq -0x10(%rbp), %rdi
addq $0x81ca, %rdi           # imm = 0x81CA
xorl %esi, %esi
movl $0x240, %edx            # imm = 0x240
callq 0x4170
movq -0x10(%rbp), %rdi
addq $0x81ca, %rdi           # imm = 0x81CA
addq $0x240, %rdi            # imm = 0x240
xorl %esi, %esi
movl $0x40, %edx
callq 0x4170
movq -0x10(%rbp), %rcx
addq $0x92aa, %rcx           # imm = 0x92AA
addq $0x1, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
addq $0x92aa, %rcx           # imm = 0x92AA
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x8, 0x50(%rax)
movq -0x10(%rbp), %rax
movl 0x54(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x58(%rax), %ecx
movl %ecx, 0x58(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x10(%rbp), %rax
movl 0x7c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x7c(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
je 0x5fc89
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5fb89
movq -0x10(%rbp), %rax
movq 0xb0(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
subq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rdi
addq $0x392aa, %rdi          # imm = 0x392AA
movl -0x30(%rbp), %esi
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdx
callq *%rax
cmpl $0x0, %eax
jne 0x5fb84
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x84(%rax) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5fc93
jmp 0x5fc87
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x392aa, %rcx          # imm = 0x392AA
cmpq %rcx, %rax
jne 0x5fc6f
movslq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0xa0(%rcx), %rcx
movq (%rcx), %rcx
movq -0x10(%rbp), %rdx
subq 0xc0(%rdx), %rcx
cmpq %rcx, %rax
jae 0x5fbd0
movslq -0x30(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x5fbf0
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
subq 0xc0(%rcx), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movl %eax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rdi
movq -0x10(%rbp), %rax
addq 0xc0(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x392aa, %rsi          # imm = 0x392AA
movslq -0xb8(%rbp), %rdx
callq 0x4280
movslq -0xb8(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0xc0(%rax), %rcx
movq %rcx, 0xc0(%rax)
movl -0xb8(%rbp), %ecx
movl -0x30(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, %eax
je 0x5fc6d
movl -0xb8(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x70(%rax)
movl -0x30(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x74(%rax)
jmp 0x5fc85
movslq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0xc0(%rax), %rcx
movq %rcx, 0xc0(%rax)
jmp 0x5fc87
jmp 0x5fc89
movq -0x10(%rbp), %rax
movl 0x74(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nop