// File: /workspace/github_cpp_makefile_star2_O1/twekkel[P]mzpq/libzpaq.cpp
// Function: libzpaq::LZBuffer::fill()
void LZBuffer::fill() {

  // BWT
  if (level==3) {
    assert(in || n==0);
    assert(sa);
    for (; wpos<BUFSIZE && i<n+5; ++i) {
      if (i==0) put(n>0 ? in[n-1] : 255);
      else if (i>n) put(idx&255), idx>>=8;
      else if (sa[i-1]==0) idx=i, put(255);
      else put(in[sa[i-1]-1]);
    }
    return;
  }

  // LZ77: scan the input
  unsigned lit=0;  // number of output literals pending
  const unsigned mask=(1<<checkbits)-1;
  while (i<n && wpos*2<BUFSIZE) {

    // Search for longest match, or pick closest in case of tie
    unsigned blen=minMatch-1;  // best match length
    unsigned bp=0;  // pointer to best match
    unsigned blit=0;  // literals before best match
    int bscore=0;  // best cost

    // Look up contexts in suffix array
    if (isa) {
      if (sa[isa[i&mask]]!=i) // rebuild ISA
        for (unsigned j=0; j<n; ++j)
          if ((sa[j]&~mask)==(i&~mask))
            isa[sa[j]&mask]=j;
      for (unsigned h=0; h<=lookahead; ++h) {
        unsigned q=isa[(h+i)&mask];  // location of h+i in SA
        assert(q<n);
        if (sa[q]!=h+i) continue;
        for (int j=-1; j<=1; j+=2) {  // search backward and forward
          for (unsigned k=1; k<=bucket; ++k) {
            unsigned p;  // match to be tested
            if (q+j*k<n && (p=sa[q+j*k]-h)<i) {
              assert(p<n);
              unsigned l, l1;  // length of match, leading literals
              for (l=h; i+l<n && l<maxMatch && in[p+l]==in[i+l]; ++l);
              for (l1=h; l1>0 && in[p+l1-1]==in[i+l1-1]; --l1);
              int score=int(l-l1)*8-lg(i-p)-4*(lit==0 && l1>0)-11;
              for (unsigned a=0; a<h; ++a) score=score*5/8;
              if (score>bscore) blen=l, bp=p, blit=l1, bscore=score;
              if (l<blen || l<minMatch || l>255) break;
            }
          }
        }
        if (bscore<=0 || blen<minMatch) break;
      }
    }

    // Look up contexts in a hash table.
    // Try the longest context orders first. If a match is found, then
    // skip the lower order as a speed optimization.
    else if (level==1 || minMatch<=64) {
      if (minMatch2>0) {
        for (unsigned k=0; k<=bucket; ++k) {
          unsigned p=ht[h2^k];
          if (p && (p&mask)==(in[i+3]&mask)) {
            p>>=checkbits;
            if (p<i && i+blen<=n && in[p+blen-1]==in[i+blen-1]) {
              unsigned l;  // match length from lookahead
              for (l=lookahead; i+l<n && l<maxMatch && in[p+l]==in[i+l]; ++l);
              if (l>=minMatch2+lookahead) {
                int l1;  // length back from lookahead
                for (l1=lookahead; l1>0 && in[p+l1-1]==in[i+l1-1]; --l1);
                assert(l1>=0 && l1<=int(lookahead));
                int score=int(l-l1)*8-lg(i-p)-8*(lit==0 && l1>0)-11;
                if (score>bscore) blen=l, bp=p, blit=l1, bscore=score;
              }
            }
          }
          if (blen>=128) break;
        }
      }

      // Search the lower order context
      if (!minMatch2 || blen<minMatch2) {
        for (unsigned k=0; k<=bucket; ++k) {
          unsigned p=ht[h1^k];
          if (p && i+3<n && (p&mask)==(in[i+3]&mask)) {
            p>>=checkbits;
            if (p<i && i+blen<=n && in[p+blen-1]==in[i+blen-1]) {
              unsigned l;
              for (l=0; i+l<n && l<maxMatch && in[p+l]==in[i+l]; ++l);
              int score=l*8-lg(i-p)-2*(lit>0)-11;
              if (score>bscore) blen=l, bp=p, blit=0, bscore=score;
            }
          }
          if (blen>=128) break;
        }
      }
    }

    // If match is long enough, then output any pending literals first,
    // and then the match. blen is the length of the match.
    assert(i>=bp);
    const unsigned off=i-bp;  // offset
    if (off>0 && bscore>0
        && blen-blit>=minMatch+(level==2)*((off>=(1<<16))+(off>=(1<<24)))) {
      lit+=blit;
      write_literal(i+blit, lit);
      write_match(blen-blit, off);
    }

    // Otherwise add to literal length
    else {
      blen=1;
      ++lit;
    }

    // Update index, advance blen bytes
    if (isa)
      i+=blen;
    else {
      while (blen--) {
        if (i+minMatchBoth<n) {
          unsigned ih=((i*1234547)>>19)&bucket;
          const unsigned p=(i<<checkbits)|(in[i+3]&mask);
          assert(ih<=bucket);
          if (minMatch2) {
            ht[h2^ih]=p;
            h2=(((h2*9)<<shift2)
                +(in[i+minMatch2+lookahead]+1)*23456789u)&(htsize-1);
          }
          ht[h1^ih]=p;
          h1=(((h1*5)<<shift1)+(in[i+minMatch]+1)*123456791u)&(htsize-1);
        }
        ++i;
      }
    }

    // Write long literals to keep buf from filling up
    if (lit>=maxLiteral)
      write_literal(i, lit);
  }

  // Write pending literals at end of input
  assert(i<=n);
  if (i==n) {
    write_literal(n, lit);
    flush();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
cmpl $0x3, 0x2c(%rdi)
jne 0x3faaa
movl 0x78(%rbx), %r9d
cmpl $0x3fff, %r9d           # imm = 0x3FFF
ja 0x40504
movl 0x38(%rbx), %eax
movl 0x34(%rbx), %ecx
leal 0x5(%rcx), %edx
movq 0x80(%rbx), %rsi
movq 0x20(%rbx), %rdi
leal -0x1(%rcx), %r8d
cmpl %edx, %eax
cmoval %eax, %edx
cmpq %rax, %rdx
je 0x40504
testq %rax, %rax
je 0x3fa4b
cmpq %rcx, %rax
jbe 0x3fa56
movl 0x7c(%rbx), %r10d
movl %r9d, %r11d
incl %r9d
movl %r9d, 0x78(%rbx)
movb %r10b, 0x90(%rbx,%r11)
shrl $0x8, %r10d
movl %r10d, 0x7c(%rbx)
jmp 0x3fa7e
testq %rcx, %rcx
je 0x3fa69
movb (%rdi,%r8), %r10b
jmp 0x3fa6c
movl -0x4(%rsi,%rax,4), %r10d
testl %r10d, %r10d
je 0x3fa92
decl %r10d
movb (%rdi,%r10), %r10b
jmp 0x3fa6c
movb $-0x1, %r10b
movl %r9d, %r11d
incl %r9d
movl %r9d, 0x78(%rbx)
movb %r10b, 0x90(%rbx,%r11)
incq %rax
movl %eax, 0x38(%rbx)
cmpl $0x4000, %r9d           # imm = 0x4000
jb 0x3fa18
jmp 0x40504
movl %eax, 0x7c(%rbx)
movl %r9d, %r10d
incl %r9d
movl %r9d, 0x78(%rbx)
movb $-0x1, 0x90(%rbx,%r10)
jmp 0x3fa7e
movl $0x0, 0xc(%rsp)
movb 0x28(%rbx), %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
shll %cl, %eax
movl 0x38(%rbx), %r8d
movl 0x34(%rbx), %esi
cmpl %esi, %r8d
jae 0x404d1
movl %eax, 0x98(%rsp)
notl %eax
movl %eax, 0x1c(%rsp)
movq %rbx, 0x58(%rsp)
testl $0x7fffe000, 0x78(%rbx) # imm = 0x7FFFE000
jne 0x404d1
movl 0x3c(%rbx), %eax
leal -0x1(%rax), %r13d
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x3fe6e
movq 0x80(%rbx), %r10
movl %r8d, %eax
andl 0x1c(%rsp), %eax
movl (%rdi,%rax,4), %eax
cmpl %r8d, (%r10,%rax,4)
movl 0x98(%rsp), %esi
je 0x3fb47
cmpl $0x0, 0x34(%rbx)
je 0x3fb47
xorl %eax, %eax
movl (%r10,%rax,4), %ecx
movl 0x38(%rbx), %edx
xorl %ecx, %edx
testl %esi, %edx
jne 0x3fb3c
andl 0x1c(%rsp), %ecx
movl %eax, (%rdi,%rcx,4)
incq %rax
movl 0x34(%rbx), %ecx
cmpq %rcx, %rax
jb 0x3fb28
movq %rdi, 0x80(%rsp)
movl 0x4c(%rbx), %eax
movl %eax, 0x9c(%rsp)
movl 0x38(%rbx), %r14d
movl 0x58(%rbx), %r12d
movl 0x34(%rbx), %r11d
movl 0x44(%rbx), %r15d
movq 0x20(%rbx), %rbp
leal -0x1(%r14), %eax
movq %rax, 0xa0(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x38(%rsp)
movl 0x3c(%rbx), %eax
movl %eax, 0x2c(%rsp)
leal -0x2(%r14), %eax
movl $0x0, 0x18(%rsp)
movl %r14d, %edx
movl $0x0, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
xorl %ecx, %ecx
movq %r10, 0x40(%rsp)
movq %r14, 0x78(%rsp)
movl %r12d, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl %edx, %edx
movq %rdx, 0x68(%rsp)
leal (%r14,%rcx), %esi
movl %esi, %eax
andl 0x1c(%rsp), %eax
movq 0x80(%rsp), %rdx
movl (%rdx,%rax,4), %edi
movl $0xc, %edx
cmpl %esi, (%r10,%rdi,4)
jne 0x3fe46
movl %ecx, %eax
movq %rax, 0x90(%rsp)
decq %rax
movq %rax, 0x88(%rsp)
cmpl %r11d, %esi
setb %dl
cmpl %r15d, %ecx
setb %al
andb %dl, %al
movb %al, 0x14(%rsp)
testl %ecx, %ecx
setne 0x50(%rsp)
movq 0xa0(%rsp), %rax
addl %ecx, %eax
movq %rax, 0x70(%rsp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rdi, 0x20(%rsp)
testl %r12d, %r12d
je 0x3fe1e
movl $0x1, %edx
movq %rax, 0x48(%rsp)
movl %edx, %esi
imull %eax, %esi
addl %edi, %esi
cmpl %r11d, %esi
jae 0x3fd0b
movl %esi, %esi
movl (%r10,%rsi,4), %r9d
movl %r9d, %r8d
subl %ecx, %r8d
movl %r14d, %edi
subl %r8d, %edi
jbe 0x3fd12
movq %r13, 0x60(%rsp)
movl %ecx, %r12d
cmpb $0x0, 0x14(%rsp)
movq 0x30(%rsp), %rsi
je 0x3fcb0
movq 0x68(%rsp), %r10
movl %r9d, %r14d
movq 0x90(%rsp), %r12
movl %r14d, %r13d
movb (%rbp,%r13), %r13b
cmpb (%rbp,%r10), %r13b
jne 0x3fcb0
incq %r12
incq %r10
cmpl %r11d, %r10d
jae 0x3fcb0
incl %r14d
cmpq %r15, %r12
jb 0x3fc8e
movl %ecx, %r14d
movb 0x50(%rsp), %r13b
testl %ecx, %ecx
je 0x3fd21
leal -0x1(%r9), %r10d
movb (%rbp,%r10), %r10b
movl %ecx, %r14d
movb 0x50(%rsp), %r13b
movq 0x70(%rsp), %rax
cmpb (%rbp,%rax), %r10b
jne 0x3fd21
addl $-0x2, %r9d
movq 0x88(%rsp), %r10
movl %ecx, %r14d
addq $-0x1, %r10
setb %r13b
jae 0x3fd1e
movl %r9d, %eax
movb (%rbp,%rax), %al
leal (%rsi,%r14), %ebx
decl %r14d
decl %r9d
cmpb (%rbp,%rbx), %al
je 0x3fce8
jmp 0x3fd21
xorl %esi, %esi
jmp 0x3fe0e
xorl %esi, %esi
movq 0x20(%rsp), %rdi
jmp 0x3fe0e
xorl %r14d, %r14d
xorl %r10d, %r10d
cmpl $0x0, 0x38(%rsp)
setne %r10b
movl %r12d, %r9d
subl %r14d, %r9d
shll $0x3, %r9d
movl %edi, %esi
shrl $0x10, %esi
xorl %ebx, %ebx
cmpl $0x10000, %edi          # imm = 0x10000
cmovbl %edi, %esi
setae %bl
shll $0x4, %ebx
leal 0x8(%rbx), %edi
movl %esi, %eax
shrl $0x8, %eax
cmpl $0x100, %esi            # imm = 0x100
cmovbl %esi, %eax
cmovbl %ebx, %edi
leal 0x4(%rdi), %esi
movl %eax, %ebx
shrl $0x4, %ebx
cmpl $0x10, %eax
cmovbl %eax, %ebx
cmovbl %edi, %esi
leaq 0xe7c2(%rip), %rax      # 0x4e53b
movsbl (%rbx,%rax), %eax
leal -0x4(,%r10,4), %edi
testb %r13b, %r13b
movl $0x0, %r10d
cmovel %r10d, %edi
addl %esi, %eax
subl %eax, %r9d
leal (%r9,%rdi), %esi
addl $-0xb, %esi
movl %ecx, %r9d
testl %ecx, %ecx
je 0x3fdbb
leal (%rsi,%rsi,4), %eax
leal (%rsi,%rsi,4), %esi
addl $0x7, %esi
testl %eax, %eax
cmovnsl %eax, %esi
sarl $0x3, %esi
decl %r9d
jne 0x3fda5
cmpl 0x8(%rsp), %esi
movq 0x60(%rsp), %r13
jle 0x3fdd7
movl %esi, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %r8d, 0x18(%rsp)
movl %r12d, %r13d
movb $0x1, %sil
cmpl %r13d, %r12d
jb 0x3fdf5
cmpl 0x2c(%rsp), %r12d
setb %al
cmpl $0x100, %r12d           # imm = 0x100
setae %sil
orb %al, %sil
movq 0x40(%rsp), %r10
movq 0x78(%rsp), %r14
movl 0x28(%rsp), %r12d
movq 0x20(%rsp), %rdi
movq 0x48(%rsp), %rax
testb %sil, %sil
jne 0x3fe1e
incl %edx
cmpl %r12d, %edx
jbe 0x3fc42
movq %rax, %rdx
addl $0x2, %eax
testl %edx, %edx
js 0x3fc2f
cmpl 0x2c(%rsp), %r13d
movl $0x0, %edx
movl $0xa, %eax
cmovbl %eax, %edx
cmpl $0x0, 0x8(%rsp)
cmovlel %eax, %edx
cmpl $0xc, %edx
je 0x3fe53
testl %edx, %edx
jne 0x4033b
incl %ecx
movq 0x68(%rsp), %rdx
incl %edx
cmpl 0x9c(%rsp), %ecx
jbe 0x3fbbd
jmp 0x4033b
cmpl $0x1, 0x2c(%rbx)
sete %cl
cmpl $0x41, %eax
setb %al
orb %cl, %al
movl $0x0, 0x8(%rsp)
cmpb $0x1, %al
jne 0x40128
movl 0x40(%rbx), %edx
testl %edx, %edx
movq %rdx, 0x48(%rsp)
je 0x4013d
movl 0x58(%rbx), %edi
movl 0x54(%rbx), %r9d
movq 0x8(%rbx), %r10
movq 0x20(%rbx), %r11
leal 0x3(%r8), %ecx
movl 0x28(%rbx), %ebp
movl 0x4c(%rbx), %r14d
movl 0x44(%rbx), %eax
movq %rcx, %rbx
leal (%r14,%r8), %r15d
cmpl %esi, %r15d
setb %cl
cmpl %eax, %r14d
setb %r12b
andb %cl, %r12b
movb %r12b, 0x40(%rsp)
leal (%r14,%rdx), %ecx
movl %ecx, 0x78(%rsp)
movl %ebp, %ecx
testl %r14d, %r14d
setg 0x28(%rsp)
movl 0xc(%rsp), %edx
movl %edx, 0x2c(%rsp)
movl %r14d, %edx
movq %rdx, 0x70(%rsp)
movl %eax, %eax
movq %rax, 0x50(%rsp)
movq %r14, 0x38(%rsp)
leal (%r14,%r8), %eax
decl %eax
movq %rax, 0x90(%rsp)
addq %r11, %r15
movq %r15, 0x68(%rsp)
leal 0x1(%r8), %eax
movq %rax, 0x20(%rsp)
leal -0x2(%r8), %eax
movq %rax, 0x88(%rsp)
movl $0x0, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x8(%rsp)
xorl %r12d, %r12d
movl %ebp, 0x14(%rsp)
movl %r9d, %eax
xorl %r12d, %eax
movl (%r10,%rax,4), %ebp
testl %ebp, %ebp
je 0x3ffe1
movzbl (%r11,%rbx), %eax
xorl %ebp, %eax
testl %eax, 0x1c(%rsp)
jne 0x3ffe1
shrl %cl, %ebp
movl %r8d, %eax
subl %ebp, %eax
jbe 0x3ffe1
leal (%r8,%r13), %r14d
cmpl %esi, %r14d
ja 0x3ffe1
leal -0x1(%r13,%rbp), %edx
movb (%r11,%rdx), %dl
decl %r14d
cmpb (%r11,%r14), %dl
jne 0x3ffdd
movq 0x38(%rsp), %r14
cmpb $0x0, 0x40(%rsp)
je 0x3ffd6
movl %ebp, %ecx
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %r15
leal (%rcx,%r15), %r14d
movb (%r11,%r14), %r14b
cmpb (%rdx), %r14b
jne 0x3ffd3
leaq 0x1(%r15), %r14
addl 0x20(%rsp), %r15d
cmpl %esi, %r15d
jae 0x3ffd6
incq %rdx
movq %r14, %r15
cmpq 0x50(%rsp), %r14
jb 0x3ffa9
jmp 0x3ffd6
movq %r15, %r14
cmpl 0x78(%rsp), %r14d
jae 0x3fffc
movl 0x14(%rsp), %ecx
cmpl $0x7f, %r13d
ja 0x40155
incl %r12d
cmpl %edi, %r12d
jbe 0x3ff4e
jmp 0x40155
movq %rbx, 0x80(%rsp)
movq %r13, 0x60(%rsp)
movq 0x38(%rsp), %rcx
movl %ecx, %r15d
movb 0x28(%rsp), %dl
testl %ecx, %ecx
jle 0x40078
leal -0x1(%rbp), %ecx
movq 0x38(%rsp), %r15
addl %r15d, %ecx
movb (%r11,%rcx), %cl
movb 0x28(%rsp), %dl
movq 0x90(%rsp), %rbx
cmpb (%r11,%rbx), %cl
jne 0x40078
leal -0x2(%rbp), %ecx
movq %rcx, 0x30(%rsp)
movq 0x70(%rsp), %r15
movq 0x88(%rsp), %rbx
cmpq $0x2, %r15
setge %dl
jl 0x40075
movl %r15d, %r13d
decq %r15
movq 0x30(%rsp), %rcx
addl %r13d, %ecx
movb (%r11,%rcx), %cl
addl %ebx, %r13d
cmpb (%r11,%r13), %cl
je 0x4004f
jmp 0x40078
xorl %r15d, %r15d
xorl %ecx, %ecx
cmpl $0x0, 0x2c(%rsp)
setne %cl
movq %rcx, 0x30(%rsp)
movl %r14d, %r13d
subl %r15d, %r13d
shll $0x3, %r13d
movl %eax, %ecx
shrl $0x10, %ecx
xorl %ebx, %ebx
cmpl $0x10000, %eax          # imm = 0x10000
setae %bl
cmovbl %eax, %ecx
shll $0x4, %ebx
movl %ecx, %eax
shrl $0x8, %eax
cmpl $0x100, %ecx            # imm = 0x100
cmovbl %ecx, %eax
leal 0x8(%rbx), %ecx
cmovbl %ebx, %ecx
movl %eax, %ebx
shrl $0x4, %ebx
cmpl $0x10, %eax
cmovbl %eax, %ebx
leal 0x4(%rcx), %eax
cmovbl %ecx, %eax
leaq 0xe469(%rip), %rcx      # 0x4e53b
movsbl (%rbx,%rcx), %ecx
movq 0x30(%rsp), %rbx
leal -0x8(,%rbx,8), %ebx
testb %dl, %dl
movl $0x0, %edx
cmovel %edx, %ebx
addl %eax, %ecx
subl %ecx, %r13d
leal (%rbx,%r13), %eax
addl $-0xb, %eax
cmpl 0x8(%rsp), %eax
movq 0x60(%rsp), %r13
movq 0x80(%rsp), %rbx
movl 0x14(%rsp), %ecx
jle 0x3ffe1
movl %eax, 0x8(%rsp)
movl %r15d, 0x10(%rsp)
movl %ebp, 0x18(%rsp)
movl %r14d, %r13d
jmp 0x3ffe1
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
jmp 0x4033b
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x48(%rsp), %rax
decl %eax
cmpl %r13d, %eax
jb 0x4033b
movq 0x58(%rsp), %r11
movl 0x58(%r11), %eax
movl 0x50(%r11), %edx
movq 0x8(%r11), %rdi
movq 0x20(%r11), %r15
leal 0x3(%r8), %r10d
movl 0x28(%r11), %ecx
movl 0x44(%r11), %r9d
movq %r9, 0x50(%rsp)
testq %r9, %r9
setne %bl
cmpl %esi, %r8d
setb %r9b
andb %bl, %r9b
movb %r9b, 0x38(%rsp)
xorl %ebx, %ebx
cmpl $0x0, 0xc(%rsp)
sete %bl
leal -0x2(%rbx,%rbx), %r9d
movq %r9, 0x30(%rsp)
movl %r8d, %r9d
movq %r9, 0x40(%rsp)
movl %esi, %r9d
movq %r9, 0x60(%rsp)
xorl %ebp, %ebp
movq %r13, %r9
movl %edx, %ebx
xorl %ebp, %ebx
movl (%rdi,%rbx,4), %r13d
testl %r13d, %r13d
je 0x40328
cmpl %esi, %r10d
jae 0x40328
movzbl (%r15,%r10), %ebx
xorl %r13d, %ebx
testl %ebx, 0x1c(%rsp)
jne 0x40328
shrl %cl, %r13d
movl %r8d, %ebx
subl %r13d, %ebx
jbe 0x40328
leal (%r9,%r8), %r14d
cmpl %esi, %r14d
ja 0x40328
movl %ecx, 0x14(%rsp)
movq %r15, 0x20(%rsp)
leal (%r9,%r13), %r12d
decl %r12d
movq 0x20(%rsp), %rcx
movb (%rcx,%r12), %r12b
decl %r14d
movq 0x20(%rsp), %rcx
cmpb (%rcx,%r14), %r12b
movq 0x20(%rsp), %r15
jne 0x40324
xorl %r14d, %r14d
cmpb $0x0, 0x38(%rsp)
je 0x4028e
movl %r13d, %ecx
movq %rcx, 0x48(%rsp)
xorl %r14d, %r14d
movq 0x40(%rsp), %rcx
leal (%rcx,%r14), %r11d
movq 0x48(%rsp), %r15
addl %r14d, %r15d
movq 0x20(%rsp), %r12
movb (%r12,%r15), %r15b
cmpb (%r12,%r11), %r15b
jne 0x4028e
leaq (%r14,%rcx), %r11
incq %r11
incq %r14
cmpq 0x60(%rsp), %r11
jae 0x4028e
cmpq 0x50(%rsp), %r14
jb 0x4025b
leal (,%r14,8), %r12d
movl %ebx, %r11d
shrl $0x10, %r11d
xorl %r15d, %r15d
cmpl $0x10000, %ebx          # imm = 0x10000
setae %r15b
cmovbl %ebx, %r11d
shll $0x4, %r15d
movl %r11d, %ebx
shrl $0x8, %ebx
cmpl $0x100, %r11d           # imm = 0x100
cmovbl %r11d, %ebx
leal 0x8(%r15), %r11d
cmovbl %r15d, %r11d
movl %ebx, %r15d
shrl $0x4, %r15d
cmpl $0x10, %ebx
cmovbl %ebx, %r15d
leal 0x4(%r11), %ebx
cmovbl %r11d, %ebx
leaq 0xe253(%rip), %r11      # 0x4e53b
movsbl (%r15,%r11), %r11d
addl %ebx, %r11d
subl %r11d, %r12d
movq 0x30(%rsp), %rcx
leal (%r12,%rcx), %ebx
addl $-0xb, %ebx
cmpl 0x8(%rsp), %ebx
movq 0x20(%rsp), %r15
movl 0x14(%rsp), %ecx
jle 0x40328
movl $0x0, 0x10(%rsp)
movl %ebx, 0x8(%rsp)
movl %r13d, 0x18(%rsp)
movl %r14d, %r9d
jmp 0x40328
movl 0x14(%rsp), %ecx
movq %r9, %r13
cmpl $0x7f, %r13d
ja 0x4033b
incl %ebp
cmpl %eax, %ebp
jbe 0x401c6
movq 0x58(%rsp), %rax
movl 0x38(%rax), %esi
movl %esi, %ebp
subl 0x18(%rsp), %ebp
je 0x40387
cmpl $0x0, 0x8(%rsp)
jle 0x40387
movl %r13d, %r15d
subl 0x10(%rsp), %r15d
xorl %eax, %eax
cmpl $0x10000, %ebp          # imm = 0x10000
setae %al
cmpl $0x1000000, %ebp        # imm = 0x1000000
sbbl $-0x1, %eax
movq 0x58(%rsp), %rcx
cmpl $0x2, 0x2c(%rcx)
movl $0x0, %edx
cmovnel %edx, %eax
addl 0x3c(%rcx), %eax
cmpl %eax, %r15d
jae 0x40393
incl 0xc(%rsp)
movl $0x1, %r13d
jmp 0x403bc
movl 0x10(%rsp), %eax
addl %eax, 0xc(%rsp)
addl %eax, %esi
movq 0x58(%rsp), %rbx
movq %rbx, %rdi
leaq 0xc(%rsp), %rdx
callq 0x40746
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x40912
movl $0x75bcd17, %r10d       # imm = 0x75BCD17
movl $0x165ec15, %r11d       # imm = 0x165EC15
movq 0x58(%rsp), %rbx
cmpq $0x0, 0x88(%rbx)
je 0x403e0
addl %r13d, 0x38(%rbx)
jmp 0x404a8
testl %r13d, %r13d
je 0x404a8
movq 0x8(%rbx), %rax
movq 0x20(%rbx), %rdx
movl 0x38(%rbx), %edi
movl 0x64(%rbx), %ecx
addl %edi, %ecx
cmpl 0x34(%rbx), %ecx
jae 0x40499
imull $0x12d673, %edi, %esi   # imm = 0x12D673
shrl $0x13, %esi
movb 0x28(%rbx), %cl
movl %edi, %r8d
shll %cl, %r8d
addl $0x3, %edi
movzbl (%rdx,%rdi), %edi
andl 0x1c(%rsp), %edi
orl %r8d, %edi
andl 0x58(%rbx), %esi
cmpl $0x0, 0x40(%rbx)
je 0x40469
movl 0x54(%rbx), %ecx
xorl %esi, %ecx
movl %edi, (%rax,%rcx,4)
movl 0x54(%rbx), %ecx
leal (%rcx,%rcx,8), %r8d
movb 0x60(%rbx), %cl
shll %cl, %r8d
addl %r11d, %r8d
movl 0x30(%rbx), %ecx
movl 0x40(%rbx), %r9d
addl 0x38(%rbx), %r9d
addl 0x4c(%rbx), %r9d
movzbl (%rdx,%r9), %r9d
imull $0x165ec15, %r9d, %r9d  # imm = 0x165EC15
addl %r8d, %r9d
decl %ecx
andl %r9d, %ecx
movl %ecx, 0x54(%rbx)
xorl 0x50(%rbx), %esi
movl %edi, (%rax,%rsi,4)
movl 0x50(%rbx), %ecx
leal (%rcx,%rcx,4), %esi
movb 0x5c(%rbx), %cl
shll %cl, %esi
addl %r10d, %esi
movl 0x30(%rbx), %ecx
movl 0x3c(%rbx), %edi
addl 0x38(%rbx), %edi
movzbl (%rdx,%rdi), %edi
imull $0x75bcd17, %edi, %edi  # imm = 0x75BCD17
addl %esi, %edi
decl %ecx
andl %edi, %ecx
movl %ecx, 0x50(%rbx)
decl %r13d
incl 0x38(%rbx)
testl %r13d, %r13d
jne 0x403f1
movl 0xc(%rsp), %eax
cmpl 0x48(%rbx), %eax
jb 0x404c1
movl 0x38(%rbx), %esi
movq %rbx, %rdi
leaq 0xc(%rsp), %rdx
callq 0x40746
movl 0x34(%rbx), %esi
movl 0x38(%rbx), %r8d
cmpl %esi, %r8d
jb 0x3fade
cmpl %esi, %r8d
jne 0x40504
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x40746
cmpl $0x0, 0x70(%rbx)
je 0x404fc
movb 0x6c(%rbx), %al
movl 0x78(%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x78(%rbx)
movb %al, 0x90(%rbx,%rcx)
movq $0x0, 0x6c(%rbx)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq