// File: /workspace/github_cpp_makefile_star2_O3/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
movl 0x5c(%rdi), %r15d
testl %r15d, %r15d
movq %rdi, 0x8(%rsp)
je 0x45a3
leaq 0xdc(%rsp), %rdi
movl $0x304, %edx            # imm = 0x304
xorl %esi, %esi
callq 0x3080
movq 0x8(%rsp), %rsi
movq 0x28(%rsi), %r14
testb $0x3, %r15b
movl %r15d, 0x14(%rsp)
je 0x45d2
movl %r15d, %eax
incl %r15d
movb $0x0, 0x1d520(%rsi,%rax)
testb $0x3, %r15b
jne 0x4589
movl %r15d, 0x5c(%rsi)
jmp 0x45d2
cmpl $0x0, 0x58(%rdi)
je 0x528a
movl %r15d, 0x14(%rsp)
leaq 0xdc(%rsp), %rdi
xorl %r15d, %r15d
movl $0x304, %edx            # imm = 0x304
xorl %esi, %esi
callq 0x3080
movq 0x8(%rsp), %rsi
movq 0x28(%rsi), %r14
movl 0x58(%rsi), %r12d
testq %r12, %r12
je 0x4790
xorl %eax, %eax
xorl %ecx, %ecx
movl 0x138e0(%rsi,%rax,4), %edx
cmpl %ecx, %edx
jne 0x45fb
movl $0x0, 0x138e0(%rsi,%rax,4)
movl %ecx, %edx
incq %rax
movl %edx, %ecx
cmpq %rax, %r12
jne 0x45e3
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
movq 0x8(%rsp), %r8
movl $0x0, %eax
testl %r12d, %r12d
je 0x480b
xorl %ecx, %ecx
leaq 0x3cb0(%rip), %rdx      # 0x8340
xorl %eax, %eax
movslq 0x60(%r8,%rcx,4), %rsi
movzbl (%rsi,%rdx), %edi
incl 0x80(%rsp,%rdi,4)
addl %esi, %eax
incq %rcx
cmpq %rcx, %r12
jne 0x4692
testl %r12d, %r12d
je 0x4808
xorl %ecx, %ecx
leaq 0x3dc2(%rip), %rdx      # 0x8480
xorl %r13d, %r13d
movslq 0x9ca0(%r8,%rcx,4), %rsi
movzbl (%rsi,%rdx), %edi
incl 0x30(%rsp,%rdi,4)
addl %esi, %r13d
incq %rcx
cmpq %rcx, %r12
jne 0x46c1
testl %r12d, %r12d
je 0x480b
xorl %ecx, %ecx
movl $0x3c00, %edx           # imm = 0x3C00
movl $0x3c000, %esi          # imm = 0x3C000
leaq 0x46c8(%rip), %rdi      # 0x8dc0
movq %r8, %rbp
xorl %r8d, %r8d
movl 0x138e0(%rbp,%r8,4), %r9d
movl %r9d, %r11d
subl $0x3c, %r11d
movl $0x0, %ebx
cmovbl %r9d, %ebx
movl %r11d, %r10d
shrl $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 0x46fe
movq %rbp, %r8
jmp 0x480b
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
movq 0x8(%rsp), %r8
xorl %eax, %eax
jmp 0x480b
xorl %r13d, %r13d
testl %r15d, %r15d
je 0x482d
movl %r15d, %ecx
xorl %edx, %edx
movzbl 0x1d520(%r8,%rdx), %esi
incl 0x1020(%rsp,%rsi,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x4815
movq %r14, 0x18(%rsp)
leaq 0x2f0(%r14), %rcx
cmpq 0x38(%r8), %rcx
ja 0x4d18
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 0x79ae
leaq 0x136(%rsp), %r15
leaq 0x30(%rsp), %rdx
movl $0x40, %edi
movl $0x14, %esi
movq %r15, %rcx
callq 0x79ae
leaq 0x15e(%rsp), %r12
leaq 0x520(%rsp), %rdx
movl $0x100, %edi            # imm = 0x100
movl $0x40, %esi
movq %r12, %rcx
callq 0x79ae
leaq 0x1de(%rsp), %r13
leaq 0x1020(%rsp), %rdx
movl $0x400, %edi            # imm = 0x400
movl $0x100, %esi            # imm = 0x100
movq %r13, %rcx
callq 0x79ae
movq 0x18(%rsp), %rax
leaq 0x20(%rax), %rsi
xorl %r8d, %r8d
leaq 0x51ee(%rip), %r9       # 0x9ae0
leaq 0x5207(%rip), %r10      # 0x9b00
xorl %edi, %edi
xorl %eax, %eax
movzwl 0x10e(%rsp,%r8,2), %r11d
cmpl $0x8, %r11d
jae 0x4919
movl (%r9,%r11,4), %edx
movl %r11d, %ecx
movl (%r10,%rcx,4), %r11d
jmp 0x493d
movl %r11d, %ecx
shll $0x4, %r11d
cmpw $0x17, %cx
ja 0x4931
addl $-0x79, %r11d
movl $0x8, %edx
jmp 0x493d
addl $0xfffffe8f, %r11d      # imm = 0xFFFFFE8F
movl $0xe, %edx
movl %r11d, %ebx
movl %edx, %ecx
shrl %cl, %ebx
testl %ebx, %ebx
jne 0x52cf
movl %eax, %ecx
shll %cl, %r11d
orl %r11d, %edi
addl %eax, %edx
cmpl $0x8, %edx
jl 0x4970
movb %dil, (%rsi)
shrl $0x8, %edi
leal -0x8(%rdx), %eax
incq %rsi
cmpl $0xf, %edx
movl %eax, %edx
ja 0x495b
jmp 0x4972
movl %edx, %eax
incq %r8
cmpq $0x168, %r8             # imm = 0x168
jne 0x48fd
testl %eax, %eax
jle 0x498c
movb %dil, (%rsi)
incq %rsi
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
subl %eax, %esi
leaq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rsi, 0x18(%rax)
addq %rsi, 0x28(%rcx)
leaq 0x480(%rsp), %rcx
movl $0x40, %edi
movl $0x14, %esi
movq %r14, %rdx
callq 0x76bc
leaq 0x3e0(%rsp), %rcx
movl $0x40, %edi
movl $0x14, %esi
movq %r15, %rdx
callq 0x76bc
leaq 0x620(%rsp), %rcx
movl $0x100, %edi            # imm = 0x100
movl $0x40, %esi
movq %r12, %rdx
callq 0x76bc
leaq 0x820(%rsp), %rcx
movl $0x400, %edi            # imm = 0x400
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdx
callq 0x76bc
movq 0x8(%rsp), %r8
movq 0x28(%r8), %r14
movl 0x5c(%r8), %r9d
addl $-0x2, %r9d
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %eax, %eax
cmpl $-0x2, %r9d
je 0x4ca6
leaq 0x10(%r14), %rcx
cmpq 0x38(%r8), %rcx
ja 0x4d18
leal 0x1(%r9), %ecx
movzbl 0x1d520(%r8,%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
leaq 0x4428(%rip), %rcx      # 0x8ec0
movl (%rcx,%rdx,8), %ebx
andl %esi, %ebx
movl %eax, %ecx
shlq %cl, %rbx
addl %edx, %eax
cmpl $0x41, %eax
jae 0x52b0
movl %r12d, 0x10(%rsp)
movzwl (%rdi), %r10d
orq %r13, %rbx
movq %rbx, %rdi
movl %eax, %ecx
shrq %cl, %rdi
cmpl $0x40, %eax
je 0x4acf
testq %rdi, %rdi
jne 0x5291
movl %edx, %ecx
shrl %cl, %esi
movl %eax, %ecx
movl %r9d, %edx
movzbl 0x1d520(%r8,%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 0x43a7(%rip), %rdi      # 0x8ec0
movl (%rdi,%rdx,8), %edi
andl %r12d, %edi
shlq %cl, %rdi
addl %edx, %eax
cmpl $0x41, %eax
jae 0x52b0
movq %r14, 0x28(%rsp)
movzwl (%r11), %r11d
orq %rbx, %rdi
movq %rdi, %rbx
movl %eax, %ecx
shrq %cl, %rbx
cmpl $0x40, %eax
je 0x4b4f
testq %rbx, %rbx
jne 0x5291
movl %edx, %ecx
shrl %cl, %r12d
movl %eax, %ecx
leal -0x1(%r9), %edx
movzbl 0x1d520(%r8,%rdx), %ebx
movzwl 0x10(%rsp), %ebp
leaq 0x824(%rsp,%rbx,8), %r13
movswl -0x4(%r13), %r8d
movswq -0x2(%r13), %rdx
leaq (%rsp,%rbx,8), %r14
addq $0x826, %r14            # imm = 0x826
xorl %ebx, %ebx
cmpl %r8d, %ebp
cmovgeq %r13, %r14
setl %bl
subq %rbx, %rdx
leaq 0x4325(%rip), %r8       # 0x8ec0
movl (%r8,%rdx,8), %ebx
andl %ebp, %ebx
shlq %cl, %rbx
addl %edx, %eax
cmpl $0x41, %eax
jae 0x52b0
movzwl (%r14), %ecx
movl %ecx, 0x10(%rsp)
orq %rdi, %rbx
movq %rbx, %rdi
movl %eax, %ecx
shrq %cl, %rdi
cmpl $0x40, %eax
je 0x4bd0
testq %rdi, %rdi
jne 0x5291
leal -0x2(%r9), %edi
movl %edx, %ecx
shrl %cl, %ebp
movl %eax, %ecx
movl %edi, %edx
movq 0x8(%rsp), %rdi
movzbl 0x1d520(%rdi,%rdx), %r8d
movzwl %r15w, %edi
leaq 0x824(%rsp,%r8,8), %r13
movswl -0x4(%r13), %r14d
movswq -0x2(%r13), %rdx
leaq (%rsp,%r8,8), %r15
addq $0x826, %r15            # imm = 0x826
xorl %r8d, %r8d
cmpl %r14d, %edi
cmovgeq %r13, %r15
setl %r8b
subq %r8, %rdx
leaq 0x429d(%rip), %r8       # 0x8ec0
movl (%r8,%rdx,8), %r13d
andl %edi, %r13d
shlq %cl, %r13
addl %edx, %eax
cmpl $0x41, %eax
jae 0x52b0
movzwl (%r15), %r15d
orq %rbx, %r13
movq %r13, %rbx
movl %eax, %ecx
shrq %cl, %rbx
cmpl $0x40, %eax
movq 0x28(%rsp), %r14
je 0x4c5a
testq %rbx, %rbx
jne 0x5291
addl %esi, %r10d
addl %r12d, %r11d
movl 0x10(%rsp), %r12d
addl %ebp, %r12d
movq %r13, (%r14)
movl %eax, %esi
movl %eax, %ecx
andb $0x78, %cl
shrq %cl, %r13
andl $0x7, %esi
shrl $0x3, %eax
addq %rax, %r14
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 0x8(%rsp), %r8
je 0x4a3a
jmp 0x50b2
leal 0x7(%rax), %ecx
movl %ecx, %edx
andl $0x8, %edx
movq %r13, (%r14)
movl %edx, %esi
negl %esi
addl %eax, %esi
addl $0x7, %esi
cmpl $0x8, %esi
jae 0x530d
subl %edx, %eax
shrl $0x3, %ecx
leaq (%r14,%rcx), %rdx
movl %eax, 0xf8(%rsp)
movl 0x28(%r8), %eax
movl %edx, %esi
subl %eax, %esi
movl %esi, 0xf0(%rsp)
movw %r15w, 0xfc(%rsp)
movw %r12w, 0xfe(%rsp)
movw %r11w, 0x100(%rsp)
movw %r10w, 0x102(%rsp)
movq %rdx, 0x28(%r8)
leaq (%r14,%rcx), %r11
addq $0x8, %r11
cmpq 0x38(%r8), %r11
jbe 0x4d6e
movl 0x58(%r8), %eax
testq %rax, %rax
movq 0x18(%rsp), %rdi
movl 0x14(%rsp), %r9d
je 0x4d4f
xorl %ecx, %ecx
xorl %edx, %edx
movl 0x138e0(%r8,%rcx,4), %esi
testl %esi, %esi
jne 0x4d45
movl %edx, 0x138e0(%r8,%rcx,4)
movl %edx, %esi
incq %rcx
movl %esi, %edx
cmpq %rcx, %rax
jne 0x4d2f
movl %r9d, 0x5c(%r8)
movq %rdi, 0x28(%r8)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x1428, %rsp           # imm = 0x1428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x58(%r8), %r14d
movq $0x0, (%rdx)
xorl %eax, %eax
xorl %ebp, %ebp
xorl %r10d, %r10d
xorl %r9d, %r9d
xorl %r13d, %r13d
subq $0x1, %r14
jb 0x50d1
leaq 0x10(%r11), %rcx
movq 0x8(%rsp), %r8
cmpq 0x38(%r8), %rcx
ja 0x4d18
movslq 0x138e0(%r8,%r14,4), %rsi
movl %esi, %edx
subl $0x3c, %edx
movl $0x0, %edi
cmovbl %esi, %edi
movl %edx, %ecx
shrl $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, %r8d           # imm = 0x3C00
cmpl %r8d, %edx
cmovael %r8d, %edi
leal -0x3ffc(%rsi), %edx
leal 0xfc004(%rsi), %ebx
shrl $0xc, %ebx
addl $0xc0, %ebx
movl $0x3c000, %r8d          # imm = 0x3C000
cmpl %r8d, %edx
cmovael %r8d, %ebx
orl %edi, %ebx
orl %ecx, %ebx
movzbl %bl, %ecx
leaq 0x3fa2(%rip), %rdx      # 0x8dc0
movzbl (%rcx,%rdx), %edi
leaq 0x3337(%rip), %rcx      # 0x8160
movslq (%rcx,%rdi,4), %rcx
subq %rcx, %rsi
movl %eax, %ecx
shlq %cl, %rsi
leaq 0x32e4(%rip), %rcx      # 0x8120
movzbl (%rdi,%rcx), %edx
addl %eax, %edx
cmpl $0x41, %edx
jae 0x52b0
orq %rbp, %rsi
movq %rsi, %rax
movl %edx, %ecx
shrq %cl, %rax
cmpl $0x40, %edx
je 0x4e64
testq %rax, %rax
jne 0x5291
movl %edx, %ecx
movzwl %r13w, %r15d
leaq (%rsp,%rdi,8), %r8
addq $0x624, %r8             # imm = 0x624
movswl -0x4(%r8), %ebx
movswq -0x2(%r8), %rax
leaq (%rsp,%rdi,8), %rdi
addq $0x626, %rdi            # imm = 0x626
xorl %r12d, %r12d
cmpl %ebx, %r15d
cmovgeq %r8, %rdi
setl %r12b
subq %r12, %rax
leaq 0x401e(%rip), %r8       # 0x8ec0
movl (%r8,%rax,8), %ebx
andl %r15d, %ebx
shlq %cl, %rbx
addl %eax, %edx
cmpl $0x41, %edx
jae 0x52b0
movzwl (%rdi), %r8d
orq %rsi, %rbx
movq %rbx, %rsi
movl %edx, %ecx
shrq %cl, %rsi
cmpl $0x40, %edx
je 0x4ed4
testq %rsi, %rsi
jne 0x5291
movl %edx, %esi
movl %eax, %ecx
shrl %cl, %r15d
movq 0x8(%rsp), %rax
movslq 0x9ca0(%rax,%r14,4), %rdi
leaq 0x3591(%rip), %rax      # 0x8480
movzbl (%rdi,%rax), %ebp
leaq 0x3386(%rip), %rax      # 0x8280
movslq (%rax,%rbp,4), %rax
subq %rax, %rdi
movl %esi, %ecx
shlq %cl, %rdi
leaq 0x3353(%rip), %rax      # 0x8260
movzbl (%rbp,%rax), %eax
addl %edx, %eax
cmpl $0x41, %eax
jae 0x52b0
movl %r8d, 0x10(%rsp)
orq %rbx, %rdi
movq %rdi, %rdx
movl %eax, %ecx
shrq %cl, %rdx
cmpl $0x40, %eax
je 0x4f3b
testq %rdx, %rdx
jne 0x5291
movl %eax, %ecx
movzwl %r9w, %r12d
leaq (%rsp,%rbp,8), %r9
addq $0x3e4, %r9             # imm = 0x3E4
movswl -0x4(%r9), %ebx
movswq -0x2(%r9), %rdx
leaq (%rsp,%rbp,8), %rsi
addq $0x3e6, %rsi            # imm = 0x3E6
xorl %r13d, %r13d
cmpl %ebx, %r12d
cmovgeq %r9, %rsi
setl %r13b
subq %r13, %rdx
leaq 0x3f47(%rip), %r8       # 0x8ec0
movl (%r8,%rdx,8), %ebp
andl %r12d, %ebp
shlq %cl, %rbp
addl %edx, %eax
cmpl $0x41, %eax
jae 0x52b0
movzwl (%rsi), %r9d
orq %rdi, %rbp
movq %rbp, %rsi
movl %eax, %ecx
shrq %cl, %rsi
cmpl $0x40, %eax
je 0x4fab
testq %rsi, %rsi
jne 0x5291
movl %eax, %esi
movl %edx, %ecx
shrl %cl, %r12d
movq 0x8(%rsp), %rcx
movslq 0x60(%rcx,%r14,4), %rbx
leaq 0x337d(%rip), %rcx      # 0x8340
movzbl (%rbx,%rcx), %r13d
leaq 0x3321(%rip), %rcx      # 0x82f0
movslq (%rcx,%r13,4), %rcx
subq %rcx, %rbx
movl %esi, %ecx
shlq %cl, %rbx
leaq 0x32ee(%rip), %rcx      # 0x82d0
movzbl (%r13,%rcx), %edx
addl %eax, %edx
cmpl $0x41, %edx
jae 0x52b0
orq %rbp, %rbx
movq %rbx, %rax
movl %edx, %ecx
shrq %cl, %rax
cmpl $0x40, %edx
je 0x500c
testq %rax, %rax
jne 0x5291
movl %edx, %ecx
movzwl %r10w, %edi
leaq (%rsp,%r13,8), %r10
addq $0x484, %r10            # imm = 0x484
movswl -0x4(%r10), %ebp
movswq -0x2(%r10), %rsi
leaq (%rsp,%r13,8), %rax
addq $0x486, %rax            # imm = 0x486
xorl %r13d, %r13d
cmpl %ebp, %edi
cmovgeq %r10, %rax
setl %r13b
subq %r13, %rsi
leaq 0x3e78(%rip), %r8       # 0x8ec0
movl (%r8,%rsi,8), %ebp
andl %edi, %ebp
shlq %cl, %rbp
addl %esi, %edx
cmpl $0x41, %edx
jae 0x52b0
movzwl (%rax), %r10d
orq %rbx, %rbp
movq %rbp, %rax
movl %edx, %ecx
shrq %cl, %rax
cmpl $0x40, %edx
movl 0x10(%rsp), %r13d
je 0x507e
testq %rax, %rax
jne 0x5291
addl %r15d, %r13d
addl %r12d, %r9d
movq %rbp, (%r11)
movl %edx, %eax
andl $0x7, %eax
movl %edx, %ecx
andb $0x78, %cl
shrq %cl, %rbp
shrl $0x3, %edx
movl %esi, %ecx
shrl %cl, %edi
addq %rdx, %r11
addl %edi, %r10d
movq %rbp, %rdx
movl %eax, %ecx
shrq %cl, %rdx
testq %rdx, %rdx
je 0x4d86
leaq 0x45f9(%rip), %rdi      # 0x96b2
leaq 0x45ad(%rip), %rsi      # 0x966d
leaq 0x45b6(%rip), %rcx      # 0x967d
movl $0xc2, %edx
callq 0x3070
leal 0x7(%rax), %edx
movl %edx, %esi
andl $0x8, %esi
movq %rbp, (%r11)
movl %esi, %ecx
negl %ecx
addl %eax, %ecx
addl $0x7, %ecx
cmpl $0x8, %ecx
jae 0x530d
shrl $0x3, %edx
addq %rdx, %r11
movq %r11, %rdx
movq 0x8(%rsp), %rdi
subq 0x28(%rdi), %rdx
subl %esi, %eax
movl %edx, 0xf4(%rsp)
movl %eax, 0x104(%rsp)
movw %r10w, 0x108(%rsp)
movw %r9w, 0x10a(%rsp)
movw %r13w, 0x10c(%rsp)
movq %r11, 0x28(%rdi)
movq $0x0, 0x58(%rdi)
movl 0xf0(%rsp), %eax
leal (%rax,%rdx), %esi
movl %esi, 0xe4(%rsp)
movq 0x18(%rsp), %rbx
movl $0x32787662, (%rbx)     # imm = 0x32787662
movl 0xe0(%rsp), %esi
movl %esi, 0x4(%rbx)
movl 0xe8(%rsp), %esi
cmpq $0x100000, %rsi         # imm = 0x100000
jae 0x52ee
cmpl $0x100000, %eax         # imm = 0x100000
jae 0x52ee
movl 0xec(%rsp), %edi
cmpq $0x100000, %rdi         # imm = 0x100000
jae 0x52ee
movl 0xf8(%rsp), %r11d
addl $0x7, %r11d
cmpl $0x8, %r11d
jae 0x52ee
shlq $0x14, %rax
orq %rsi, %rax
shlq $0x28, %rdi
orq %rax, %rdi
shlq $0x3c, %r11
orq %rdi, %r11
movq 0x20(%rsp), %rax
movq %r11, (%rax)
movzwl 0xfc(%rsp), %eax
cmpq $0x400, %rax            # imm = 0x400
jae 0x52ee
movzwl 0xfe(%rsp), %esi
cmpq $0x400, %rsi            # imm = 0x400
jae 0x52ee
movzwl 0x100(%rsp), %r11d
cmpq $0x400, %r11            # imm = 0x400
jae 0x52ee
movzwl 0x102(%rsp), %edi
cmpq $0x400, %rdi            # imm = 0x400
jae 0x52ee
cmpl $0x100000, %edx         # imm = 0x100000
jae 0x52ee
shll $0xa, %esi
shlq $0x14, %r11
orq %rsi, %r11
shlq $0x1e, %rdi
orq %r11, %rdi
shlq $0x28, %rdx
shlq $0x3c, %rcx
orq %rdi, %rcx
orq %rax, %rdx
orq %rcx, %rdx
movq %rdx, 0x10(%rbx)
movzwl %r10w, %eax
cmpl $0x400, %eax            # imm = 0x400
jae 0x52ee
movzwl %r9w, %ecx
cmpl $0x400, %ecx            # imm = 0x400
jae 0x52ee
movzwl %r13w, %edx
cmpl $0x400, %edx            # imm = 0x400
jae 0x52ee
shlq $0x20, %rax
shlq $0x2a, %rcx
orq %rax, %rcx
shlq $0x34, %rdx
orq %rcx, %rdx
orq %rdx, 0x18(%rbx)
xorl %eax, %eax
jmp 0x4d5c
leaq 0x441a(%rip), %rdi      # 0x96b2
leaq 0x43ce(%rip), %rsi      # 0x966d
leaq 0x44d4(%rip), %rcx      # 0x977a
movl $0x10c, %edx            # imm = 0x10C
callq 0x3070
leaq 0x4497(%rip), %rdi      # 0x974e
leaq 0x43af(%rip), %rsi      # 0x966d
leaq 0x44b5(%rip), %rcx      # 0x977a
movl $0x10b, %edx            # imm = 0x10B
callq 0x3070
leaq 0x42ca(%rip), %rdi      # 0x95a0
leaq 0x426b(%rip), %rsi      # 0x9548
leaq 0x42d0(%rip), %rcx      # 0x95b4
movl $0x81, %edx
callq 0x3070
leaq 0x4355(%rip), %rdi      # 0x964a
leaq 0x424c(%rip), %rsi      # 0x9548
leaq 0x4321(%rip), %rcx      # 0x9624
movl $0x26, %edx
callq 0x3070
leaq 0x43d8(%rip), %rdi      # 0x96ec
leaq 0x4352(%rip), %rsi      # 0x966d
leaq 0x43f6(%rip), %rcx      # 0x9718
movl $0xeb, %edx
callq 0x3070