// File: 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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpl $0x3, 0x2c(%rax)
jne 0x22941
jmp 0x22813
movq -0x80(%rbp), %rcx
xorl %eax, %eax
cmpl $0x4000, 0x78(%rcx)     # imm = 0x4000
movb %al, -0x81(%rbp)
jae 0x22840
movq -0x80(%rbp), %rcx
movl 0x38(%rcx), %eax
movl 0x34(%rcx), %ecx
addl $0x5, %ecx
cmpl %ecx, %eax
setb %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x2284f
jmp 0x2293c
movq -0x80(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x228a0
movq -0x80(%rbp), %rax
cmpl $0x0, 0x34(%rax)
jbe 0x2287f
movq -0x80(%rbp), %rcx
movq 0x20(%rcx), %rax
movl 0x34(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x88(%rbp)
jmp 0x2288c
movl $0xff, %eax
movl %eax, -0x88(%rbp)
jmp 0x2288c
movq -0x80(%rbp), %rdi
movl -0x88(%rbp), %esi
callq 0x31620
jmp 0x22928
movq -0x80(%rbp), %rcx
movl 0x38(%rcx), %eax
cmpl 0x34(%rcx), %eax
jbe 0x228cd
movq -0x80(%rbp), %rdi
movl 0x7c(%rdi), %esi
andl $0xff, %esi
callq 0x31620
movq -0x80(%rbp), %rax
movl 0x7c(%rax), %ecx
shrl $0x8, %ecx
movl %ecx, 0x7c(%rax)
jmp 0x22926
movq -0x80(%rbp), %rcx
movq 0x80(%rcx), %rax
movl 0x38(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
cmpl $0x0, (%rax,%rcx,4)
jne 0x228fc
movq -0x80(%rbp), %rdi
movl 0x38(%rdi), %eax
movl %eax, 0x7c(%rdi)
movl $0xff, %esi
callq 0x31620
jmp 0x22924
movq -0x80(%rbp), %rdi
movq 0x20(%rdi), %rax
movq 0x80(%rdi), %rcx
movl 0x38(%rdi), %edx
subl $0x1, %edx
movl %edx, %edx
movl (%rcx,%rdx,4), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %esi
callq 0x31620
jmp 0x22926
jmp 0x22928
jmp 0x2292a
movq -0x80(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
jmp 0x22813
jmp 0x233d9
movq -0x80(%rbp), %rax
movl $0x0, -0xc(%rbp)
movl 0x28(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x80(%rbp), %rdx
movl 0x38(%rdx), %ecx
xorl %eax, %eax
cmpl 0x34(%rdx), %ecx
movb %al, -0x89(%rbp)
jae 0x22987
movq -0x80(%rbp), %rax
movl 0x78(%rax), %eax
shll %eax
cmpl $0x4000, %eax           # imm = 0x4000
setb %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x22996
jmp 0x233b4
movq -0x80(%rbp), %rax
movl 0x3c(%rax), %ecx
subl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
cmpq $0x0, 0x88(%rax)
je 0x22d07
movq -0x80(%rbp), %rcx
movq 0x80(%rcx), %rax
movq 0x88(%rcx), %rdx
movl 0x38(%rcx), %esi
andl -0x10(%rbp), %esi
movl %esi, %esi
movl (%rdx,%rsi,4), %edx
movl (%rax,%rdx,4), %eax
cmpl 0x38(%rcx), %eax
je 0x22a58
movl $0x0, -0x24(%rbp)
movq -0x80(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x34(%rcx), %eax
jae 0x22a56
movq -0x80(%rbp), %rcx
movq 0x80(%rcx), %rax
movl -0x24(%rbp), %edx
movl (%rax,%rdx,4), %eax
movl -0x10(%rbp), %edx
xorl $-0x1, %edx
andl %edx, %eax
movl 0x38(%rcx), %ecx
movl -0x10(%rbp), %edx
xorl $-0x1, %edx
andl %edx, %ecx
cmpl %ecx, %eax
jne 0x22a49
movq -0x80(%rbp), %rcx
movl -0x24(%rbp), %edx
movq 0x88(%rcx), %rax
movq 0x80(%rcx), %rcx
movl -0x24(%rbp), %esi
movl (%rcx,%rsi,4), %ecx
andl -0x10(%rbp), %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
jmp 0x22a4b
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x229f2
jmp 0x22a58
movl $0x0, -0x28(%rbp)
movq -0x80(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0x4c(%rcx), %eax
ja 0x22d02
movq -0x80(%rbp), %rdx
movq 0x88(%rdx), %rax
movl -0x28(%rbp), %ecx
addl 0x38(%rdx), %ecx
andl -0x10(%rbp), %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movq 0x80(%rdx), %rax
movl -0x2c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl -0x28(%rbp), %ecx
addl 0x38(%rdx), %ecx
cmpl %ecx, %eax
je 0x22aa7
jmp 0x22cf4
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
cmpl $0x1, -0x30(%rbp)
jg 0x22cde
movl $0x1, -0x34(%rbp)
movq -0x80(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x58(%rcx), %eax
ja 0x22cce
movq -0x80(%rbp), %rcx
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %edx
imull -0x34(%rbp), %edx
addl %edx, %eax
cmpl 0x34(%rcx), %eax
jae 0x22cbe
movq -0x80(%rbp), %rcx
movq 0x80(%rcx), %rax
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %esi
imull -0x34(%rbp), %esi
addl %esi, %edx
movl %edx, %edx
movl (%rax,%rdx,4), %eax
subl -0x28(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl 0x38(%rcx), %eax
jae 0x22cbe
movl -0x28(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x80(%rbp), %rdx
movl 0x38(%rdx), %ecx
addl -0x3c(%rbp), %ecx
xorl %eax, %eax
cmpl 0x34(%rdx), %ecx
movb %al, -0x8a(%rbp)
jae 0x22b73
movq -0x80(%rbp), %rdx
movl -0x3c(%rbp), %ecx
xorl %eax, %eax
cmpl 0x44(%rdx), %ecx
movb %al, -0x8a(%rbp)
jae 0x22b73
movq -0x80(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x38(%rbp), %ecx
addl -0x3c(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl -0x3c(%rbp), %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x8a(%rbp)
movb -0x8a(%rbp), %al
testb $0x1, %al
jne 0x22b7f
jmp 0x22b8c
jmp 0x22b81
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x22b19
movl -0x28(%rbp), %eax
movl %eax, -0x40(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x40(%rbp)
movb %al, -0x8b(%rbp)
jbe 0x22bd5
movq -0x80(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x38(%rbp), %ecx
addl -0x40(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl -0x40(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x8b(%rbp)
movb -0x8b(%rbp), %al
testb $0x1, %al
jne 0x22be1
jmp 0x22bee
jmp 0x22be3
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x22b92
movq -0x80(%rbp), %rax
movl -0x3c(%rbp), %ecx
subl -0x40(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, -0x94(%rbp)
movl 0x38(%rax), %edi
subl -0x38(%rbp), %edi
callq 0x226a0
movl %eax, %ecx
movl -0x94(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x90(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x8c(%rbp)
jne 0x22c37
cmpl $0x0, -0x40(%rbp)
seta %al
movb %al, -0x8c(%rbp)
movl -0x90(%rbp), %eax
movb -0x8c(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x2, %ecx
subl %ecx, %eax
subl $0xb, %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x28(%rbp), %eax
jae 0x22c7d
imull $0x5, -0x44(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x44(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x22c5b
movl -0x44(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0x22c9d
movl -0x3c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jb 0x22cba
movq -0x80(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x3c(%rcx), %eax
jb 0x22cba
cmpl $0xff, -0x3c(%rbp)
jbe 0x22cbc
jmp 0x22cce
jmp 0x22cbe
jmp 0x22cc0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x22abf
jmp 0x22cd0
movl -0x30(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x30(%rbp)
jmp 0x22aae
cmpl $0x0, -0x20(%rbp)
jle 0x22cf0
movq -0x80(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x3c(%rcx), %eax
jae 0x22cf2
jmp 0x22d02
jmp 0x22cf4
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x22a5f
jmp 0x23189
movq -0x80(%rbp), %rax
cmpl $0x1, 0x2c(%rax)
je 0x22d1f
movq -0x80(%rbp), %rax
cmpl $0x40, 0x3c(%rax)
ja 0x23187
movq -0x80(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jbe 0x22f97
movl $0x0, -0x4c(%rbp)
movq -0x80(%rbp), %rcx
movl -0x4c(%rbp), %eax
cmpl 0x58(%rcx), %eax
ja 0x22f95
movq -0x80(%rbp), %rax
movq %rax, %rdi
addq $0x8, %rdi
movl 0x54(%rax), %eax
xorl -0x4c(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x30880
movl (%rax), %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x22f7a
movq -0x80(%rbp), %rdx
movl -0x50(%rbp), %eax
andl -0x10(%rbp), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl $0x3, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
andl -0x10(%rbp), %ecx
cmpl %ecx, %eax
jne 0x22f7a
movq -0x80(%rbp), %rax
movl 0x28(%rax), %ecx
movl -0x50(%rbp), %eax
shrl %cl, %eax
movq -0x80(%rbp), %rcx
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl 0x38(%rcx), %eax
jae 0x22f78
movq -0x80(%rbp), %rcx
movl 0x38(%rcx), %eax
addl -0x14(%rbp), %eax
cmpl 0x34(%rcx), %eax
ja 0x22f78
movq -0x80(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x50(%rbp), %ecx
addl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl -0x14(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x22f78
movq -0x80(%rbp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x80(%rbp), %rdx
movl 0x38(%rdx), %ecx
addl -0x54(%rbp), %ecx
xorl %eax, %eax
cmpl 0x34(%rdx), %ecx
movb %al, -0x95(%rbp)
jae 0x22e5a
movq -0x80(%rbp), %rdx
movl -0x54(%rbp), %ecx
xorl %eax, %eax
cmpl 0x44(%rdx), %ecx
movb %al, -0x95(%rbp)
jae 0x22e5a
movq -0x80(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x50(%rbp), %ecx
addl -0x54(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl -0x54(%rbp), %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x95(%rbp)
movb -0x95(%rbp), %al
testb $0x1, %al
jne 0x22e66
jmp 0x22e73
jmp 0x22e68
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x22e00
movq -0x80(%rbp), %rdx
movl -0x54(%rbp), %eax
movl 0x40(%rdx), %ecx
addl 0x4c(%rdx), %ecx
cmpl %ecx, %eax
jb 0x22f76
movq -0x80(%rbp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x58(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x58(%rbp)
movb %al, -0x96(%rbp)
jle 0x22ed5
movq -0x80(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x50(%rbp), %ecx
addl -0x58(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl -0x58(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x96(%rbp)
movb -0x96(%rbp), %al
testb $0x1, %al
jne 0x22ee1
jmp 0x22eee
jmp 0x22ee3
movl -0x58(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x22e92
movq -0x80(%rbp), %rax
movl -0x54(%rbp), %ecx
subl -0x58(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, -0xa0(%rbp)
movl 0x38(%rax), %edi
subl -0x50(%rbp), %edi
callq 0x226a0
movl %eax, %ecx
movl -0xa0(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x9c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x97(%rbp)
jne 0x22f37
cmpl $0x0, -0x58(%rbp)
setg %al
movb %al, -0x97(%rbp)
movl -0x9c(%rbp), %eax
movb -0x97(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x3, %ecx
subl %ecx, %eax
subl $0xb, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0x22f74
movl -0x54(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x22f76
jmp 0x22f78
jmp 0x22f7a
cmpl $0x80, -0x14(%rbp)
jb 0x22f85
jmp 0x22f95
jmp 0x22f87
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x22d34
jmp 0x22f97
movq -0x80(%rbp), %rax
cmpl $0x0, 0x40(%rax)
je 0x22fb1
movq -0x80(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x40(%rcx), %eax
jae 0x23185
movl $0x0, -0x60(%rbp)
movq -0x80(%rbp), %rcx
movl -0x60(%rbp), %eax
cmpl 0x58(%rcx), %eax
ja 0x23183
movq -0x80(%rbp), %rax
movq %rax, %rdi
addq $0x8, %rdi
movl 0x50(%rax), %eax
xorl -0x60(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x30880
movl (%rax), %eax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
je 0x23168
movq -0x80(%rbp), %rcx
movl 0x38(%rcx), %eax
addl $0x3, %eax
cmpl 0x34(%rcx), %eax
jae 0x23168
movq -0x80(%rbp), %rdx
movl -0x64(%rbp), %eax
andl -0x10(%rbp), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl $0x3, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
andl -0x10(%rbp), %ecx
cmpl %ecx, %eax
jne 0x23168
movq -0x80(%rbp), %rax
movl 0x28(%rax), %ecx
movl -0x64(%rbp), %eax
shrl %cl, %eax
movq -0x80(%rbp), %rcx
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl 0x38(%rcx), %eax
jae 0x23166
movq -0x80(%rbp), %rcx
movl 0x38(%rcx), %eax
addl -0x14(%rbp), %eax
cmpl 0x34(%rcx), %eax
ja 0x23166
movq -0x80(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x64(%rbp), %ecx
addl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl -0x14(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x23166
movl $0x0, -0x68(%rbp)
movq -0x80(%rbp), %rdx
movl 0x38(%rdx), %ecx
addl -0x68(%rbp), %ecx
xorl %eax, %eax
cmpl 0x34(%rdx), %ecx
movb %al, -0xa1(%rbp)
jae 0x230ee
movq -0x80(%rbp), %rdx
movl -0x68(%rbp), %ecx
xorl %eax, %eax
cmpl 0x44(%rdx), %ecx
movb %al, -0xa1(%rbp)
jae 0x230ee
movq -0x80(%rbp), %rdx
movq 0x20(%rdx), %rax
movl -0x64(%rbp), %ecx
addl -0x68(%rbp), %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movq 0x20(%rdx), %rcx
movl 0x38(%rdx), %edx
addl -0x68(%rbp), %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x230fa
jmp 0x23107
jmp 0x230fc
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x23094
movq -0x80(%rbp), %rax
movl -0x68(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, -0xa8(%rbp)
movl 0x38(%rax), %edi
subl -0x64(%rbp), %edi
callq 0x226a0
movl %eax, %ecx
movl -0xa8(%rbp), %eax
subl %ecx, %eax
cmpl $0x0, -0xc(%rbp)
seta %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll %ecx
subl %ecx, %eax
subl $0xb, %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0x23164
movl -0x68(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x23166
jmp 0x23168
cmpl $0x80, -0x14(%rbp)
jb 0x23173
jmp 0x23183
jmp 0x23175
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x22fb8
jmp 0x23185
jmp 0x23187
jmp 0x23189
movq -0x80(%rbp), %rax
movl 0x38(%rax), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x70(%rbp)
jbe 0x23221
cmpl $0x0, -0x20(%rbp)
jle 0x23221
movq -0x80(%rbp), %rdx
movl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
movl 0x3c(%rdx), %ecx
cmpl $0x2, 0x2c(%rdx)
sete %dl
andb $0x1, %dl
movzbl %dl, %edx
cmpl $0x10000, -0x70(%rbp)   # imm = 0x10000
setae %sil
andb $0x1, %sil
movzbl %sil, %esi
cmpl $0x1000000, -0x70(%rbp) # imm = 0x1000000
setae %dil
andb $0x1, %dil
movzbl %dil, %edi
addl %edi, %esi
imull %esi, %edx
addl %edx, %ecx
cmpl %ecx, %eax
jb 0x23221
movq -0x80(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl 0x38(%rdi), %esi
addl -0x1c(%rbp), %esi
leaq -0xc(%rbp), %rdx
callq 0x23920
movq -0x80(%rbp), %rdi
movl -0x14(%rbp), %esi
subl -0x1c(%rbp), %esi
movl -0x70(%rbp), %edx
callq 0x23a90
jmp 0x23231
movl $0x1, -0x14(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x80(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x23251
movq -0x80(%rbp), %rax
movl -0x14(%rbp), %ecx
addl 0x38(%rax), %ecx
movl %ecx, 0x38(%rax)
jmp 0x23393
jmp 0x23253
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x0, %eax
je 0x23391
movq -0x80(%rbp), %rcx
movl 0x38(%rcx), %eax
addl 0x64(%rcx), %eax
cmpl 0x34(%rcx), %eax
jae 0x2337f
movq -0x80(%rbp), %rax
imull $0x12d673, 0x38(%rax), %ecx # imm = 0x12D673
shrl $0x13, %ecx
andl 0x58(%rax), %ecx
movl %ecx, -0x74(%rbp)
movl 0x38(%rax), %edx
movl 0x28(%rax), %ecx
shll %cl, %edx
movl %edx, %ecx
movq 0x20(%rax), %rdx
movl 0x38(%rax), %esi
addl $0x3, %esi
movl %esi, %esi
movzbl (%rdx,%rsi), %edx
andl -0x10(%rbp), %edx
orl %edx, %ecx
movl %ecx, -0x78(%rbp)
cmpl $0x0, 0x40(%rax)
je 0x2331c
movq -0x80(%rbp), %rax
movl -0x78(%rbp), %ecx
movl %ecx, -0xac(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movl 0x54(%rax), %eax
xorl -0x74(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x30880
movl -0xac(%rbp), %edx
movq %rax, %rcx
movq -0x80(%rbp), %rax
movl %edx, (%rcx)
imull $0x9, 0x54(%rax), %edx
movl 0x60(%rax), %ecx
shll %cl, %edx
movl %edx, %ecx
movq 0x20(%rax), %rdx
movl 0x38(%rax), %esi
addl 0x40(%rax), %esi
addl 0x4c(%rax), %esi
movl %esi, %esi
movzbl (%rdx,%rsi), %edx
addl $0x1, %edx
imull $0x165ec15, %edx, %edx  # imm = 0x165EC15
addl %edx, %ecx
movl 0x30(%rax), %edx
subl $0x1, %edx
andl %edx, %ecx
movl %ecx, 0x54(%rax)
movq -0x80(%rbp), %rax
movl -0x78(%rbp), %ecx
movl %ecx, -0xb0(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movl 0x50(%rax), %eax
xorl -0x74(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
callq 0x30880
movl -0xb0(%rbp), %edx
movq %rax, %rcx
movq -0x80(%rbp), %rax
movl %edx, (%rcx)
imull $0x5, 0x50(%rax), %edx
movl 0x5c(%rax), %ecx
shll %cl, %edx
movl %edx, %ecx
movq 0x20(%rax), %rdx
movl 0x38(%rax), %esi
addl 0x3c(%rax), %esi
movl %esi, %esi
movzbl (%rdx,%rsi), %edx
addl $0x1, %edx
imull $0x75bcd17, %edx, %edx  # imm = 0x75BCD17
addl %edx, %ecx
movl 0x30(%rax), %edx
subl $0x1, %edx
andl %edx, %ecx
movl %ecx, 0x50(%rax)
movq -0x80(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
jmp 0x23253
jmp 0x23393
movq -0x80(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0x48(%rcx), %eax
jb 0x233af
movq -0x80(%rbp), %rdi
movl 0x38(%rdi), %esi
leaq -0xc(%rbp), %rdx
callq 0x23920
jmp 0x2295c
movq -0x80(%rbp), %rcx
movl 0x38(%rcx), %eax
cmpl 0x34(%rcx), %eax
jne 0x233d9
movq -0x80(%rbp), %rdi
movl 0x34(%rdi), %esi
leaq -0xc(%rbp), %rdx
callq 0x23920
movq -0x80(%rbp), %rdi
callq 0x31650
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)