// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movl 0x5c(%rdi), %ebp
testl %ebp, %ebp
jne 0x416c
cmpl $0x0, 0x58(%rbx)
je 0x480f
leaq 0xe4(%rsp), %rdi
movl $0x2fc, %edx            # imm = 0x2FC
xorl %esi, %esi
callq 0x3080
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rsp)
movl %ebp, %r15d
testb $0x3, %r15b
je 0x41a9
movl %r15d, %eax
leal 0x1(%r15), %ecx
movl %ecx, 0x5c(%rbx)
movb $0x0, 0x1d520(%rbx,%rax)
movl %ecx, %r15d
jmp 0x418c
movl 0x58(%rbx), %r12d
xorl %eax, %eax
xorl %ecx, %ecx
cmpq %rax, %r12
je 0x41d2
movl 0x138e0(%rbx,%rax,4), %edx
cmpl %ecx, %edx
jne 0x41cb
andl $0x0, 0x138e0(%rbx,%rax,4)
movl %ecx, %edx
incq %rax
movl %edx, %ecx
jmp 0x41b1
movl %ebp, 0x14(%rsp)
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 %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3080
leaq 0x1020(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x3080
leaq 0x40f4(%rip), %rcx      # 0x8340
xorl %ebp, %ebp
cmpq %r14, %r12
je 0x426a
movslq 0x60(%rbx,%r14,4), %rax
addl %eax, %ebp
movzbl (%rax,%rcx), %eax
incl 0x80(%rsp,%rax,4)
incq %r14
jmp 0x424e
xorl %eax, %eax
leaq 0x420d(%rip), %rdx      # 0x8480
xorl %r13d, %r13d
cmpq %rax, %r12
je 0x4293
movslq 0x9ca0(%rbx,%rax,4), %rcx
addl %ecx, %r13d
movzbl (%rcx,%rdx), %ecx
incl 0x30(%rsp,%rcx,4)
incq %rax
jmp 0x4276
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x42b7
movl 0x138e0(%rbx,%r14,4), %edi
callq 0x4e3f
movzbl %al, %eax
incl 0x520(%rsp,%rax,4)
incq %r14
jmp 0x4296
movl 0x14(%rsp), %ecx
movl %ecx, %eax
negl %eax
andl $0x3, %eax
addl %ecx, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x42df
movzbl 0x1d520(%rbx,%rcx), %edx
incl 0x1020(%rsp,%rdx,4)
incq %rcx
jmp 0x42c6
movq 0x8(%rsp), %rax
addq $0x2f0, %rax            # imm = 0x2F0
cmpq 0x38(%rbx), %rax
ja 0x47c1
leaq 0x10e(%rsp), %r14
movl $0x31787662, -0x32(%r14) # imm = 0x31787662
addl %ebp, %r13d
movl %r13d, -0x2e(%r14)
movl %r12d, -0x22(%r14)
movl %r15d, -0x26(%r14)
pushq $0x40
popq %rbp
pushq $0x14
popq %r12
leaq 0x80(%rsp), %rdx
movl %ebp, %edi
movl %r12d, %esi
movq %r14, %rcx
callq 0x72e9
leaq 0x136(%rsp), %rcx
leaq 0x30(%rsp), %rdx
movl %ebp, %edi
movl %r12d, %esi
callq 0x72e9
leaq 0x15e(%rsp), %rcx
leaq 0x520(%rsp), %rdx
movl $0x100, %edi            # imm = 0x100
movl %ebp, %esi
callq 0x72e9
leaq 0x1de(%rsp), %r12
leaq 0x1020(%rsp), %rdx
movl $0x400, %edi            # imm = 0x400
movl $0x100, %esi            # imm = 0x100
movq %r12, %rcx
callq 0x72e9
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %rsi
xorl %edi, %edi
leaq 0x572a(%rip), %r8       # 0x9ac0
leaq 0x5743(%rip), %r9       # 0x9ae0
pushq $0x8
popq %r10
pushq $0xe
popq %r11
xorl %eax, %eax
xorl %ebp, %ebp
cmpq $0x168, %rdi            # imm = 0x168
je 0x4424
movzwl 0x10e(%rsp,%rdi,2), %r15d
cmpl $0x8, %r15d
jae 0x43ce
movl (%r8,%r15,4), %edx
movl %r15d, %ecx
movl (%r9,%rcx,4), %r15d
jmp 0x43ee
movl %r15d, %ecx
shll $0x4, %r15d
cmpw $0x17, %cx
ja 0x43e4
addl $-0x79, %r15d
movl %r10d, %edx
jmp 0x43ee
addl $0xfffffe8f, %r15d      # imm = 0xFFFFFE8F
movl %r11d, %edx
movl %r15d, %r13d
movl %edx, %ecx
shrl %cl, %r13d
testl %r13d, %r13d
jne 0x4d33
movl %eax, %ecx
shll %cl, %r15d
orl %ebp, %r15d
addl %edx, %eax
movl %r15d, %ebp
cmpl $0x8, %eax
jl 0x441f
movb %bpl, (%rsi)
shrl $0x8, %ebp
addl $-0x8, %eax
incq %rsi
jmp 0x440c
incq %rdi
jmp 0x43a9
testl %eax, %eax
jle 0x442e
movb %bpl, (%rsi)
incq %rsi
movq 0x8(%rsp), %rax
subl %eax, %esi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rsi, 0x18(%rax)
addq %rsi, 0x28(%rbx)
pushq $0x40
popq %rbp
pushq $0x14
popq %r15
leaq 0x480(%rsp), %rcx
movl %ebp, %edi
movl %r15d, %esi
movq %r14, %rdx
callq 0x6fcc
leaq 0x3e0(%rsp), %rcx
movl %ebp, %edi
movl %r15d, %esi
leaq 0x136(%rsp), %rdx
callq 0x6fcc
leaq 0x620(%rsp), %rcx
movl $0x100, %edi            # imm = 0x100
movl %ebp, %esi
leaq 0x15e(%rsp), %rdx
callq 0x6fcc
leaq 0x820(%rsp), %rcx
movl $0x400, %edi            # imm = 0x400
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdx
callq 0x6fcc
movq 0x28(%rbx), %rbp
movl 0x5c(%rbx), %r8d
addl $-0x2, %r8d
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %edi, %edi
xorl %eax, %eax
cmpl $-0x2, %r8d
je 0x4750
leaq 0x10(%rbp), %rcx
cmpq 0x38(%rbx), %rcx
ja 0x47c1
leal 0x1(%r8), %ecx
movzbl 0x1d520(%rbx,%rcx), %ecx
movzwl %di, %esi
leaq (%rsp,%rcx,8), %rdi
addq $0x824, %rdi            # imm = 0x824
movswl -0x4(%rdi), %r14d
movswq -0x2(%rdi), %rdx
leaq (%rsp,%rcx,8), %r9
addq $0x826, %r9             # imm = 0x826
xorl %ecx, %ecx
cmpl %r14d, %esi
cmovgeq %rdi, %r9
setl %cl
subq %rcx, %rdx
leaq 0x4997(%rip), %rcx      # 0x8ec0
movl (%rcx,%rdx,8), %edi
andl %esi, %edi
movl %eax, %ecx
shlq %cl, %rdi
addl %edx, %eax
cmpl $0x41, %eax
jae 0x4d14
movl %r12d, 0x4(%rsp)
movl %r11d, (%rsp)
movzwl (%r9), %ecx
movl %ecx, 0x20(%rsp)
orq %r15, %rdi
movq %rdi, %r14
movl %eax, %ecx
shrq %cl, %r14
cmpl $0x40, %eax
je 0x4568
testq %r14, %r14
jne 0x4cf5
movl %edx, %ecx
shrl %cl, %esi
movl %eax, %ecx
movl %r8d, %edx
movzbl 0x1d520(%rbx,%rdx), %r15d
movzwl %r10w, %r14d
leaq 0x824(%rsp,%r15,8), %r12
movswl -0x4(%r12), %r13d
movswq -0x2(%r12), %rdx
leaq (%rsp,%r15,8), %r10
addq $0x826, %r10            # imm = 0x826
xorl %r15d, %r15d
cmpl %r13d, %r14d
cmovgeq %r12, %r10
setl %r15b
subq %r15, %rdx
leaq 0x490b(%rip), %r11      # 0x8ec0
movl (%r11,%rdx,8), %r15d
andl %r14d, %r15d
shlq %cl, %r15
addl %edx, %eax
cmpl $0x41, %eax
jae 0x4d14
movq %rbp, 0x18(%rsp)
movzwl (%r10), %r10d
orq %rdi, %r15
movq %r15, %rdi
movl %eax, %ecx
shrq %cl, %rdi
cmpl $0x40, %eax
movl (%rsp), %r11d
je 0x45f0
testq %rdi, %rdi
jne 0x4cf5
movl %edx, %ecx
shrl %cl, %r14d
movl %eax, %ecx
leal -0x1(%r8), %edx
movzbl 0x1d520(%rbx,%rdx), %edi
movzwl %r11w, %r12d
leaq 0x824(%rsp,%rdi,8), %r13
movswl -0x4(%r13), %ebp
movswq -0x2(%r13), %rdx
leaq (%rsp,%rdi,8), %r11
addq $0x826, %r11            # imm = 0x826
xorl %edi, %edi
cmpl %ebp, %r12d
cmovgeq %r13, %r11
setl %dil
subq %rdi, %rdx
leaq 0x4885(%rip), %rdi      # 0x8ec0
movl (%rdi,%rdx,8), %edi
andl %r12d, %edi
shlq %cl, %rdi
addl %edx, %eax
cmpl $0x41, %eax
jae 0x4d14
movl %r10d, 0x2c(%rsp)
movzwl (%r11), %ecx
movl %ecx, (%rsp)
orq %r15, %rdi
movq %rdi, %r15
movl %eax, %ecx
shrq %cl, %r15
cmpl $0x40, %eax
je 0x4674
testq %r15, %r15
jne 0x4cf5
leal -0x2(%r8), %ebp
movl %edx, %ecx
shrl %cl, %r12d
movl %eax, %ecx
movl %ebp, %edx
movzbl 0x1d520(%rbx,%rdx), %r15d
movzwl 0x4(%rsp), %r13d
leaq 0x824(%rsp,%r15,8), %r11
movswl -0x4(%r11), %r10d
movswq -0x2(%r11), %rdx
leaq (%rsp,%r15,8), %rbp
addq $0x826, %rbp            # imm = 0x826
xorl %r15d, %r15d
cmpl %r10d, %r13d
cmovgeq %r11, %rbp
setl %r15b
subq %r15, %rdx
leaq 0x47fb(%rip), %r10      # 0x8ec0
movl (%r10,%rdx,8), %r15d
andl %r13d, %r15d
shlq %cl, %r15
addl %edx, %eax
cmpl $0x41, %eax
jae 0x4d14
movzwl (%rbp), %r9d
orq %rdi, %r15
movq %r15, %rdi
movl %eax, %ecx
shrq %cl, %rdi
cmpl $0x40, %eax
movl 0x2c(%rsp), %r10d
je 0x46fd
testq %rdi, %rdi
jne 0x4cf5
movl 0x20(%rsp), %edi
addl %esi, %edi
addl %r14d, %r10d
movl (%rsp), %r11d
addl %r12d, %r11d
movq 0x18(%rsp), %rbp
movq %r15, (%rbp)
movl %eax, %esi
movl %eax, %ecx
andb $0x78, %cl
shrq %cl, %r15
andl $0x7, %esi
shrl $0x3, %eax
addq %rax, %rbp
movl %edx, %ecx
shrl %cl, %r13d
movq %r15, %rdx
movl %esi, %ecx
shrq %cl, %rdx
movl %r9d, %r12d
addl %r13d, %r12d
addl $-0x4, %r8d
movl %esi, %eax
testq %rdx, %rdx
je 0x44cc
jmp 0x4afd
leal 0x7(%rax), %ecx
movl %ecx, %edx
andl $0x8, %edx
movq %r15, (%rbp)
movl %edx, %esi
negl %esi
addl %eax, %esi
addl $0x7, %esi
cmpl $0x8, %esi
jae 0x4d52
subl %edx, %eax
shrl $0x3, %ecx
leaq (%rcx,%rbp), %rdx
movl %eax, 0xf8(%rsp)
movl 0x28(%rbx), %eax
movl %edx, %esi
subl %eax, %esi
movl %esi, 0xf0(%rsp)
movw %r12w, 0xfc(%rsp)
movw %r11w, 0xfe(%rsp)
movw %r10w, 0x100(%rsp)
movw %di, 0x102(%rsp)
movq %rdx, 0x28(%rbx)
leaq (%rcx,%rbp), %rdi
addq $0x8, %rdi
cmpq 0x38(%rbx), %rdi
jbe 0x4813
movl 0x58(%rbx), %eax
xorl %ecx, %ecx
xorl %edx, %edx
movl 0x14(%rsp), %edi
cmpq %rcx, %rax
je 0x47ec
movl 0x138e0(%rbx,%rcx,4), %esi
testl %esi, %esi
jne 0x47e5
movl %edx, 0x138e0(%rbx,%rcx,4)
movl %edx, %esi
incq %rcx
movl %esi, %edx
jmp 0x47cc
movl %edi, 0x5c(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rbx)
pushq $-0x2
popq %rbx
movl %ebx, %eax
addq $0x1428, %rsp           # imm = 0x1428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x47fb
movl 0x58(%rbx), %r13d
andq $0x0, (%rdx)
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %r11d, %r11d
xorl %r15d, %r15d
xorl %r10d, %r10d
subq $0x1, %r13
jb 0x4b1c
leaq 0x10(%rdi), %rax
cmpq 0x38(%rbx), %rax
ja 0x47c1
movl %r11d, 0x4(%rsp)
movq %r13, %rax
movl %r10d, %r13d
movl %r15d, (%rsp)
movq %rdi, 0x20(%rsp)
movq %rax, %r12
movslq 0x138e0(%rbx,%rax,4), %r15
movl %r15d, %edi
callq 0x4e3f
movzbl %al, %esi
leaq 0x38f2(%rip), %rax      # 0x8160
movslq (%rax,%rsi,4), %rax
subq %rax, %r15
movl %r14d, %ecx
shlq %cl, %r15
leaq 0x389e(%rip), %rax      # 0x8120
movzbl (%rsi,%rax), %eax
addl %r14d, %eax
cmpl $0x41, %eax
jae 0x4d14
orq %rbp, %r15
movq %r15, %rdx
movl %eax, %ecx
shrq %cl, %rdx
cmpl $0x40, %eax
leaq 0x3bd9(%rip), %r11      # 0x8480
je 0x48b2
testq %rdx, %rdx
jne 0x4cf5
movl %eax, %ecx
movzwl %r13w, %edi
leaq (%rsp,%rsi,8), %r8
addq $0x624, %r8             # imm = 0x624
movswl -0x4(%r8), %r9d
movswq -0x2(%r8), %rdx
leaq (%rsp,%rsi,8), %rsi
addq $0x626, %rsi            # imm = 0x626
xorl %r10d, %r10d
cmpl %r9d, %edi
cmovgeq %r8, %rsi
setl %r10b
subq %r10, %rdx
leaq 0x45d0(%rip), %r8       # 0x8ec0
movl (%r8,%rdx,8), %r8d
andl %edi, %r8d
shlq %cl, %r8
addl %edx, %eax
cmpl $0x41, %eax
jae 0x4d14
movzwl (%rsi), %ecx
movl %ecx, 0x18(%rsp)
orq %r15, %r8
movq %r8, %rsi
movl %eax, %ecx
shrq %cl, %rsi
cmpl $0x40, %eax
movq %r12, %r13
je 0x4928
testq %rsi, %rsi
jne 0x4cf5
movl %eax, %esi
movl %edx, %ecx
shrl %cl, %edi
movslq 0x9ca0(%rbx,%r13,4), %r9
movzbl (%r9,%r11), %r10d
leaq 0x393e(%rip), %rcx      # 0x8280
movslq (%rcx,%r10,4), %rcx
subq %rcx, %r9
movl %esi, %ecx
shlq %cl, %r9
leaq 0x390b(%rip), %rcx      # 0x8260
movzbl (%r10,%rcx), %edx
addl %eax, %edx
cmpl $0x41, %edx
movl (%rsp), %r12d
jae 0x4d14
orq %r8, %r9
movq %r9, %rax
movl %edx, %ecx
shrq %cl, %rax
cmpl $0x40, %edx
je 0x4982
testq %rax, %rax
jne 0x4cf5
movl %edx, %ecx
movzwl %r12w, %r8d
leaq (%rsp,%r10,8), %r11
addq $0x3e4, %r11            # imm = 0x3E4
movswl -0x4(%r11), %ebp
movswq -0x2(%r11), %rax
leaq (%rsp,%r10,8), %rsi
addq $0x3e6, %rsi            # imm = 0x3E6
xorl %r10d, %r10d
cmpl %ebp, %r8d
cmovgeq %r11, %rsi
setl %r10b
subq %r10, %rax
leaq 0x4500(%rip), %r10      # 0x8ec0
movl (%r10,%rax,8), %r10d
andl %r8d, %r10d
shlq %cl, %r10
addl %eax, %edx
cmpl $0x41, %edx
jae 0x4d14
movzwl (%rsi), %r15d
orq %r9, %r10
movq %r10, %rsi
movl %edx, %ecx
shrq %cl, %rsi
cmpl $0x40, %edx
je 0x49f2
testq %rsi, %rsi
jne 0x4cf5
movl %edx, %esi
movl %eax, %ecx
shrl %cl, %r8d
movslq 0x60(%rbx,%r13,4), %r9
leaq 0x393b(%rip), %rax      # 0x8340
movzbl (%r9,%rax), %r11d
leaq 0x38df(%rip), %rax      # 0x82f0
movslq (%rax,%r11,4), %rax
subq %rax, %r9
movl %esi, %ecx
shlq %cl, %r9
leaq 0x38ac(%rip), %rax      # 0x82d0
movzbl (%r11,%rax), %eax
addl %edx, %eax
cmpl $0x41, %eax
jae 0x4d14
orq %r10, %r9
movq %r9, %rdx
movl %eax, %ecx
shrq %cl, %rdx
cmpl $0x40, %eax
je 0x4a4d
testq %rdx, %rdx
jne 0x4cf5
movl %eax, %ecx
movzwl 0x4(%rsp), %esi
leaq (%rsp,%r11,8), %r14
addq $0x484, %r14            # imm = 0x484
movswl -0x4(%r14), %ebp
movswq -0x2(%r14), %rdx
leaq (%rsp,%r11,8), %r10
addq $0x486, %r10            # imm = 0x486
xorl %r11d, %r11d
cmpl %ebp, %esi
cmovgeq %r14, %r10
setl %r11b
subq %r11, %rdx
leaq 0x4435(%rip), %r11      # 0x8ec0
movl (%r11,%rdx,8), %ebp
andl %esi, %ebp
shlq %cl, %rbp
addl %edx, %eax
cmpl $0x41, %eax
jae 0x4d14
movzwl (%r10), %r11d
orq %r9, %rbp
movq %rbp, %r9
movl %eax, %ecx
shrq %cl, %r9
cmpl $0x40, %eax
movl 0x18(%rsp), %r10d
je 0x4ac1
testq %r9, %r9
jne 0x4cf5
addl %edi, %r10d
addl %r8d, %r15d
movq 0x20(%rsp), %rdi
movq %rbp, (%rdi)
movl %eax, %r14d
andl $0x7, %r14d
movl %eax, %ecx
andb $0x78, %cl
shrq %cl, %rbp
shrl $0x3, %eax
movl %edx, %ecx
shrl %cl, %esi
addq %rax, %rdi
addl %esi, %r11d
movq %rbp, %rax
movl %r14d, %ecx
shrq %cl, %rax
testq %rax, %rax
je 0x4829
leaq 0x4be0(%rip), %rdi      # 0x96e4
leaq 0x4b94(%rip), %rsi      # 0x969f
leaq 0x4b9d(%rip), %rcx      # 0x96af
movl $0xc2, %edx
callq 0x3070
leal 0x7(%r14), %eax
movl %eax, %ecx
andl $0x8, %ecx
movq %rbp, (%rdi)
movl %ecx, %edx
negl %edx
addl %r14d, %edx
addl $0x7, %edx
cmpl $0x8, %edx
jae 0x4d52
subl %ecx, %r14d
shrl $0x3, %eax
addq %rax, %rdi
movl 0x28(%rbx), %eax
movl %edi, %ecx
subl %eax, %ecx
movl %ecx, 0xf4(%rsp)
movl %r14d, 0x104(%rsp)
movw %r11w, 0x108(%rsp)
movw %r15w, 0x10a(%rsp)
movw %r10w, 0x10c(%rsp)
movq %rdi, 0x28(%rbx)
andq $0x0, 0x58(%rbx)
addl 0xf0(%rsp), %ecx
movl %ecx, 0xe4(%rsp)
movq 0x8(%rsp), %rbp
movl $0x32787662, (%rbp)     # imm = 0x32787662
movl 0xe0(%rsp), %eax
movl %eax, 0x4(%rbp)
movl 0xe8(%rsp), %edi
xorl %ebx, %ebx
pushq $0x14
popq %r13
xorl %esi, %esi
movl %r13d, %edx
callq 0x4eae
movq %rax, %r14
movl 0xf0(%rsp), %edi
movl %r13d, %esi
movl %r13d, %edx
callq 0x4eae
movq %rax, %r12
orq %r14, %r12
movl 0xec(%rsp), %edi
pushq $0x28
popq %rsi
movl %r13d, %edx
callq 0x4eae
movq %rax, %r14
orq %r12, %r14
movl 0xf8(%rsp), %edi
addl $0x7, %edi
pushq $0x3c
popq %rsi
pushq $0x3
popq %rdx
callq 0x4eae
orq %r14, %rax
movq %rax, 0x8(%rbp)
movzwl 0xfc(%rsp), %edi
pushq $0xa
popq %r14
xorl %esi, %esi
movl %r14d, %edx
callq 0x4eae
movq %rax, %r15
movzwl 0xfe(%rsp), %edi
movl %r14d, %esi
movl %r14d, %edx
callq 0x4eae
movq %rax, %r12
orq %r15, %r12
movzwl 0x100(%rsp), %edi
movl %r13d, %esi
movl %r14d, %edx
callq 0x4eae
movq %rax, %r15
movzwl 0x102(%rsp), %edi
pushq $0x1e
popq %rsi
movl %r14d, %edx
callq 0x4eae
movq %rax, %r13
orq %r15, %r13
orq %r12, %r13
movl 0xf4(%rsp), %edi
pushq $0x28
popq %rsi
pushq $0x14
popq %rdx
callq 0x4eae
movq %rax, %r15
movl 0x104(%rsp), %edi
addl $0x7, %edi
pushq $0x3c
popq %rsi
pushq $0x3
popq %rdx
callq 0x4eae
orq %r15, %rax
orq %r13, %rax
movq %rax, 0x10(%rbp)
movq 0x18(%rbp), %r12
movzwl 0x108(%rsp), %edi
pushq $0x20
popq %rsi
movl %r14d, %edx
callq 0x4eae
movq %rax, %r15
orq %r12, %r15
movzwl 0x10a(%rsp), %edi
pushq $0x2a
popq %rsi
movl %r14d, %edx
callq 0x4eae
movq %rax, %r12
movzwl 0x10c(%rsp), %edi
pushq $0x34
popq %rsi
movl %r14d, %edx
callq 0x4eae
orq %r12, %rax
orq %r15, %rax
movq %rax, 0x18(%rbp)
jmp 0x47fb
leaq 0x49e8(%rip), %rdi      # 0x96e4
leaq 0x499c(%rip), %rsi      # 0x969f
leaq 0x4aa2(%rip), %rcx      # 0x97ac
movl $0x10c, %edx            # imm = 0x10C
callq 0x3070
leaq 0x4a65(%rip), %rdi      # 0x9780
leaq 0x497d(%rip), %rsi      # 0x969f
leaq 0x4a83(%rip), %rcx      # 0x97ac
movl $0x10b, %edx            # imm = 0x10B
callq 0x3070
leaq 0x4866(%rip), %rdi      # 0x95a0
leaq 0x4807(%rip), %rsi      # 0x9548
leaq 0x486c(%rip), %rcx      # 0x95b4
movl $0x81, %edx
callq 0x3070
leaq 0x49c5(%rip), %rdi      # 0x971e
leaq 0x493f(%rip), %rsi      # 0x969f
leaq 0x49e3(%rip), %rcx      # 0x974a
movl $0xeb, %edx
callq 0x3070