// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_encode_base.c
// Function: lzfse_encode_matches
static int lzfse_encode_matches(lzfse_encoder_state *s) {
  if (s->n_literals == 0 && s->n_matches == 0)
    return LZFSE_STATUS_OK; // nothing to store, OK

  uint32_t l_occ[LZFSE_ENCODE_L_SYMBOLS];
  uint32_t m_occ[LZFSE_ENCODE_M_SYMBOLS];
  uint32_t d_occ[LZFSE_ENCODE_D_SYMBOLS];
  uint32_t literal_occ[LZFSE_ENCODE_LITERAL_SYMBOLS];
  fse_encoder_entry l_encoder[LZFSE_ENCODE_L_SYMBOLS];
  fse_encoder_entry m_encoder[LZFSE_ENCODE_M_SYMBOLS];
  fse_encoder_entry d_encoder[LZFSE_ENCODE_D_SYMBOLS];
  fse_encoder_entry literal_encoder[LZFSE_ENCODE_LITERAL_SYMBOLS];
  int ok = 1;
  lzfse_compressed_block_header_v1 header1 = {0};
  lzfse_compressed_block_header_v2 *header2 = 0;

  // Keep initial state to be able to restore it if DST full
  uint8_t *dst0 = s->dst;
  uint32_t n_literals0 = s->n_literals;

  // Add 0x00 literals until n_literals multiple of 4, since we encode 4
  // interleaved literal streams.
  while (s->n_literals & 3) {
    uint32_t n = s->n_literals++;
    s->literals[n] = 0;
  }

  // Encode previous distance
  uint32_t d_prev = 0;
  for (uint32_t i = 0; i < s->n_matches; i++) {
    uint32_t d = s->d_values[i];
    if (d == d_prev)
      s->d_values[i] = 0;
    else
      d_prev = d;
  }

  // Clear occurrence tables
  memset(l_occ, 0, sizeof(l_occ));
  memset(m_occ, 0, sizeof(m_occ));
  memset(d_occ, 0, sizeof(d_occ));
  memset(literal_occ, 0, sizeof(literal_occ));

  // Update occurrence tables in all 4 streams (L,M,D,literals)
  uint32_t l_sum = 0;
  uint32_t m_sum = 0;
  for (uint32_t i = 0; i < s->n_matches; i++) {
    uint32_t l = s->l_values[i];
    l_sum += l;
    l_occ[l_base_from_value(l)]++;
  }
  for (uint32_t i = 0; i < s->n_matches; i++) {
    uint32_t m = s->m_values[i];
    m_sum += m;
    m_occ[m_base_from_value(m)]++;
  }
  for (uint32_t i = 0; i < s->n_matches; i++)
    d_occ[d_base_from_value(s->d_values[i])]++;
  for (uint32_t i = 0; i < s->n_literals; i++)
    literal_occ[s->literals[i]]++;

  // Make sure we have enough room for a _full_ V2 header
  if (s->dst + sizeof(lzfse_compressed_block_header_v2) > s->dst_end) {
    ok = 0;
    goto END;
  }
  header2 = (lzfse_compressed_block_header_v2 *)(s->dst);

  // Setup header V1
  header1.magic = LZFSE_COMPRESSEDV1_BLOCK_MAGIC;
  header1.n_raw_bytes = m_sum + l_sum;
  header1.n_matches = s->n_matches;
  header1.n_literals = s->n_literals;

  // Normalize occurrence tables to freq tables
  fse_normalize_freq(LZFSE_ENCODE_L_STATES, LZFSE_ENCODE_L_SYMBOLS, l_occ,
                     header1.l_freq);
  fse_normalize_freq(LZFSE_ENCODE_M_STATES, LZFSE_ENCODE_M_SYMBOLS, m_occ,
                     header1.m_freq);
  fse_normalize_freq(LZFSE_ENCODE_D_STATES, LZFSE_ENCODE_D_SYMBOLS, d_occ,
                     header1.d_freq);
  fse_normalize_freq(LZFSE_ENCODE_LITERAL_STATES, LZFSE_ENCODE_LITERAL_SYMBOLS,
                     literal_occ, header1.literal_freq);

  // Compress freq tables to V2 header, and get actual size of V2 header
  s->dst += lzfse_encode_v1_freq_table(header2, &header1);

  // Initialize encoder tables from freq tables
  fse_init_encoder_table(LZFSE_ENCODE_L_STATES, LZFSE_ENCODE_L_SYMBOLS,
                         header1.l_freq, l_encoder);
  fse_init_encoder_table(LZFSE_ENCODE_M_STATES, LZFSE_ENCODE_M_SYMBOLS,
                         header1.m_freq, m_encoder);
  fse_init_encoder_table(LZFSE_ENCODE_D_STATES, LZFSE_ENCODE_D_SYMBOLS,
                         header1.d_freq, d_encoder);
  fse_init_encoder_table(LZFSE_ENCODE_LITERAL_STATES,
                         LZFSE_ENCODE_LITERAL_SYMBOLS, header1.literal_freq,
                         literal_encoder);

  // Encode literals
  {
    fse_out_stream out;
    fse_out_init(&out);
    fse_state state0, state1, state2, state3;
    state0 = state1 = state2 = state3 = 0;

    uint8_t *buf = s->dst;
    uint32_t i = s->n_literals; // I multiple of 4
    // We encode starting from the last literal so we can decode starting from
    // the first
    while (i > 0) {
      if (buf + 16 > s->dst_end) {
        ok = 0;
        goto END;
      } // out full
      i -= 4;
      fse_encode(&state3, literal_encoder, &out, s->literals[i + 3]); // 10b
      fse_encode(&state2, literal_encoder, &out, s->literals[i + 2]); // 10b
#if !FSE_IOSTREAM_64
      fse_out_flush(&out, &buf);
#endif
      fse_encode(&state1, literal_encoder, &out, s->literals[i + 1]); // 10b
      fse_encode(&state0, literal_encoder, &out, s->literals[i + 0]); // 10b
      fse_out_flush(&out, &buf);
    }
    fse_out_finish(&out, &buf);

    // Update header with final encoder state
    header1.literal_bits = out.accum_nbits; // [-7, 0]
    header1.n_literal_payload_bytes = (uint32_t)(buf - s->dst);
    header1.literal_state[0] = state0;
    header1.literal_state[1] = state1;
    header1.literal_state[2] = state2;
    header1.literal_state[3] = state3;

    // Update state
    s->dst = buf;

  } // literals

  // Encode L,M,D
  {
    fse_out_stream out;
    fse_out_init(&out);
    fse_state l_state, m_state, d_state;
    l_state = m_state = d_state = 0;

    uint8_t *buf = s->dst;
    uint32_t i = s->n_matches;

    // Add 8 padding bytes to the L,M,D payload
    if (buf + 8 > s->dst_end) {
      ok = 0;
      goto END;
    } // out full
    store8(buf, 0);
    buf += 8;

    // We encode starting from the last match so we can decode starting from the
    // first
    while (i > 0) {
      if (buf + 16 > s->dst_end) {
        ok = 0;
        goto END;
      } // out full
      i -= 1;

      // D requires 23b max
      int32_t d_value = s->d_values[i];
      uint8_t d_symbol = d_base_from_value(d_value);
      int32_t d_nbits = d_extra_bits[d_symbol];
      int32_t d_bits = d_value - d_base_value[d_symbol];
      fse_out_push(&out, d_nbits, d_bits);
      fse_encode(&d_state, d_encoder, &out, d_symbol);
#if !FSE_IOSTREAM_64
      fse_out_flush(&out, &buf);
#endif

      // M requires 17b max
      int32_t m_value = s->m_values[i];
      uint8_t m_symbol = m_base_from_value(m_value);
      int32_t m_nbits = m_extra_bits[m_symbol];
      int32_t m_bits = m_value - m_base_value[m_symbol];
      fse_out_push(&out, m_nbits, m_bits);
      fse_encode(&m_state, m_encoder, &out, m_symbol);
#if !FSE_IOSTREAM_64
      fse_out_flush(&out, &buf);
#endif

      // L requires 14b max
      int32_t l_value = s->l_values[i];
      uint8_t l_symbol = l_base_from_value(l_value);
      int32_t l_nbits = l_extra_bits[l_symbol];
      int32_t l_bits = l_value - l_base_value[l_symbol];
      fse_out_push(&out, l_nbits, l_bits);
      fse_encode(&l_state, l_encoder, &out, l_symbol);
      fse_out_flush(&out, &buf);
    }
    fse_out_finish(&out, &buf);

    // Update header with final encoder state
    header1.n_lmd_payload_bytes = (uint32_t)(buf - s->dst);
    header1.lmd_bits = out.accum_nbits; // [-7, 0]
    header1.l_state = l_state;
    header1.m_state = m_state;
    header1.d_state = d_state;

    // Update state
    s->dst = buf;

  } // L,M,D

  // Final state update, here we had enough space in DST, and are not going to
  // revert state
  s->n_literals = 0;
  s->n_matches = 0;

  // Final payload size
  header1.n_payload_bytes =
      header1.n_literal_payload_bytes + header1.n_lmd_payload_bytes;

  // Encode state info in V2 header (we previously encoded the tables, now we
  // set the other fields)
  lzfse_encode_v1_state(header2, &header1);

END:
  if (!ok) {
    // Revert state, DST was full

    // Revert the d_prev encoding
    uint32_t d_prev = 0;
    for (uint32_t i = 0; i < s->n_matches; i++) {
      uint32_t d = s->d_values[i];
      if (d == 0)
        s->d_values[i] = d_prev;
      else
        d_prev = d;
    }

    // Revert literal count
    s->n_literals = n_literals0;

    // Revert DST
    s->dst = dst0;

    return LZFSE_STATUS_DST_FULL; // DST full
  }

  return LZFSE_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1428, %rsp           # imm = 0x1428
movq %rdi, %rbp
movl 0x5c(%rdi), %r14d
testl %r14d, %r14d
jne 0x4667
cmpl $0x0, 0x58(%rbp)
je 0x4d9c
leaq 0xdc(%rsp), %rdi
movl $0x304, %edx            # imm = 0x304
xorl %esi, %esi
callq 0x3080
movl 0x5c(%rbp), %r15d
testb $0x3, %r15b
je 0x469d
movl %r15d, %eax
incl %r15d
movb $0x0, 0x1d520(%rbp,%rax)
testb $0x3, %r15b
jne 0x4685
movl %r15d, 0x5c(%rbp)
movq 0x28(%rbp), %rax
movq %rax, 0x8(%rsp)
movl 0x58(%rbp), %r12d
testq %r12, %r12
je 0x46d5
xorl %eax, %eax
xorl %ecx, %ecx
movl 0x138e0(%rbp,%rax,4), %edx
cmpl %ecx, %edx
jne 0x46cb
movl $0x0, 0x138e0(%rbp,%rax,4)
movl %ecx, %edx
incq %rax
movl %edx, %ecx
cmpq %rax, %r12
jne 0x46b3
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
leaq 0x520(%rsp), %rdi
xorl %r13d, %r13d
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3080
leaq 0x1020(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x3080
movl $0x0, %eax
testl %r12d, %r12d
je 0x4773
xorl %ecx, %ecx
leaq 0x3bf9(%rip), %rdx      # 0x8350
xorl %eax, %eax
movslq 0x60(%rbp,%rcx,4), %rsi
movzbl (%rsi,%rdx), %edi
incl 0x80(%rsp,%rdi,4)
addl %esi, %eax
incq %rcx
cmpq %rcx, %r12
jne 0x4759
testl %r12d, %r12d
je 0x479f
xorl %ecx, %ecx
leaq 0x3d0f(%rip), %rdx      # 0x8490
xorl %r13d, %r13d
movslq 0x9ca0(%rbp,%rcx,4), %rsi
movzbl (%rsi,%rdx), %edi
incl 0x30(%rsp,%rdi,4)
addl %esi, %r13d
incq %rcx
cmpq %rcx, %r12
jne 0x4784
testl %r12d, %r12d
je 0x484b
xorl %ecx, %ecx
movl $0x3c00, %edx           # imm = 0x3C00
movl $0x3c000, %esi          # imm = 0x3C000
leaq 0x4615(%rip), %rdi      # 0x8dd0
xorl %r8d, %r8d
movl 0x138e0(%rbp,%r8,4), %r9d
movl %r9d, %r11d
subl $0x3c, %r11d
movl $0x0, %ebx
cmovbl %r9d, %ebx
movl %r11d, %r10d
sarl $0x4, %r10d
addl $0x40, %r10d
cmpl $0x3c0, %r11d           # imm = 0x3C0
cmovael %ecx, %r10d
orl %ebx, %r10d
leal -0x3fc(%r9), %r11d
movl %r11d, %ebx
shrl $0x8, %ebx
xorl $0x80, %ebx
cmpl %edx, %r11d
cmovael %edx, %ebx
leal -0x3ffc(%r9), %r11d
addl $0xfc004, %r9d          # imm = 0xFC004
shrl $0xc, %r9d
addl $0xc0, %r9d
cmpl %esi, %r11d
cmovael %esi, %r9d
orl %ebx, %r9d
orl %r10d, %r9d
movzbl %r9b, %r9d
movzbl (%r9,%rdi), %r9d
incl 0x520(%rsp,%r9,4)
incq %r8
cmpq %r8, %r12
jne 0x47be
testl %r15d, %r15d
je 0x486c
movl %r15d, %ecx
xorl %edx, %edx
movzbl 0x1d520(%rbp,%rdx), %esi
incl 0x1020(%rsp,%rsi,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x4855
movq 0x8(%rsp), %rcx
addq $0x2f0, %rcx            # imm = 0x2F0
xorl %r10d, %r10d
movl $0x0, %r8d
cmpq 0x38(%rbp), %rcx
ja 0x52e9
movl %r14d, 0x14(%rsp)
leaq 0x10e(%rsp), %r14
movl $0x31787662, -0x32(%r14) # imm = 0x31787662
addl %eax, %r13d
movl %r13d, -0x2e(%r14)
movl %r12d, -0x22(%r14)
movl %r15d, -0x26(%r14)
leaq 0x80(%rsp), %rdx
movl $0x40, %edi
movl $0x14, %esi
movq %r14, %rcx
callq 0x7d7b
leaq 0x136(%rsp), %r15
leaq 0x30(%rsp), %rdx
movl $0x40, %edi
movl $0x14, %esi
movq %r15, %rcx
callq 0x7d7b
leaq 0x15e(%rsp), %r12
leaq 0x520(%rsp), %rdx
movl $0x100, %edi            # imm = 0x100
movl $0x40, %esi
movq %r12, %rcx
callq 0x7d7b
leaq 0x1de(%rsp), %r13
leaq 0x1020(%rsp), %rdx
movl $0x400, %edi            # imm = 0x400
movl $0x100, %esi            # imm = 0x100
movq %r13, %rcx
callq 0x7d7b
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %rsi
xorl %r8d, %r8d
leaq 0x5151(%rip), %r9       # 0x9a90
leaq 0x516a(%rip), %r10      # 0x9ab0
xorl %edi, %edi
xorl %eax, %eax
movzwl 0x10e(%rsp,%r8,2), %r11d
cmpl $0x8, %r11d
jae 0x4966
movl (%r9,%r11,4), %edx
movl %r11d, %ecx
movl (%r10,%rcx,4), %r11d
jmp 0x498a
movl %r11d, %ecx
shll $0x4, %r11d
cmpw $0x17, %cx
ja 0x497e
addl $-0x79, %r11d
movl $0x8, %edx
jmp 0x498a
addl $0xfffffe8f, %r11d      # imm = 0xFFFFFE8F
movl $0xe, %edx
movl %r11d, %ebx
movl %edx, %ecx
shrl %cl, %ebx
testl %ebx, %ebx
jne 0x537e
movl %eax, %ecx
shll %cl, %r11d
orl %r11d, %edi
addl %eax, %edx
cmpl $0x8, %edx
jl 0x49bd
movb %dil, (%rsi)
shrl $0x8, %edi
leal -0x8(%rdx), %eax
incq %rsi
cmpl $0xf, %edx
movl %eax, %edx
jg 0x49a8
jmp 0x49bf
movl %edx, %eax
incq %r8
cmpq $0x168, %r8             # imm = 0x168
jne 0x494a
testl %eax, %eax
jle 0x49d9
movb %dil, (%rsi)
incq %rsi
movq 0x8(%rsp), %rax
subl %eax, %esi
leaq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rsi, 0x18(%rax)
addq %rsi, 0x28(%rbp)
leaq 0x480(%rsp), %rcx
movl $0x40, %edi
movl $0x14, %esi
movq %r14, %rdx
callq 0x7a70
leaq 0x3e0(%rsp), %rcx
movl $0x40, %edi
movl $0x14, %esi
movq %r15, %rdx
callq 0x7a70
leaq 0x620(%rsp), %rcx
movl $0x100, %edi            # imm = 0x100
movl $0x40, %esi
movq %r12, %rdx
callq 0x7a70
leaq 0x820(%rsp), %rcx
movl $0x400, %edi            # imm = 0x400
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdx
callq 0x7a70
movq 0x28(%rbp), %r12
movl 0x5c(%rbp), %r9d
addl $-0x2, %r9d
xorl %r13d, %r13d
leaq 0x445a(%rip), %r8       # 0x8ed0
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %eax, %eax
movq %rbp, 0x18(%rsp)
cmpl $-0x2, %r9d
je 0x4cef
leaq 0x10(%r12), %rcx
cmpq 0x38(%rbp), %rcx
ja 0x4d5d
leal 0x1(%r9), %ecx
movzbl 0x1d520(%rbp,%rcx), %ecx
movzwl %r10w, %esi
leaq (%rsp,%rcx,8), %r10
addq $0x824, %r10            # imm = 0x824
movswl -0x4(%r10), %ebx
movswq -0x2(%r10), %rdx
leaq (%rsp,%rcx,8), %rdi
addq $0x826, %rdi            # imm = 0x826
xorl %ecx, %ecx
cmpl %ebx, %esi
cmovgeq %r10, %rdi
setl %cl
subq %rcx, %rdx
movl (%r8,%rdx,8), %ebx
andl %esi, %ebx
movl %eax, %ecx
shlq %cl, %rbx
addl %edx, %eax
cmpl $0x41, %eax
jae 0x535f
movq %r12, 0x28(%rsp)
movzwl (%rdi), %r10d
orq %r13, %rbx
movq %rbx, %rdi
movl %eax, %ecx
shrq %cl, %rdi
cmpl $0x40, %eax
je 0x4b18
testq %rdi, %rdi
jne 0x5340
movl %edx, %ecx
shrl %cl, %esi
movl %r9d, %ecx
movzbl 0x1d520(%rbp,%rcx), %ecx
movzwl %r11w, %r12d
leaq (%rsp,%rcx,8), %rdi
addq $0x824, %rdi            # imm = 0x824
movswl -0x4(%rdi), %ebp
movswq -0x2(%rdi), %rdx
leaq (%rsp,%rcx,8), %r11
addq $0x826, %r11            # imm = 0x826
xorl %ecx, %ecx
cmpl %ebp, %r12d
cmovgeq %rdi, %r11
setl %cl
subq %rcx, %rdx
movl (%r8,%rdx,8), %edi
andl %r12d, %edi
movl %eax, %ecx
shlq %cl, %rdi
addl %edx, %eax
cmpl $0x41, %eax
jae 0x535f
movzwl (%r11), %r11d
orq %rbx, %rdi
movq %rdi, %rbx
movl %eax, %ecx
shrq %cl, %rbx
cmpl $0x40, %eax
je 0x4b8d
testq %rbx, %rbx
jne 0x5340
movl %edx, %ecx
shrl %cl, %r12d
leal -0x1(%r9), %ecx
movq 0x18(%rsp), %rdx
movzbl 0x1d520(%rdx,%rcx), %ecx
movzwl %r14w, %ebp
leaq 0x824(%rsp,%rcx,8), %rbx
movswl -0x4(%rbx), %r13d
movswq -0x2(%rbx), %rdx
leaq (%rsp,%rcx,8), %r14
addq $0x826, %r14            # imm = 0x826
xorl %ecx, %ecx
cmpl %r13d, %ebp
cmovgeq %rbx, %r14
setl %cl
subq %rcx, %rdx
movl (%r8,%rdx,8), %ebx
andl %ebp, %ebx
movl %eax, %ecx
shlq %cl, %rbx
addl %edx, %eax
cmpl $0x41, %eax
jae 0x535f
movzwl (%r14), %r14d
orq %rdi, %rbx
movq %rbx, %rdi
movl %eax, %ecx
shrq %cl, %rdi
cmpl $0x40, %eax
je 0x4c06
testq %rdi, %rdi
jne 0x5340
movl %edx, %ecx
shrl %cl, %ebp
leal -0x2(%r9), %ecx
movl %ecx, %ecx
movq 0x18(%rsp), %rdx
movzbl 0x1d520(%rdx,%rcx), %ecx
movzwl %r15w, %edi
leaq 0x824(%rsp,%rcx,8), %r13
movswl -0x4(%r13), %r8d
movswq -0x2(%r13), %rdx
leaq (%rsp,%rcx,8), %r15
addq $0x826, %r15            # imm = 0x826
xorl %ecx, %ecx
cmpl %r8d, %edi
cmovgeq %r13, %r15
setl %cl
subq %rcx, %rdx
leaq 0x427c(%rip), %r8       # 0x8ed0
movl (%r8,%rdx,8), %r13d
andl %edi, %r13d
movl %eax, %ecx
shlq %cl, %r13
addl %edx, %eax
cmpl $0x41, %eax
jae 0x535f
movzwl (%r15), %r15d
orq %rbx, %r13
movq %r13, %rbx
movl %eax, %ecx
shrq %cl, %rbx
cmpl $0x40, %eax
je 0x4c88
testq %rbx, %rbx
jne 0x5340
addl %esi, %r10d
addl %r12d, %r11d
addl %ebp, %r14d
movq 0x28(%rsp), %r12
movq %r13, (%r12)
movl %eax, %esi
movl %eax, %ecx
andb $0x78, %cl
shrq %cl, %r13
andl $0x7, %esi
shrl $0x3, %eax
addq %rax, %r12
movl %edx, %ecx
shrl %cl, %edi
movq %r13, %rdx
movl %esi, %ecx
shrq %cl, %rdx
addl %edi, %r15d
addl $-0x4, %r9d
movl %esi, %eax
testq %rdx, %rdx
movq 0x18(%rsp), %rbp
je 0x4a89
leaq 0x49eb(%rip), %rdi      # 0x96c2
leaq 0x499f(%rip), %rsi      # 0x967d
leaq 0x49a8(%rip), %rcx      # 0x968d
movl $0xc2, %edx
callq 0x3070
leal 0x7(%rax), %ecx
movl %ecx, %edx
andl $0x8, %edx
movq %r13, (%r12)
movl %edx, %esi
negl %esi
addl %eax, %esi
addl $0x7, %esi
cmpl $0x8, %esi
jae 0x53bc
subl %edx, %eax
shrl $0x3, %ecx
addq %rcx, %r12
movl %eax, 0xf8(%rsp)
movl 0x28(%rbp), %eax
movl %r12d, %ecx
subl %eax, %ecx
movl %ecx, 0xf0(%rsp)
movw %r15w, 0xfc(%rsp)
movw %r14w, 0xfe(%rsp)
movw %r11w, 0x100(%rsp)
movw %r10w, 0x102(%rsp)
movq %r12, 0x28(%rbp)
movl $0x1, %r8d
xorl %eax, %eax
jmp 0x4d65
xorl %r8d, %r8d
movl $0x13, %eax
cmpl $0x13, %eax
movl 0x14(%rsp), %r14d
movl $0x0, %r10d
je 0x52e9
testl %eax, %eax
jne 0x532b
movq 0x28(%rbp), %rax
leaq 0x8(%rax), %r9
movl $0x13, %ecx
cmpq 0x38(%rbp), %r9
jbe 0x4da4
xorl %r8d, %r8d
jmp 0x5146
xorl %r10d, %r10d
jmp 0x532b
movl 0x58(%rbp), %r11d
movq $0x0, (%rax)
xorl %eax, %eax
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %r10d, %r10d
xorl %r13d, %r13d
subq $0x1, %r11
jb 0x50d0
leaq 0x10(%r9), %rcx
cmpq 0x38(%rbp), %rcx
ja 0x5136
movslq 0x138e0(%rbp,%r11,4), %rsi
movl %esi, %edx
subl $0x3c, %edx
movl $0x0, %edi
cmovbl %esi, %edi
movl %edx, %ecx
sarl $0x4, %ecx
addl $0x40, %ecx
cmpl $0x3c0, %edx            # imm = 0x3C0
movl $0x0, %edx
cmovael %edx, %ecx
orl %edi, %ecx
leal -0x3fc(%rsi), %edx
movl %edx, %edi
shrl $0x8, %edi
xorl $0x80, %edi
movl $0x3c00, %ebx           # imm = 0x3C00
cmpl %ebx, %edx
cmovael %ebx, %edi
leal -0x3ffc(%rsi), %edx
leal 0xfc004(%rsi), %ebx
shrl $0xc, %ebx
addl $0xc0, %ebx
movl $0x3c000, %ebp          # imm = 0x3C000
cmpl %ebp, %edx
cmovael %ebp, %ebx
orl %edi, %ebx
orl %ecx, %ebx
movzbl %bl, %ecx
leaq 0x3f86(%rip), %rdx      # 0x8dd0
movzbl (%rcx,%rdx), %edi
leaq 0x331b(%rip), %rcx      # 0x8170
movslq (%rcx,%rdi,4), %rcx
subq %rcx, %rsi
movl %eax, %ecx
shlq %cl, %rsi
leaq 0x32c8(%rip), %rcx      # 0x8130
movzbl (%rdi,%rcx), %edx
addl %eax, %edx
cmpl $0x41, %edx
jae 0x535f
orq %r12, %rsi
movq %rsi, %rax
movl %edx, %ecx
shrq %cl, %rax
cmpl $0x40, %edx
je 0x4e90
testq %rax, %rax
jne 0x5340
movzwl %r13w, %r15d
leaq (%rsp,%rdi,8), %rcx
addq $0x624, %rcx            # imm = 0x624
movswl -0x4(%rcx), %ebp
movswq -0x2(%rcx), %rax
leaq (%rsp,%rdi,8), %rbx
addq $0x626, %rbx            # imm = 0x626
xorl %edi, %edi
cmpl %ebp, %r15d
cmovgeq %rcx, %rbx
setl %dil
subq %rdi, %rax
leaq 0x4006(%rip), %rcx      # 0x8ed0
movl (%rcx,%rax,8), %edi
andl %r15d, %edi
movl %edx, %ecx
shlq %cl, %rdi
addl %eax, %edx
cmpl $0x41, %edx
jae 0x535f
movzwl (%rbx), %r13d
orq %rsi, %rdi
movq %rdi, %rsi
movl %edx, %ecx
shrq %cl, %rsi
cmpl $0x40, %edx
movq 0x18(%rsp), %rbx
je 0x4f02
testq %rsi, %rsi
jne 0x5340
movl %eax, %ecx
shrl %cl, %r15d
movslq 0x9ca0(%rbx,%r11,4), %rsi
leaq 0x357a(%rip), %rax      # 0x8490
movzbl (%rsi,%rax), %ebx
leaq 0x336f(%rip), %rax      # 0x8290
movslq (%rax,%rbx,4), %rax
subq %rax, %rsi
movl %edx, %ecx
shlq %cl, %rsi
leaq 0x333c(%rip), %rax      # 0x8270
movzbl (%rbx,%rax), %eax
addl %edx, %eax
cmpl $0x41, %eax
jae 0x535f
orq %rdi, %rsi
movq %rsi, %rdx
movl %eax, %ecx
shrq %cl, %rdx
cmpl $0x40, %eax
je 0x4f5c
testq %rdx, %rdx
jne 0x5340
movzwl %r10w, %ebp
leaq (%rsp,%rbx,8), %rcx
addq $0x3e4, %rcx            # imm = 0x3E4
movswl -0x4(%rcx), %edi
movswq -0x2(%rcx), %rdx
leaq (%rsp,%rbx,8), %r10
addq $0x3e6, %r10            # imm = 0x3E6
xorl %ebx, %ebx
cmpl %edi, %ebp
cmovgeq %rcx, %r10
setl %bl
subq %rbx, %rdx
leaq 0x3f3c(%rip), %rcx      # 0x8ed0
movl (%rcx,%rdx,8), %edi
andl %ebp, %edi
movl %eax, %ecx
shlq %cl, %rdi
addl %edx, %eax
cmpl $0x41, %eax
jae 0x535f
movzwl (%r10), %r10d
orq %rsi, %rdi
movq %rdi, %rsi
movl %eax, %ecx
shrq %cl, %rsi
cmpl $0x40, %eax
je 0x4fc6
testq %rsi, %rsi
jne 0x5340
movl %edx, %ecx
shrl %cl, %ebp
movq 0x18(%rsp), %rcx
movslq 0x60(%rcx,%r11,4), %rbx
leaq 0x3375(%rip), %rcx      # 0x8350
movzbl (%rbx,%rcx), %r12d
leaq 0x3319(%rip), %rcx      # 0x8300
movslq (%rcx,%r12,4), %rcx
subq %rcx, %rbx
movl %eax, %ecx
shlq %cl, %rbx
leaq 0x32e6(%rip), %rcx      # 0x82e0
movzbl (%r12,%rcx), %edx
addl %eax, %edx
cmpl $0x41, %edx
jae 0x535f
orq %rdi, %rbx
movq %rbx, %rax
movl %edx, %ecx
shrq %cl, %rax
cmpl $0x40, %edx
je 0x5023
testq %rax, %rax
jne 0x5340
movzwl %r14w, %edi
leaq (%rsp,%r12,8), %rcx
addq $0x484, %rcx            # imm = 0x484
movswl -0x4(%rcx), %r14d
movswq -0x2(%rcx), %rsi
leaq (%rsp,%r12,8), %rax
addq $0x486, %rax            # imm = 0x486
xorl %r12d, %r12d
cmpl %r14d, %edi
cmovgeq %rcx, %rax
setl %r12b
subq %r12, %rsi
leaq 0x3e72(%rip), %rcx      # 0x8ed0
movl (%rcx,%rsi,8), %r12d
andl %edi, %r12d
movl %edx, %ecx
shlq %cl, %r12
addl %esi, %edx
cmpl $0x41, %edx
jae 0x535f
movzwl (%rax), %r14d
orq %rbx, %r12
movq %r12, %rax
movl %edx, %ecx
shrq %cl, %rax
cmpl $0x40, %edx
je 0x5092
testq %rax, %rax
jne 0x5340
addl %r15d, %r13d
addl %ebp, %r10d
movq %r12, (%r9)
movl %edx, %eax
andl $0x7, %eax
movl %edx, %ecx
andb $0x78, %cl
shrq %cl, %r12
shrl $0x3, %edx
movl %esi, %ecx
shrl %cl, %edi
addq %rdx, %r9
addl %edi, %r14d
movq %r12, %rdx
movl %eax, %ecx
shrq %cl, %rdx
testq %rdx, %rdx
movq 0x18(%rsp), %rbp
je 0x4dbd
jmp 0x4cd0
leal 0x7(%rax), %ecx
movl %ecx, %edx
andl $0x8, %edx
movq %r12, (%r9)
movl %edx, %esi
negl %esi
addl %eax, %esi
addl $0x7, %esi
cmpl $0x8, %esi
jae 0x53bc
subl %edx, %eax
shrl $0x3, %ecx
addq %rcx, %r9
movl 0x28(%rbp), %ecx
movl %r9d, %edx
subl %ecx, %edx
movl %edx, 0xf4(%rsp)
movl %eax, 0x104(%rsp)
movw %r14w, 0x108(%rsp)
movw %r10w, 0x10a(%rsp)
movw %r13w, 0x10c(%rsp)
movq %r9, 0x28(%rbp)
xorl %ecx, %ecx
movl 0x14(%rsp), %r14d
xorl %r10d, %r10d
jmp 0x5146
xorl %r8d, %r8d
movl 0x14(%rsp), %r14d
xorl %r10d, %r10d
movl $0x13, %ecx
cmpl $0x13, %ecx
je 0x52e9
testl %ecx, %ecx
jne 0x532b
movq $0x0, 0x58(%rbp)
movl 0xf0(%rsp), %ecx
movl 0xf4(%rsp), %eax
leal (%rax,%rcx), %edx
movl %edx, 0xe4(%rsp)
movq 0x8(%rsp), %rsi
movl $0x32787662, (%rsi)     # imm = 0x32787662
movl 0xe0(%rsp), %edx
movl %edx, 0x4(%rsi)
movl 0xe8(%rsp), %edx
cmpq $0x100000, %rdx         # imm = 0x100000
jae 0x539d
cmpl $0x100000, %ecx         # imm = 0x100000
jae 0x539d
movl 0xec(%rsp), %esi
cmpq $0x100000, %rsi         # imm = 0x100000
jae 0x539d
movl 0xf8(%rsp), %edi
addl $0x7, %edi
cmpl $0x8, %edi
jae 0x539d
shlq $0x14, %rcx
orq %rdx, %rcx
shlq $0x28, %rsi
orq %rcx, %rsi
shlq $0x3c, %rdi
orq %rsi, %rdi
movq 0x20(%rsp), %rcx
movq %rdi, (%rcx)
movzwl 0xfc(%rsp), %ecx
cmpq $0x400, %rcx            # imm = 0x400
jae 0x539d
movzwl 0xfe(%rsp), %esi
cmpq $0x400, %rsi            # imm = 0x400
jae 0x539d
movzwl 0x100(%rsp), %edx
cmpq $0x400, %rdx            # imm = 0x400
jae 0x539d
movzwl 0x102(%rsp), %edi
cmpq $0x400, %rdi            # imm = 0x400
jae 0x539d
cmpl $0x100000, %eax         # imm = 0x100000
jae 0x539d
movl 0x104(%rsp), %r9d
addl $0x7, %r9d
cmpl $0x8, %r9d
jae 0x539d
shll $0xa, %esi
shlq $0x14, %rdx
orq %rsi, %rdx
shlq $0x1e, %rdi
shlq $0x28, %rax
shlq $0x3c, %r9
orq %rdi, %r9
orq %rcx, %rax
orq %rdx, %rax
orq %r9, %rax
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movzwl 0x108(%rsp), %eax
cmpq $0x400, %rax            # imm = 0x400
jae 0x539d
movzwl 0x10a(%rsp), %ecx
cmpq $0x400, %rcx            # imm = 0x400
jae 0x539d
movzwl 0x10c(%rsp), %edx
cmpq $0x400, %rdx            # imm = 0x400
jae 0x539d
shlq $0x20, %rax
shlq $0x2a, %rcx
orq %rax, %rcx
shlq $0x34, %rdx
orq %rcx, %rdx
movq 0x8(%rsp), %rax
orq %rdx, 0x18(%rax)
testl %r8d, %r8d
jne 0x532b
movl 0x58(%rbp), %eax
testq %rax, %rax
je 0x5318
xorl %ecx, %ecx
xorl %edx, %edx
movl 0x138e0(%rbp,%rcx,4), %esi
testl %esi, %esi
jne 0x530e
movl %edx, 0x138e0(%rbp,%rcx,4)
movl %edx, %esi
incq %rcx
movl %esi, %edx
cmpq %rcx, %rax
jne 0x52fa
movl %r14d, 0x5c(%rbp)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rbp)
movl $0xfffffffe, %r10d      # imm = 0xFFFFFFFE
movl %r10d, %eax
addq $0x1428, %rsp           # imm = 0x1428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x437b(%rip), %rdi      # 0x96c2
leaq 0x432f(%rip), %rsi      # 0x967d
leaq 0x4435(%rip), %rcx      # 0x978a
movl $0x10c, %edx            # imm = 0x10C
callq 0x3070
leaq 0x43f8(%rip), %rdi      # 0x975e
leaq 0x4310(%rip), %rsi      # 0x967d
leaq 0x4416(%rip), %rcx      # 0x978a
movl $0x10b, %edx            # imm = 0x10B
callq 0x3070
leaq 0x422b(%rip), %rdi      # 0x95b0
leaq 0x41cc(%rip), %rsi      # 0x9558
leaq 0x4231(%rip), %rcx      # 0x95c4
movl $0x81, %edx
callq 0x3070
leaq 0x42b6(%rip), %rdi      # 0x965a
leaq 0x41ad(%rip), %rsi      # 0x9558
leaq 0x4282(%rip), %rcx      # 0x9634
movl $0x26, %edx
callq 0x3070
leaq 0x4339(%rip), %rdi      # 0x96fc
leaq 0x42b3(%rip), %rsi      # 0x967d
leaq 0x4357(%rip), %rcx      # 0x9728
movl $0xeb, %edx
callq 0x3070
nop