// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
cmpl $0x3, 0x2c(%rdi)
jne 0x29097
movl 0x78(%r14), %edx
cmpl $0x3fff, %edx           # imm = 0x3FFF
ja 0x29adf
movl 0x38(%r14), %eax
movl 0x34(%r14), %ecx
leal 0x5(%rcx), %esi
movq 0x80(%r14), %rdi
movq 0x20(%r14), %r8
leal -0x1(%rcx), %r9d
cmpl %esi, %eax
cmoval %eax, %esi
cmpq %rax, %rsi
je 0x29adf
testq %rax, %rax
je 0x29027
cmpq %rcx, %rax
jbe 0x29032
movl 0x7c(%r14), %r10d
movl %edx, %r11d
incl %edx
movl %edx, 0x78(%r14)
movb %r10b, 0x90(%r14,%r11)
shrl $0x8, %r10d
movl %r10d, 0x7c(%r14)
jmp 0x2906a
testq %rcx, %rcx
je 0x29056
movb (%r8,%r9), %r10b
jmp 0x29059
movl -0x4(%rdi,%rax,4), %r11d
movl %edx, %r10d
testl %r11d, %r11d
je 0x29082
decl %r11d
movb (%r8,%r11), %r11b
incl %edx
movl %edx, 0x78(%r14)
movb %r11b, 0x90(%r14,%r10)
jmp 0x2906a
movb $-0x1, %r10b
movl %edx, %r11d
incl %edx
movl %edx, 0x78(%r14)
movb %r10b, 0x90(%r14,%r11)
incq %rax
movl %eax, 0x38(%r14)
cmpl $0x4000, %edx           # imm = 0x4000
jb 0x28ff5
jmp 0x29adf
movl %eax, 0x7c(%r14)
incl %edx
movl %edx, 0x78(%r14)
movb $-0x1, 0x90(%r14,%r10)
jmp 0x2906a
movl $0x0, 0x10(%rsp)
movb 0x28(%r14), %cl
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
shll %cl, %ebx
movl 0x38(%r14), %esi
movl 0x34(%r14), %eax
movl %eax, 0x8(%rsp)
cmpl %eax, %esi
jae 0x29aa6
movl %ebx, %eax
notl %eax
movl %eax, 0x18(%rsp)
movl $0x75bcd17, %ebp        # imm = 0x75BCD17
movl $0x165ec15, %r15d       # imm = 0x165EC15
movq %r14, 0x68(%rsp)
movl %ebx, 0x38(%rsp)
testl $0x7fffe000, 0x78(%r14) # imm = 0x7FFFE000
jne 0x29aa6
movl 0x3c(%r14), %r8d
leal -0x1(%r8), %r13d
movq 0x88(%r14), %rdi
testq %rdi, %rdi
je 0x2943a
movq 0x80(%r14), %rbp
movl %esi, %eax
andl 0x18(%rsp), %eax
movl (%rdi,%rax,4), %eax
cmpl %esi, (%rbp,%rax,4)
je 0x2914b
xorl %eax, %eax
movl 0x8(%rsp), %esi
movl (%rbp,%rax,4), %ecx
movl 0x38(%r14), %edx
xorl %ecx, %edx
testl %ebx, %edx
jne 0x29135
andl 0x18(%rsp), %ecx
movl %eax, (%rdi,%rcx,4)
movl 0x34(%r14), %esi
incq %rax
movl %esi, %ecx
cmpq %rcx, %rax
jb 0x2911c
movl %esi, 0x8(%rsp)
movl 0x38(%r14), %esi
movl 0x3c(%r14), %r8d
movl 0x4c(%r14), %r9d
movl 0x58(%r14), %ebx
movl 0x44(%r14), %eax
movq %rax, 0x48(%rsp)
movq 0x20(%r14), %rax
leal -0x1(%rsi), %r11d
movl 0x10(%rsp), %ecx
movl %ecx, 0x98(%rsp)
leal 0x1(%rsi), %r14d
movl $0x0, 0x1c(%rsp)
movl %esi, 0x70(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x0, 0xc(%rsp)
xorl %r10d, %r10d
movq %rsi, 0x20(%rsp)
movq %rdi, 0x40(%rsp)
movq %r8, 0x28(%rsp)
movq %rbp, 0xa0(%rsp)
movl %r9d, 0x78(%rsp)
movl %ebx, 0x50(%rsp)
leal (%rsi,%r10), %ecx
movl %ecx, %edx
andl 0x18(%rsp), %edx
movl (%rdi,%rdx,4), %r15d
cmpl %ecx, (%rbp,%r15,4)
jne 0x29425
movl 0x70(%rsp), %edx
addq %rax, %rdx
movq %rdx, 0x88(%rsp)
movl %r10d, %edx
movq %rdx, 0x90(%rsp)
incq %rdx
movq %rdx, 0x80(%rsp)
cmpl 0x8(%rsp), %ecx
setb %cl
cmpl 0x48(%rsp), %r10d
setb %dl
andb %cl, %dl
movb %dl, 0x3c(%rsp)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %r10, %r8
movq %r15, 0x58(%rsp)
testl %ebx, %ebx
je 0x293f2
movl $0x1, %r9d
movq %rdi, 0x30(%rsp)
movl %r9d, %ecx
imull %edi, %ecx
addl %r15d, %ecx
cmpl 0x8(%rsp), %ecx
jae 0x293db
movl %ecx, %ecx
movl (%rbp,%rcx,4), %r10d
movl %r10d, %ecx
subl %r8d, %ecx
movl %esi, %edx
subl %ecx, %edx
jbe 0x293db
movq %r8, %r15
movl %r8d, %r12d
cmpb $0x0, 0x3c(%rsp)
movl 0x8(%rsp), %esi
je 0x292a1
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rbx
movl %r10d, %ebp
movl %r15d, %r12d
movl %ebp, %r8d
movb (%rax,%r8), %r8b
cmpb (%rbx), %r8b
jne 0x292a1
leal (%r14,%r12), %r8d
incl %r12d
cmpl %esi, %r8d
jae 0x292a1
incl %ebp
incq %rbx
leaq 0x1(%rdi), %r8
cmpq 0x48(%rsp), %rdi
movq %r8, %rdi
jb 0x29276
xorl %ebx, %ebx
testl %r15d, %r15d
movq %r13, 0x60(%rsp)
je 0x292d7
decl %r10d
movq 0x90(%rsp), %rdi
movl %r10d, %r8d
movb (%rax,%r8), %r8b
leal (%r11,%rdi), %ebp
cmpb (%rax,%rbp), %r8b
setne %bpl
jne 0x292db
decl %r10d
decq %rdi
jne 0x292b8
jmp 0x292dd
xorl %ebp, %ebp
jmp 0x292dd
movl %edi, %ebx
xorl %edi, %edi
cmpl $0x0, 0x98(%rsp)
setne %dil
movl %r12d, %esi
subl %ebx, %esi
shll $0x3, %esi
movl %edx, %r13d
shrl $0x10, %r13d
xorl %r10d, %r10d
cmpl $0x10000, %edx          # imm = 0x10000
cmovbl %edx, %r13d
setae %r10b
shll $0x4, %r10d
leal 0x8(%r10), %edx
movl %r13d, %r8d
shrl $0x8, %r8d
cmpl $0x100, %r13d           # imm = 0x100
cmovbl %r13d, %r8d
cmovbl %r10d, %edx
leal 0x4(%rdx), %r10d
movl %r8d, %r13d
shrl $0x4, %r13d
cmpl $0x10, %r8d
cmovbl %r8d, %r13d
cmovbl %edx, %r10d
leaq 0xf9c4(%rip), %rdx      # 0x38d0b
movsbl (%r13,%rdx), %edx
leal -0x4(,%rdi,4), %edi
testb %bpl, %bpl
movl $0x0, %r8d
cmovel %r8d, %edi
addl %r10d, %edx
subl %edx, %esi
addl %edi, %esi
addl $-0xb, %esi
movq %r15, %r8
movl %r8d, %edi
testl %r8d, %r8d
je 0x2938b
leal (%rsi,%rsi,4), %edx
leal (%rsi,%rsi,4), %esi
addl $0x7, %esi
testl %edx, %edx
cmovnsl %edx, %esi
sarl $0x3, %esi
decl %edi
jne 0x29376
cmpl 0xc(%rsp), %esi
movq 0x60(%rsp), %r13
movq 0xa0(%rsp), %rbp
movq 0x58(%rsp), %r15
jle 0x293b2
movl %esi, 0xc(%rsp)
movl %ebx, 0x14(%rsp)
movl %ecx, 0x1c(%rsp)
movl %r12d, %r13d
cmpl %r13d, %r12d
movq 0x30(%rsp), %rdi
jb 0x293e9
cmpl 0x28(%rsp), %r12d
setb %cl
cmpl $0x100, %r12d           # imm = 0x100
setae %dl
orb %cl, %dl
movq 0x20(%rsp), %rsi
movl 0x50(%rsp), %ebx
jne 0x293f2
incl %r9d
cmpl %ebx, %r9d
jbe 0x29225
jmp 0x293f2
movq 0x20(%rsp), %rsi
movl 0x50(%rsp), %ebx
leal 0x2(%rdi), %ecx
testl %edi, %edi
movl %ecx, %edi
js 0x29212
cmpl $0x0, 0xc(%rsp)
jle 0x298b0
movq %r8, %r10
movq 0x28(%rsp), %r8
cmpl %r8d, %r13d
movq 0x40(%rsp), %rdi
movl 0x78(%rsp), %r9d
jb 0x298ba
incl %r10d
incl 0x70(%rsp)
cmpl %r9d, %r10d
jbe 0x291b2
jmp 0x298ba
cmpl $0x1, 0x2c(%r14)
sete %al
cmpl $0x41, %r8d
setb %cl
orb %al, %cl
je 0x296da
movq %r8, 0x28(%rsp)
movq %rdi, 0x40(%rsp)
movl 0x40(%r14), %edi
testl %edi, %edi
movq %rsi, 0x20(%rsp)
je 0x296e3
movl 0x58(%r14), %edx
movl 0x54(%r14), %r8d
movq 0x8(%r14), %r10
movq 0x20(%r14), %r11
leal 0x3(%rsi), %ebx
movl 0x28(%r14), %eax
movl %eax, 0x48(%rsp)
movl 0x4c(%r14), %r9d
movl 0x44(%r14), %eax
leal (%r9,%rsi), %r14d
cmpl 0x8(%rsp), %r14d
setb %cl
cmpl %eax, %r9d
setb %bpl
andb %cl, %bpl
movb %bpl, 0x58(%rsp)
leal (%r9,%rdi), %ecx
movl %ecx, 0x3c(%rsp)
movl 0x10(%rsp), %ecx
movl %ecx, 0x90(%rsp)
movq %r9, 0x30(%rsp)
movl %r9d, %ecx
movl %eax, %eax
movq %rax, 0xa0(%rsp)
addq %r11, %r14
movq %r14, 0x98(%rsp)
leal 0x1(%rsi), %eax
movq %rax, 0x60(%rsp)
movq %rcx, 0x80(%rsp)
leaq 0x1(%rcx), %rax
movq %rax, 0x88(%rsp)
leal -0x1(%rsi), %eax
movq %rax, 0x70(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x0, 0xc(%rsp)
xorl %r9d, %r9d
movl %r8d, %eax
xorl %r9d, %eax
movl (%r10,%rax,4), %r15d
testl %r15d, %r15d
je 0x296c6
movzbl (%r11,%rbx), %eax
xorl %r15d, %eax
testl %eax, 0x18(%rsp)
jne 0x296c6
movl 0x48(%rsp), %ecx
shrl %cl, %r15d
movl %esi, %ebp
subl %r15d, %ebp
jbe 0x296c6
leal (%rsi,%r13), %eax
cmpl 0x8(%rsp), %eax
ja 0x296c6
leal (%r15,%r13), %ecx
decl %ecx
movb (%r11,%rcx), %cl
decl %eax
cmpb (%r11,%rax), %cl
jne 0x296c6
movq %rdi, 0x50(%rsp)
movq 0x30(%rsp), %r12
cmpb $0x0, 0x58(%rsp)
movq 0xa0(%rsp), %r14
je 0x295cf
movq 0x88(%rsp), %rax
movq 0x98(%rsp), %rcx
movq 0x30(%rsp), %r12
leal (%r15,%r12), %edi
movb (%r11,%rdi), %dil
cmpb (%rcx), %dil
jne 0x295cf
movq 0x60(%rsp), %rdi
addl %r12d, %edi
incl %r12d
cmpl 0x8(%rsp), %edi
jae 0x295cf
incq %rcx
leaq 0x1(%rax), %rdi
cmpq %r14, %rax
movq %rdi, %rax
jb 0x295a2
cmpl 0x3c(%rsp), %r12d
jae 0x295e0
movq 0x50(%rsp), %rdi
jmp 0x296c6
movq 0x30(%rsp), %r14
testl %r14d, %r14d
jle 0x29622
leal -0x1(%r15), %ecx
movq 0x80(%rsp), %r14
movq 0x70(%rsp), %rsi
leal (%rcx,%r14), %eax
movb (%r11,%rax), %al
leal (%rsi,%r14), %edi
cmpb (%r11,%rdi), %al
setne %al
jne 0x29624
leaq -0x1(%r14), %rdi
cmpq $0x1, %r14
movq %rdi, %r14
jg 0x295fb
xorl %r14d, %r14d
jmp 0x29624
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x0, 0x90(%rsp)
setne %cl
movq %rcx, 0x78(%rsp)
movl %r12d, %esi
subl %r14d, %esi
shll $0x3, %esi
movl %ebp, %edi
shrl $0x10, %edi
xorl %ecx, %ecx
cmpl $0x10000, %ebp          # imm = 0x10000
setae %cl
cmovbl %ebp, %edi
shll $0x4, %ecx
movl %edi, %ebp
shrl $0x8, %ebp
cmpl $0x100, %edi            # imm = 0x100
cmovbl %edi, %ebp
leal 0x8(%rcx), %edi
cmovbl %ecx, %edi
movl %ebp, %ecx
shrl $0x4, %ecx
cmpl $0x10, %ebp
cmovbl %ebp, %ecx
leal 0x4(%rdi), %ebp
cmovbl %edi, %ebp
leaq 0xf68a(%rip), %rdi      # 0x38d0b
movsbl (%rcx,%rdi), %ecx
movq 0x78(%rsp), %rdi
leal -0x8(,%rdi,8), %edi
testb %al, %al
movl $0x0, %eax
cmovel %eax, %edi
addl %ebp, %ecx
subl %ecx, %esi
leal (%rsi,%rdi), %eax
addl $-0xb, %eax
cmpl 0xc(%rsp), %eax
movq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdi
jle 0x296c6
movl %eax, 0xc(%rsp)
movl %r14d, 0x14(%rsp)
movl %r15d, 0x1c(%rsp)
movl %r12d, %r13d
cmpl $0x7f, %r13d
ja 0x296fb
incl %r9d
cmpl %edx, %r9d
jbe 0x29519
jmp 0x296fb
incl 0x10(%rsp)
jmp 0x29929
movl $0x0, 0xc(%rsp)
movl $0x0, 0x14(%rsp)
movl $0x0, 0x1c(%rsp)
decl %edi
cmpl %r13d, %edi
jb 0x298b0
movq 0x68(%rsp), %rdi
movl 0x58(%rdi), %eax
movl 0x50(%rdi), %edx
movq 0x8(%rdi), %r8
movq 0x20(%rdi), %r9
leal 0x3(%rsi), %r10d
movl 0x28(%rdi), %ecx
movl 0x44(%rdi), %r11d
testq %r11, %r11
setne %dil
movl 0x8(%rsp), %ebx
cmpl %ebx, %esi
setb %r15b
andb %dil, %r15b
xorl %edi, %edi
cmpl $0x0, 0x10(%rsp)
sete %dil
leal -0x2(%rdi,%rdi), %edi
movq %rdi, 0x30(%rsp)
movl %esi, %esi
movq %rsi, 0x48(%rsp)
movl %ebx, %esi
movq %rsi, 0x60(%rsp)
xorl %ebp, %ebp
movq %r13, %r12
movl %edx, %esi
xorl %ebp, %esi
movl (%r8,%rsi,4), %esi
testl %esi, %esi
je 0x29898
cmpl 0x8(%rsp), %r10d
jae 0x29898
movzbl (%r9,%r10), %edi
xorl %esi, %edi
testl %edi, 0x18(%rsp)
jne 0x29898
shrl %cl, %esi
movq 0x20(%rsp), %rdi
movl %edi, %r14d
subl %esi, %r14d
jbe 0x29898
addl %r12d, %edi
cmpl 0x8(%rsp), %edi
ja 0x29898
leal (%r12,%rsi), %r13d
decl %r13d
movb (%r9,%r13), %r13b
decl %edi
cmpb (%r9,%rdi), %r13b
jne 0x29898
xorl %r13d, %r13d
movb %r15b, 0x58(%rsp)
testb %r15b, %r15b
je 0x2980b
xorl %r13d, %r13d
movl $0x1, %edi
movq 0x20(%rsp), %rbx
addl %r13d, %ebx
leal (%rsi,%r13), %r15d
movb (%r9,%r15), %r15b
cmpb (%r9,%rbx), %r15b
jne 0x2980b
movq 0x48(%rsp), %rbx
addq %rdi, %rbx
incl %r13d
cmpq 0x60(%rsp), %rbx
jae 0x2980b
leaq 0x1(%rdi), %rbx
cmpq %r11, %rdi
movq %rbx, %rdi
jb 0x297d7
leal (,%r13,8), %edi
movl %r14d, %ebx
shrl $0x10, %ebx
xorl %r15d, %r15d
cmpl $0x10000, %r14d         # imm = 0x10000
setae %r15b
cmovbl %r14d, %ebx
shll $0x4, %r15d
movl %ebx, %r14d
shrl $0x8, %r14d
cmpl $0x100, %ebx            # imm = 0x100
cmovbl %ebx, %r14d
leal 0x8(%r15), %ebx
cmovbl %r15d, %ebx
movl %r14d, %r15d
shrl $0x4, %r15d
cmpl $0x10, %r14d
cmovbl %r14d, %r15d
leal 0x4(%rbx), %r14d
cmovbl %ebx, %r14d
leaq 0xf4a5(%rip), %rbx      # 0x38d0b
movsbl (%r15,%rbx), %ebx
addl %r14d, %ebx
subl %ebx, %edi
movq 0x30(%rsp), %rbx
addl %ebx, %edi
addl $-0xb, %edi
cmpl 0xc(%rsp), %edi
movb 0x58(%rsp), %r15b
jle 0x29898
movl $0x0, 0x14(%rsp)
movl %edi, 0xc(%rsp)
movl %esi, 0x1c(%rsp)
movl %r13d, %r12d
movq %r12, %r13
cmpl $0x7f, %r13d
ja 0x298ab
incl %ebp
cmpl %eax, %ebp
jbe 0x2975c
movq 0x20(%rsp), %rsi
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %r8
movl %esi, %ebp
subl 0x1c(%rsp), %ebp
je 0x29902
cmpl $0x0, 0xc(%rsp)
jle 0x29902
movl %r13d, %r15d
subl 0x14(%rsp), %r15d
xorl %eax, %eax
cmpl $0x10000, %ebp          # imm = 0x10000
setae %al
cmpl $0x1000000, %ebp        # imm = 0x1000000
sbbl $-0x1, %eax
movq 0x68(%rsp), %rcx
cmpl $0x2, 0x2c(%rcx)
movl $0x0, %ecx
cmovnel %ecx, %eax
addl %r8d, %eax
cmpl %eax, %r15d
jae 0x29a0e
incl 0x10(%rsp)
movl $0x1, %r13d
testq %rdi, %rdi
movq 0x68(%rsp), %r14
movl 0x38(%rsp), %ebx
movl $0x75bcd17, %ebp        # imm = 0x75BCD17
movl $0x165ec15, %r15d       # imm = 0x165EC15
jne 0x29a50
movl 0x38(%r14), %esi
movl $0x1, %r13d
movq 0x8(%r14), %rax
movq 0x20(%r14), %rdx
movl 0x64(%r14), %ecx
addl %esi, %ecx
cmpl 0x34(%r14), %ecx
jae 0x299fa
imull $0x12d673, %esi, %r10d  # imm = 0x12D673
shrl $0x13, %r10d
movb 0x28(%r14), %cl
movl %esi, %r8d
shll %cl, %r8d
addl $0x3, %esi
movzbl (%rdx,%rsi), %edi
andl 0x18(%rsp), %edi
orl %r8d, %edi
andl 0x58(%r14), %r10d
cmpl $0x0, 0x40(%r14)
je 0x299bd
movl 0x54(%r14), %ecx
xorl %r10d, %ecx
movl %edi, (%rax,%rcx,4)
movl 0x54(%r14), %ecx
leal (%rcx,%rcx,8), %r8d
movb 0x60(%r14), %cl
shll %cl, %r8d
addl %r15d, %r8d
movl 0x30(%r14), %ecx
movl 0x40(%r14), %r9d
addl 0x38(%r14), %r9d
addl 0x4c(%r14), %r9d
movzbl (%rdx,%r9), %r9d
imull $0x165ec15, %r9d, %r9d  # imm = 0x165EC15
addl %r8d, %r9d
decl %ecx
andl %r9d, %ecx
movl %ecx, 0x54(%r14)
xorl 0x50(%r14), %r10d
movl %edi, (%rax,%r10,4)
movl 0x50(%r14), %ecx
leal (%rcx,%rcx,4), %r8d
movb 0x5c(%r14), %cl
shll %cl, %r8d
addl %ebp, %r8d
movl 0x30(%r14), %ecx
movl 0x38(%r14), %esi
movl 0x3c(%r14), %edi
addl %esi, %edi
movzbl (%rdx,%rdi), %edi
imull $0x75bcd17, %edi, %edi  # imm = 0x75BCD17
addl %r8d, %edi
decl %ecx
andl %edi, %ecx
movl %ecx, 0x50(%r14)
decl %r13d
incl %esi
movl %esi, 0x38(%r14)
testl %r13d, %r13d
jne 0x2993b
jmp 0x29a5b
movl 0x14(%rsp), %eax
addl %eax, 0x10(%rsp)
addl %eax, %esi
movq 0x68(%rsp), %r14
movq %r14, %rdi
leaq 0x10(%rsp), %rdx
callq 0x29d30
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x29f26
cmpq $0x0, 0x88(%r14)
je 0x29a88
movl 0x38(%rsp), %ebx
movl $0x75bcd17, %ebp        # imm = 0x75BCD17
movl $0x165ec15, %r15d       # imm = 0x165EC15
addl 0x38(%r14), %r13d
movl %r13d, 0x38(%r14)
movl %r13d, %esi
movl 0x10(%rsp), %eax
cmpl 0x48(%r14), %eax
jb 0x29a76
movq %r14, %rdi
leaq 0x10(%rsp), %rdx
callq 0x29d30
movl 0x38(%r14), %esi
movl 0x34(%r14), %eax
movl %eax, 0x8(%rsp)
cmpl %eax, %esi
jb 0x290da
jmp 0x29aa6
movl 0x38(%r14), %esi
testl %r13d, %r13d
movl 0x38(%rsp), %ebx
movl $0x75bcd17, %ebp        # imm = 0x75BCD17
movl $0x165ec15, %r15d       # imm = 0x165EC15
jne 0x29933
jmp 0x29a5b
cmpl 0x8(%rsp), %esi
jne 0x29adf
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x29d30
cmpl $0x0, 0x70(%r14)
je 0x29ad7
movb 0x6c(%r14), %al
movl 0x78(%r14), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x78(%r14)
movb %al, 0x90(%r14,%rcx)
movq $0x0, 0x6c(%r14)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop