// File: /workspace/github_cpp_makefile_star2_O3/sbingner[P]kerneldec/lzfse/src/lzvn_encode_base.c
// Function: lzvn_encode
void lzvn_encode(lzvn_encoder_state *state) {
  const lzvn_match_info NO_MATCH = {0};

  for (; state->src_current < state->src_current_end; state->src_current++) {
    // Get 4 bytes at src_current
    uint32_t vi = load4(state->src + state->src_current);

    // Compute new hash H at position I, and push value into position table
    int h = hash3i(vi); // index of first entry

    // Read table entries for H
    lzvn_encode_entry_type e = state->table[h];

    // Update entry with index=current and value=vi
    lzvn_encode_entry_type updated_e; // rotate values, so we will replace the oldest
    updated_e.indices[0] = offset_to_s32(state->src_current);
    updated_e.indices[1] = e.indices[0];
    updated_e.indices[2] = e.indices[1];
    updated_e.indices[3] = e.indices[2];
    updated_e.values[0] = vi;
    updated_e.values[1] = e.values[0];
    updated_e.values[2] = e.values[1];
    updated_e.values[3] = e.values[2];

    // Do not check matches if still in previously emitted match
    if (state->src_current < state->src_literal)
      goto after_emit;

// Update best with candidate if better
#define UPDATE(best, candidate)                                                \
  do {                                                                         \
    if (candidate.K > best.K ||                                                \
        ((candidate.K == best.K) && (candidate.m_end > best.m_end + 1))) {     \
      best = candidate;                                                        \
    }                                                                          \
  } while (0)
// Check candidate. Keep if better.
#define CHECK_CANDIDATE(ik, nk)                                                \
  do {                                                                         \
    lzvn_match_info m1;                                                              \
    if (lzvn_find_matchN(state->src, state->src_begin, state->src_end,               \
                   state->src_literal, ik, state->src_current, nk, &m1)) {     \
      UPDATE(incoming, m1);                                                    \
    }                                                                          \
  } while (0)
// Emit match M. Return if we don't have enough space in the destination buffer
#define EMIT_MATCH(m)                                                          \
  do {                                                                         \
    if (lzvn_emit_match(state, m) == 0)                                              \
      return;                                                                  \
  } while (0)
// Emit literal of length L. Return if we don't have enough space in the
// destination buffer
#define EMIT_LITERAL(l)                                                        \
  do {                                                                         \
    if (lzvn_emit_literal(state, l) == 0)                                            \
      return;                                                                  \
  } while (0)

    lzvn_match_info incoming = NO_MATCH;

    // Check candidates in order (closest first)
    uint32_t diffs[4];
    for (int k = 0; k < 4; k++)
      diffs[k] = e.values[k] ^ vi; // XOR, 0 if equal
    lzvn_offset ik;                // index
    lzvn_offset nk;                // match byte count

    // The values stored in e.xyzw are 32-bit signed indices, extended to signed
    // type lzvn_offset
    ik = offset_from_s32(e.indices[0]);
    nk = trailing_zero_bytes(diffs[0]);
    CHECK_CANDIDATE(ik, nk);
    ik = offset_from_s32(e.indices[1]);
    nk = trailing_zero_bytes(diffs[1]);
    CHECK_CANDIDATE(ik, nk);
    ik = offset_from_s32(e.indices[2]);
    nk = trailing_zero_bytes(diffs[2]);
    CHECK_CANDIDATE(ik, nk);
    ik = offset_from_s32(e.indices[3]);
    nk = trailing_zero_bytes(diffs[3]);
    CHECK_CANDIDATE(ik, nk);

    // Check candidate at previous distance
    if (state->d_prev != 0) {
      lzvn_match_info m1;
      if (lzvn_find_match(state->src, state->src_begin, state->src_end,
                    state->src_literal, state->src_current - state->d_prev,
                    state->src_current, &m1)) {
        m1.K = m1.M - 1; // fix K for D_prev
        UPDATE(incoming, m1);
      }
    }

    // Here we have the best candidate in incoming, may be NO_MATCH

    // If no incoming match, and literal backlog becomes too high, emit pending
    // match, or literals if there is no pending match
    if (incoming.M == 0) {
      if (state->src_current - state->src_literal >=
          LZVN_ENCODE_MAX_LITERAL_BACKLOG) // at this point, we always have
                                           // current >= literal
      {
        if (state->pending.M != 0) {
          EMIT_MATCH(state->pending);
          state->pending = NO_MATCH;
        } else {
          EMIT_LITERAL(271); // emit long literal (271 is the longest literal size we allow)
        }
      }
      goto after_emit;
    }

    if (state->pending.M == 0) {
      // NOTE. Here, we can also emit incoming right away. It will make the
      // encoder 1.5x faster, at a cost of ~10% lower compression ratio:
      // EMIT_MATCH(incoming);
      // state->pending = NO_MATCH;

      // No pending match, emit nothing, keep incoming
      state->pending = incoming;
    } else {
      // Here we have both incoming and pending
      if (state->pending.m_end <= incoming.m_begin) {
        // No overlap: emit pending, keep incoming
        EMIT_MATCH(state->pending);
        state->pending = incoming;
      } else {
        // If pending is better, emit pending and discard incoming.
        // Otherwise, emit incoming and discard pending.
        if (incoming.K > state->pending.K)
          state->pending = incoming;
        EMIT_MATCH(state->pending);
        state->pending = NO_MATCH;
      }
    }

  after_emit:

    // We commit state changes only after we tried to emit instructions, so we
    // can restart in the same state in case dst was full and we quit the loop.
    state->table[h] = updated_e;

  } // i loop

  // Do not emit pending match here. We do it only at the end of stream.
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq 0x18(%rdi), %rbp
cmpq 0x20(%rdi), %rbp
jge 0x6daa
movq %rdi, %rbx
leaq 0x48(%rdi), %rax
movq %rax, 0x70(%rsp)
movq (%rbx), %rsi
movq 0x28(%rbx), %rax
movl (%rsi,%rbp), %r15d
movl %r15d, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
imull $0x1041, %ecx, %r13d    # imm = 0x1041
shrl $0xc, %r13d
andl $0x3fff, %r13d          # imm = 0x3FFF
movq 0x78(%rbx), %r8
movl %r13d, %r9d
shll $0x5, %r9d
movl (%r8,%r9), %r10d
movl 0x4(%r8,%r9), %edi
movl 0x8(%r8,%r9), %r11d
movdqu 0x10(%r8,%r9), %xmm2
movl 0x18(%r8,%r9), %r14d
movq %rbp, %rdx
subq %rax, %rdx
jl 0x6cf1
movl %r11d, 0x34(%rsp)
movl %edi, 0x38(%rsp)
movl %r14d, 0x64(%rsp)
movl %r15d, 0x7c(%rsp)
movd %r15d, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
pxor %xmm2, %xmm0
movd %xmm0, %r14d
bsfl %r14d, %r11d
shrl $0x3, %r11d
testl %r14d, %r14d
movl $0x4, %ecx
cmovel %ecx, %r11d
movq 0x8(%rbx), %rcx
movq %rcx, 0x68(%rsp)
movq 0x10(%rbx), %rdi
cmpl $0x3, %r11d
movl %r10d, 0x3c(%rsp)
movq %rdx, 0x90(%rsp)
jb 0x6556
movslq %r10d, %r10
movq %rbp, %rcx
subq %r10, %rcx
movq %rcx, 0x40(%rsp)
leaq -0x10000(%rcx), %r15
cmpq $-0xffff, %r15          # imm = 0xFFFF0001
jae 0x657b
movq $0x0, 0x48(%rsp)
xorl %r12d, %r12d
movq $0x0, 0x58(%rsp)
movq $0x0, 0x40(%rsp)
xorl %edx, %edx
jmp 0x6663
leaq (%r11,%rbp), %r12
testl %r14d, %r14d
jne 0x65d7
leaq (%r11,%rbp), %r14
addq $0x4, %r14
movq %r12, %r11
cmpq %rdi, %r14
jge 0x65d7
movq %r11, %r14
subq 0x40(%rsp), %r14
movl (%rsi,%r11), %r15d
movl (%rsi,%r14), %ecx
movl %ecx, %r14d
xorl %r15d, %r14d
bsfl %r14d, %r14d
shrl $0x3, %r14d
cmpl %ecx, %r15d
movl $0x4, %edx
cmovel %edx, %r14d
leaq (%r11,%r14), %r12
cmpl %ecx, %r15d
jne 0x65d7
leaq (%r11,%r14), %rcx
addq $0x4, %rcx
movq %r12, %r11
cmpq %rdi, %rcx
jl 0x6594
movq %rbp, %rdx
cmpq %rax, %rbp
jle 0x661b
movq %rbp, %rdx
cmpq %r10, 0x68(%rsp)
jge 0x661b
decq %r10
leaq -0x1(%rbp), %r11
movb (%rsi,%r11), %cl
cmpb (%rsi,%r10), %cl
jne 0x6615
leaq -0x1(%r11), %rdx
cmpq 0x68(%rsp), %r10
jle 0x6610
decq %r10
cmpq %rax, %r11
movq %rdx, %r11
jg 0x65f0
incq %rdx
jmp 0x661b
incq %r11
movq %r11, %rdx
movq %r12, %r10
subq %rdx, %r10
xorl %ecx, %ecx
cmpq $0x600, 0x40(%rsp)      # imm = 0x600
setl %cl
movq %r10, 0x58(%rsp)
addq %r10, %rcx
addq $-0x3, %rcx
movq %rcx, %r11
testq %rcx, %rcx
jg 0x665b
sete %cl
cmpq $0x2, %r12
setge %r10b
andb %cl, %r10b
cmpb $0x1, %r10b
jne 0x6556
movq %rdx, 0x48(%rsp)
movq %r11, %rdx
movslq 0xc(%r8,%r9), %r8
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movd %xmm1, %r15d
bsfl %r15d, %r14d
shrl $0x3, %r14d
testl %r15d, %r15d
movl $0x4, %ecx
cmovel %ecx, %r14d
cmpl $0x3, %r14d
jb 0x6790
movslq 0x38(%rsp), %r11
movq %rbp, %r9
subq %r11, %r9
leaq -0x10000(%r9), %rcx
cmpq $-0xffff, %rcx          # imm = 0xFFFF0001
jb 0x6790
leaq (%r14,%rbp), %r10
testl %r15d, %r15d
movq %rdx, 0x50(%rsp)
jne 0x6706
leaq (%r14,%rbp), %rcx
addq $0x4, %rcx
movq %r10, %r15
cmpq %rdi, %rcx
jge 0x6706
movq %r15, %rcx
subq %r9, %rcx
movl (%rsi,%r15), %edx
movl (%rsi,%rcx), %ecx
movl %ecx, %r10d
xorl %edx, %r10d
bsfl %r10d, %r14d
shrl $0x3, %r14d
cmpl %ecx, %edx
movl $0x4, %r10d
cmovel %r10d, %r14d
leaq (%r15,%r14), %r10
cmpl %ecx, %edx
jne 0x6706
leaq (%r15,%r14), %rcx
addq $0x4, %rcx
jmp 0x66c5
movq %rbp, %r14
cmpq %rax, %rbp
movq 0x68(%rsp), %rdx
jle 0x674b
movq %rbp, %r14
cmpq %r11, %rdx
jge 0x674b
decq %r11
leaq -0x1(%rbp), %r15
movb (%rsi,%r15), %cl
cmpb (%rsi,%r11), %cl
jne 0x6745
leaq -0x1(%r15), %r14
cmpq %rdx, %r11
jle 0x6740
decq %r11
cmpq %rax, %r15
movq %r14, %r15
jg 0x6722
incq %r14
jmp 0x674b
incq %r15
movq %r15, %r14
movq %r10, %r11
subq %r14, %r11
xorl %ecx, %ecx
cmpq $0x600, %r9             # imm = 0x600
setl %cl
leaq (%rcx,%r11), %r15
addq $-0x3, %r15
movq 0x50(%rsp), %rdx
cmpq %rdx, %r15
jg 0x677b
jne 0x6790
leaq 0x1(%r12), %rcx
cmpq %rcx, %r10
jle 0x6790
movq %r14, 0x48(%rsp)
movq %r10, %r12
movq %r11, 0x58(%rsp)
movq %r9, 0x40(%rsp)
movq %r15, %rdx
pshufd $0xee, %xmm0, %xmm1     # xmm1 = xmm0[2,3,2,3]
movd %xmm1, %r15d
bsfl %r15d, %r14d
shrl $0x3, %r14d
testl %r15d, %r15d
movl $0x4, %ecx
cmovel %ecx, %r14d
cmpl $0x3, %r14d
jb 0x68b8
movslq 0x34(%rsp), %r11
movq %rbp, %r9
subq %r11, %r9
leaq -0x10000(%r9), %rcx
cmpq $-0xffff, %rcx          # imm = 0xFFFF0001
jb 0x68b8
leaq (%r14,%rbp), %r10
testl %r15d, %r15d
movq %rdx, 0x50(%rsp)
jne 0x682e
leaq (%r14,%rbp), %rcx
addq $0x4, %rcx
movq %r10, %r15
cmpq %rdi, %rcx
jge 0x682e
movq %r15, %rcx
subq %r9, %rcx
movl (%rsi,%r15), %edx
movl (%rsi,%rcx), %ecx
movl %ecx, %r10d
xorl %edx, %r10d
bsfl %r10d, %r14d
shrl $0x3, %r14d
cmpl %ecx, %edx
movl $0x4, %r10d
cmovel %r10d, %r14d
leaq (%r15,%r14), %r10
cmpl %ecx, %edx
jne 0x682e
leaq (%r15,%r14), %rcx
addq $0x4, %rcx
jmp 0x67ed
movq %rbp, %r15
cmpq %rax, %rbp
movq 0x68(%rsp), %rdx
jle 0x6873
movq %rbp, %r15
cmpq %r11, %rdx
jge 0x6873
decq %r11
leaq -0x1(%rbp), %r14
movb (%rsi,%r14), %cl
cmpb (%rsi,%r11), %cl
jne 0x686d
leaq -0x1(%r14), %r15
cmpq %rdx, %r11
jle 0x6868
decq %r11
cmpq %rax, %r14
movq %r15, %r14
jg 0x684a
incq %r15
jmp 0x6873
incq %r14
movq %r14, %r15
movq %r10, %r11
subq %r15, %r11
xorl %ecx, %ecx
cmpq $0x600, %r9             # imm = 0x600
setl %cl
leaq (%rcx,%r11), %r14
addq $-0x3, %r14
movq 0x50(%rsp), %rdx
cmpq %rdx, %r14
jg 0x68a3
jne 0x68b8
leaq 0x1(%r12), %rcx
cmpq %rcx, %r10
jle 0x68b8
movq %r15, 0x48(%rsp)
movq %r10, %r12
movq %r11, 0x58(%rsp)
movq %r9, 0x40(%rsp)
movq %r14, %rdx
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movd %xmm0, %r14d
bsfl %r14d, %r11d
shrl $0x3, %r11d
testl %r14d, %r14d
movl $0x4, %ecx
cmovel %ecx, %r11d
cmpl $0x3, %r11d
jae 0x68e6
movl 0x7c(%rsp), %r15d
jmp 0x69e6
movq %rbp, %r9
subq %r8, %r9
leaq -0x10000(%r9), %rcx
cmpq $-0xffff, %rcx          # imm = 0xFFFF0001
movl 0x7c(%rsp), %r15d
jb 0x69e6
leaq (%r11,%rbp), %r10
testl %r14d, %r14d
movq %rdx, 0x50(%rsp)
jne 0x695c
leaq (%r11,%rbp), %rcx
addq $0x4, %rcx
movq %r10, %r11
cmpq %rdi, %rcx
jge 0x695c
movq %r11, %rcx
subq %r9, %rcx
movl (%rsi,%r11), %edx
movl (%rsi,%rcx), %ecx
movl %ecx, %r10d
xorl %edx, %r10d
bsfl %r10d, %r14d
shrl $0x3, %r14d
cmpl %ecx, %edx
movl $0x4, %r10d
cmovel %r10d, %r14d
leaq (%r11,%r14), %r10
cmpl %ecx, %edx
jne 0x695c
leaq (%r11,%r14), %rcx
addq $0x4, %rcx
jmp 0x691b
movq %rbp, %r11
cmpq %rax, %rbp
movq 0x68(%rsp), %rdx
jle 0x69a1
movq %rbp, %r11
cmpq %r8, %rdx
jge 0x69a1
decq %r8
leaq -0x1(%rbp), %r14
movb (%rsi,%r14), %cl
cmpb (%rsi,%r8), %cl
jne 0x699b
leaq -0x1(%r14), %r11
cmpq %rdx, %r8
jle 0x6996
decq %r8
cmpq %rax, %r14
movq %r11, %r14
jg 0x6978
incq %r11
jmp 0x69a1
incq %r14
movq %r14, %r11
movq %r10, %r8
subq %r11, %r8
xorl %ecx, %ecx
cmpq $0x600, %r9             # imm = 0x600
setl %cl
leaq (%rcx,%r8), %r14
addq $-0x3, %r14
movq 0x50(%rsp), %rdx
cmpq %rdx, %r14
jg 0x69d1
jne 0x69e6
leaq 0x1(%r12), %rcx
cmpq %rcx, %r10
jle 0x69e6
movq %r11, 0x48(%rsp)
movq %r10, %r12
movq %r8, 0x58(%rsp)
movq %r9, 0x40(%rsp)
movq %r14, %rdx
movq 0x70(%rbx), %r8
testq %r8, %r8
movq %rdx, 0x50(%rsp)
je 0x6a8c
movq %rbp, %r10
subq %r8, %r10
movl (%rsi,%r10), %r11d
movl %r11d, %ecx
xorl %r15d, %ecx
bsfl %ecx, %r9d
shrl $0x3, %r9d
cmpl %r11d, %r15d
movl $0x4, %ecx
cmovel %ecx, %r9d
leaq -0x10000(%r8), %rcx
cmpq $-0xffff, %rcx          # imm = 0xFFFF0001
movl 0x64(%rsp), %r14d
jb 0x6a91
cmpl $0x3, %r9d
jb 0x6a91
movl %r9d, %r14d
leaq (%r14,%rbp), %r9
cmpl %r11d, %r15d
jne 0x6a9b
leaq (%r14,%rbp), %rcx
addq $0x4, %rcx
movq %r9, %r11
cmpq %rdi, %rcx
jge 0x6a9b
movq %r11, %rcx
subq %r8, %rcx
movl (%rsi,%r11), %edx
movl (%rsi,%rcx), %ecx
movl %ecx, %r9d
xorl %edx, %r9d
bsfl %r9d, %r14d
shrl $0x3, %r14d
cmpl %ecx, %edx
movl $0x4, %r9d
cmovel %r9d, %r14d
leaq (%r11,%r14), %r9
cmpl %ecx, %edx
jne 0x6a9b
leaq (%r11,%r14), %rcx
addq $0x4, %rcx
jmp 0x6a4b
movl 0x64(%rsp), %r14d
movl 0x34(%rsp), %r11d
jmp 0x6b26
cmpq 0x68(%rsp), %r10
setle %cl
cmpq %rax, %rbp
setle %dl
orb %cl, %dl
movq %rbp, %rdi
movl 0x64(%rsp), %r14d
jne 0x6aed
leaq -0x1(%rbp), %r10
movq %r10, %r11
subq %r8, %r11
movq 0x68(%rsp), %rdx
movb (%rsi,%r10), %cl
cmpb (%rsi,%r11), %cl
jne 0x6ae7
leaq -0x1(%r10), %rdi
cmpq %rdx, %r11
jle 0x6ae2
decq %r11
cmpq %rax, %r10
movq %rdi, %r10
jg 0x6ac4
incq %rdi
jmp 0x6aed
incq %r10
movq %r10, %rdi
movq %r9, %rdx
subq %rdi, %rdx
leaq -0x1(%rdx), %r10
cmpq 0x50(%rsp), %r10
movl 0x34(%rsp), %r11d
jg 0x6b0f
jne 0x6b26
leaq 0x1(%r12), %rcx
cmpq %rcx, %r9
jle 0x6b26
movq %rdi, 0x48(%rsp)
movq %r9, %r12
movq %rdx, 0x58(%rsp)
movq %r8, 0x40(%rsp)
movq %r10, 0x50(%rsp)
movq 0x58(%rsp), %rcx
testq %rcx, %rcx
je 0x6bd4
cmpq $0x0, 0x58(%rbx)
movl 0x3c(%rsp), %r10d
movl 0x38(%rsp), %edi
je 0x6c6c
movq 0x48(%rsp), %rax
cmpq %rax, 0x50(%rbx)
movdqa %xmm2, 0x80(%rsp)
jle 0x6c7f
movq 0x50(%rsp), %rdx
cmpq 0x68(%rbx), %rdx
jle 0x6b89
movq 0x48(%rsp), %rax
movq %rax, 0x48(%rbx)
movq %r12, 0x50(%rbx)
movq %rcx, 0x58(%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rbx)
movq %rdx, 0x68(%rbx)
movq 0x70(%rsp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movdqu (%rcx), %xmm0
movdqu 0x10(%rcx), %xmm1
movdqu %xmm1, 0x10(%rsp)
movdqu %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x6dbc
testq %rax, %rax
movdqa 0x80(%rsp), %xmm2
movl 0x3c(%rsp), %r10d
movl 0x38(%rsp), %edi
movl 0x34(%rsp), %r11d
jne 0x6c4d
jmp 0x6daa
cmpq $0x190, 0x90(%rsp) # imm = 0x190
movl 0x3c(%rsp), %r10d
movl 0x38(%rsp), %edi
jl 0x6cf1
cmpq $0x0, 0x58(%rbx)
je 0x6d34
movq 0x70(%rsp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movdqu (%rcx), %xmm0
movdqu 0x10(%rcx), %xmm1
movdqu %xmm1, 0x10(%rsp)
movdqu %xmm0, (%rsp)
movq %rbx, %rdi
movdqa %xmm2, 0x80(%rsp)
callq 0x6dbc
movl 0x34(%rsp), %r11d
movl 0x38(%rsp), %edi
movl 0x3c(%rsp), %r10d
movdqa 0x80(%rsp), %xmm2
testq %rax, %rax
je 0x6daa
movq 0x70(%rsp), %rax
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
movq $0x0, 0x20(%rax)
jmp 0x6cf1
movq 0x48(%rsp), %rax
movq %rax, 0x48(%rbx)
movq %r12, 0x50(%rbx)
movq %rcx, 0x58(%rbx)
jmp 0x6cdf
movq 0x70(%rsp), %rcx
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rsp)
movdqu (%rcx), %xmm0
movdqu 0x10(%rcx), %xmm1
movdqu %xmm1, 0x10(%rsp)
movdqu %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x6dbc
movl 0x34(%rsp), %r11d
movl 0x38(%rsp), %edi
movl 0x3c(%rsp), %r10d
movdqa 0x80(%rsp), %xmm2
testq %rax, %rax
je 0x6daa
movq 0x48(%rsp), %rax
movq %rax, 0x48(%rbx)
movq %r12, 0x50(%rbx)
movq 0x58(%rsp), %rax
movq %rax, 0x58(%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x60(%rbx)
movq 0x50(%rsp), %rax
movq %rax, 0x68(%rbx)
movq 0x78(%rbx), %rax
shll $0x5, %r13d
movl %ebp, (%rax,%r13)
movl %r10d, 0x4(%rax,%r13)
movl %edi, 0x8(%rax,%r13)
movl %r11d, 0xc(%rax,%r13)
movl %r15d, 0x10(%rax,%r13)
movq %xmm2, 0x14(%rax,%r13)
movl %r14d, 0x1c(%rax,%r13)
movq 0x18(%rbx), %rbp
incq %rbp
movq %rbp, 0x18(%rbx)
cmpq 0x20(%rbx), %rbp
jl 0x6487
jmp 0x6daa
movq 0x30(%rbx), %r14
movq 0x40(%rbx), %rcx
leaq 0x119(%r14), %rdx
cmpq %rcx, %rdx
jae 0x6d89
addq %rax, %rsi
movw $0xffe0, (%r14)         # imm = 0xFFE0
leaq 0x2(%r14), %rdi
movl $0x10f, %edx            # imm = 0x10F
movdqa %xmm2, 0x80(%rsp)
callq 0x30c0
movl 0x34(%rsp), %r11d
movl 0x38(%rsp), %edi
movl 0x3c(%rsp), %r10d
movdqa 0x80(%rsp), %xmm2
addq $0x111, %r14            # imm = 0x111
movq %r14, %rcx
cmpq 0x40(%rbx), %rcx
movl 0x64(%rsp), %r14d
jae 0x6daa
addq $0x10f, 0x28(%rbx)      # imm = 0x10F
cmpq 0x30(%rbx), %rcx
movq %rcx, 0x30(%rbx)
jne 0x6cf1
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq