// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: balance
static int balance(BtCursor *pCur){
  int rc = SQLITE_OK;
  const int nMin = pCur->pBt->usableSize * 2 / 3;
  u8 aBalanceQuickSpace[13];
  u8 *pFree = 0;

  TESTONLY( int balance_quick_called = 0 );
  TESTONLY( int balance_deeper_called = 0 );

  do {
    int iPage = pCur->iPage;
    MemPage *pPage = pCur->apPage[iPage];

    if( iPage==0 ){
      if( pPage->nOverflow ){
        /* The root page of the b-tree is overfull. In this case call the
        ** balance_deeper() function to create a new child for the root-page
        ** and copy the current contents of the root-page to it. The
        ** next iteration of the do-loop will balance the child page.
        */ 
        assert( (balance_deeper_called++)==0 );
        rc = balance_deeper(pPage, &pCur->apPage[1]);
        if( rc==SQLITE_OK ){
          pCur->iPage = 1;
          pCur->aiIdx[0] = 0;
          pCur->aiIdx[1] = 0;
          assert( pCur->apPage[1]->nOverflow );
        }
      }else{
        break;
      }
    }else if( pPage->nOverflow==0 && pPage->nFree<=nMin ){
      break;
    }else{
      MemPage * const pParent = pCur->apPage[iPage-1];
      int const iIdx = pCur->aiIdx[iPage-1];

      rc = sqlite3PagerWrite(pParent->pDbPage);
      if( rc==SQLITE_OK ){
#ifndef SQLITE_OMIT_QUICKBALANCE
        if( pPage->hasData
         && pPage->nOverflow==1
         && pPage->aiOvfl[0]==pPage->nCell
         && pParent->pgno!=1
         && pParent->nCell==iIdx
        ){
          /* Call balance_quick() to create a new sibling of pPage on which
          ** to store the overflow cell. balance_quick() inserts a new cell
          ** into pParent, which may cause pParent overflow. If this
          ** happens, the next interation of the do-loop will balance pParent 
          ** use either balance_nonroot() or balance_deeper(). Until this
          ** happens, the overflow cell is stored in the aBalanceQuickSpace[]
          ** buffer. 
          **
          ** The purpose of the following assert() is to check that only a
          ** single call to balance_quick() is made for each call to this
          ** function. If this were not verified, a subtle bug involving reuse
          ** of the aBalanceQuickSpace[] might sneak in.
          */
          assert( (balance_quick_called++)==0 );
          rc = balance_quick(pParent, pPage, aBalanceQuickSpace);
        }else
#endif
        {
          /* In this case, call balance_nonroot() to redistribute cells
          ** between pPage and up to 2 of its sibling pages. This involves
          ** modifying the contents of pParent, which may cause pParent to
          ** become overfull or underfull. The next iteration of the do-loop
          ** will balance the parent page to correct this.
          ** 
          ** If the parent page becomes overfull, the overflow cell or cells
          ** are stored in the pSpace buffer allocated immediately below. 
          ** A subsequent iteration of the do-loop will deal with this by
          ** calling balance_nonroot() (balance_deeper() may be called first,
          ** but it doesn't deal with overflow cells - just moves them to a
          ** different page). Once this subsequent call to balance_nonroot() 
          ** has completed, it is safe to release the pSpace buffer used by
          ** the previous call, as the overflow cell data will have been 
          ** copied either into the body of a database page or into the new
          ** pSpace buffer passed to the latter call to balance_nonroot().
          */
          u8 *pSpace = sqlite3PageMalloc(pCur->pBt->pageSize);
          rc = balance_nonroot(pParent, iIdx, pSpace, iPage==1, pCur->hints);
          if( pFree ){
            /* If pFree is not NULL, it points to the pSpace buffer used 
            ** by a previous call to balance_nonroot(). Its contents are
            ** now stored either on real database pages or within the 
            ** new pSpace buffer, so it may be safely freed here. */
            sqlite3PageFree(pFree);
          }

          /* The pSpace buffer will be freed after the next call to
          ** balance_nonroot(), or just before this function returns, whichever
          ** comes first. */
          pFree = pSpace;
        }
      }

      pPage->nOverflow = 0;

      /* The next iteration of the do-loop balances the parent page. */
      releasePage(pPage);
      pCur->iPage--;
    }
  }while( rc==SQLITE_OK );

  if( pFree ){
    sqlite3PageFree(pFree);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x8(%rdi), %rax
movl 0x34(%rax), %eax
addl %eax, %eax
pushq $0x3
popq %rcx
xorl %edx, %edx
divl %ecx
movl %eax, -0x110(%rbp)
movzwl 0x7a(%rdi), %r13d
movq $0x0, -0xf0(%rbp)
movq %rdi, -0xd8(%rbp)
movswq %r13w, %rax
movq 0xa8(%rdi,%rax,8), %r12
movb 0x1(%r12), %cl
testw %ax, %ax
movq %r12, -0xa8(%rbp)
je 0x2ca3f
testb %cl, %cl
jne 0x2ca19
movzwl 0xe(%r12), %ecx
cmpl %ecx, -0x110(%rbp)
jae 0x2dc49
movq 0xa0(%rdi,%rax,8), %r15
movzwl 0x7a(%rdi,%rax,2), %r14d
movq 0x68(%r15), %rdi
callq 0xd10b
testl %eax, %eax
je 0x2cb5c
movl %eax, %ebx
jmp 0x2d6cb
testb %cl, %cl
je 0x2dc49
andq $0x0, -0x140(%rbp)
andl $0x0, -0xd0(%rbp)
movq 0x48(%r12), %r15
movq 0x68(%r12), %rdi
callq 0xd10b
testl %eax, %eax
jne 0x2dc4d
movl 0x70(%r12), %ecx
movq %r15, %rdi
leaq -0x140(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
xorl %r8d, %r8d
callq 0x1ec5e
movl %eax, -0x1d0(%rbp)
movq -0x140(%rbp), %r14
movq %r12, %rdi
movq %r14, %rsi
leaq -0x1d0(%rbp), %rbx
movq %rbx, %rdx
callq 0x2e0ee
cmpb $0x0, 0x21(%r15)
je 0x2cacd
movl -0xd0(%rbp), %esi
movl 0x70(%r12), %ecx
movq %r15, %rdi
pushq $0x5
popq %rdx
movq %rbx, %r8
callq 0x1f801
movl -0x1d0(%rbp), %ebx
testl %ebx, %ebx
jne 0x2dc52
leaq 0x14(%r14), %rdi
movq -0xa8(%rbp), %rbx
leaq 0x14(%rbx), %rsi
movzbl 0x1(%rbx), %edx
addl %edx, %edx
callq 0x82c0
leaq 0x20(%r14), %rdi
leaq 0x20(%rbx), %rsi
movzbl 0x1(%rbx), %edx
shll $0x3, %edx
callq 0x82c0
movb 0x1(%rbx), %al
movb %al, 0x1(%r14)
movq 0x50(%r14), %rax
movzbl (%rax), %esi
andl $-0x9, %esi
movq %rbx, %rdi
callq 0x1db70
movq 0x50(%rbx), %rax
movzbl 0x5(%rbx), %ecx
movl -0xd0(%rbp), %edx
bswapl %edx
movl %edx, 0x8(%rax,%rcx)
movq -0xd8(%rbp), %rdi
movq %r14, 0xb0(%rdi)
movl $0x1, 0x7a(%rdi)
andw $0x0, 0x7e(%rdi)
xorl %ebx, %ebx
movw $0x1, %r13w
jmp 0x2d6ef
movq -0xa8(%rbp), %rcx
cmpb $0x0, 0x4(%rcx)
je 0x2cd2f
cmpb $0x1, 0x1(%rcx)
jne 0x2cd2f
movzwl 0x14(%rcx), %eax
cmpw 0x10(%rcx), %ax
jne 0x2cd2f
cmpl $0x1, 0x70(%r15)
je 0x2cd2f
cmpw %r14w, 0x10(%r15)
jne 0x2cd2f
testw %ax, %ax
je 0x2d74e
movq 0x48(%rcx), %r14
movq %r14, %rdi
leaq -0x140(%rbp), %rsi
leaq -0x1b0(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1ec5e
movl %eax, %ebx
movl %eax, -0xd0(%rbp)
testl %eax, %eax
jne 0x2d6cb
movq -0xa8(%rbp), %rdi
movq 0x20(%rdi), %r12
movq %r12, -0x1d0(%rbp)
movq %r12, %rsi
callq 0x2c1c4
movl %eax, %r13d
movw %ax, -0x180(%rbp)
movq -0x140(%rbp), %rbx
movq %rbx, %rdi
pushq $0xd
popq %rsi
callq 0x1db70
movq %rbx, %rdi
pushq $0x1
popq %rsi
leaq -0x1d0(%rbp), %rdx
leaq -0x180(%rbp), %rcx
callq 0x2e1a1
cmpb $0x0, 0x21(%r14)
je 0x2cc5e
movl -0x1b0(%rbp), %esi
movl 0x70(%r15), %ecx
movq %r14, %rdi
pushq $0x5
popq %rdx
leaq -0xd0(%rbp), %r8
callq 0x1f801
cmpw 0xa(%rbx), %r13w
jbe 0x2cc5e
movq %rbx, %rdi
movq %r12, %rsi
leaq -0xd0(%rbp), %rdx
callq 0x1fa21
movq -0xa8(%rbp), %rsi
movzwl 0x12(%rsi), %eax
movq 0x50(%rsi), %rdx
movq 0x60(%rsi), %rcx
movzwl 0x10(%rsi), %esi
movzbl -0x2(%rcx,%rsi,2), %edi
shll $0x8, %edi
movzbl -0x1(%rcx,%rsi,2), %esi
orl %edi, %esi
andl %eax, %esi
leaq (%rdx,%rsi), %rcx
leaq (%rdx,%rsi), %rdi
addq $0x2, %rdi
xorl %esi, %esi
movq %rdi, %rdx
leaq 0x1(%rcx), %rax
cmpq $0x7, %rsi
ja 0x2ccb0
incq %rsi
leaq 0x1(%rdx), %rdi
cmpb $0x0, (%rcx)
movq %rax, %rcx
js 0x2cc94
addq $0x9, %rax
pushq $0x4
popq %rcx
movq %r15, %r14
movb -0x1(%rdx), %sil
movb %sil, -0x205(%rbp,%rcx)
incq %rcx
testb %sil, %sil
jns 0x2ccda
leaq 0x1(%rdx), %rsi
cmpq %rax, %rdx
movq %rsi, %rdx
jb 0x2ccba
movzwl 0x10(%r14), %esi
movq -0xa8(%rbp), %rax
movl 0x70(%rax), %r9d
leaq -0xd0(%rbp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq -0x205(%rbp), %rdx
xorl %r8d, %r8d
callq 0x2c687
movq 0x50(%r14), %rax
movzbl 0x5(%r14), %ecx
movl -0x1b0(%rbp), %edx
bswapl %edx
movl %edx, 0x8(%rax,%rcx)
movq %rbx, %rdi
callq 0x1d90e
movl -0xd0(%rbp), %ebx
jmp 0x2d6cb
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x30(%rax), %edi
callq 0x1a6eb
pushq $0x7
popq %rbx
movq %rax, -0xf8(%rbp)
testq %rax, %rax
je 0x2d6ac
movq -0xd8(%rbp), %rax
movzbl 0x79(%rax), %eax
movq %rax, -0x70(%rbp)
movzbl 0x1(%r15), %ecx
movzwl 0x10(%r15), %eax
leal (%rax,%rcx), %ebx
cmpl $0x2, %ebx
jae 0x2cd7b
xorl %r14d, %r14d
jmp 0x2cda2
testl %r14d, %r14d
je 0x2cd92
cmpl %r14d, %ebx
jne 0x2cd97
movq -0x70(%rbp), %rdx
addl %edx, %r14d
addl $-0x2, %r14d
jmp 0x2cd9a
xorl %r14d, %r14d
jmp 0x2cd9a
decl %r14d
pushq $0x2
popq %rdx
movl %edx, %ebx
subl -0x70(%rbp), %ebx
movl %r14d, %edx
subl %ecx, %edx
addl %ebx, %edx
movq 0x50(%r15), %rdi
cmpl %eax, %edx
movl %r13d, -0x10c(%rbp)
jne 0x2cdc6
movzbl 0x5(%r15), %eax
addq %rax, %rdi
addq $0x8, %rdi
jmp 0x2cde5
movzwl 0x12(%r15), %eax
movq 0x60(%r15), %rcx
movslq %edx, %rdx
movzbl (%rcx,%rdx,2), %esi
shll $0x8, %esi
movzbl 0x1(%rcx,%rdx,2), %ecx
orl %esi, %ecx
andl %eax, %ecx
addq %rcx, %rdi
movq 0x48(%r15), %r13
leal 0x1(%rbx), %eax
movl %eax, -0x88(%rbp)
movq %rdi, -0x1e0(%rbp)
callq 0x180a3
movl %eax, -0x38(%rbp)
movslq %ebx, %rcx
movq %r15, -0x68(%rbp)
movq %rcx, %r12
shlq $0x20, %r12
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r12
movq %rcx, %rax
negq %rax
movq %rax, -0x90(%rbp)
leaq -0x164(%rbp), %rax
leaq (%rax,%rcx,4), %rax
movq %rax, -0x60(%rbp)
leaq -0x228(%rbp), %rax
leaq (%rax,%rcx,8), %rax
movq %rax, -0x98(%rbp)
addl %r14d, %ebx
movq %r14, -0x188(%rbp)
leal (%r14,%rcx), %eax
decl %eax
movq %rax, -0x40(%rbp)
leal -0x2(%rbx,%rbx), %eax
movl %eax, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
leaq -0xd0(,%rcx,8), %r15
addq %rbp, %r15
xorl %r14d, %r14d
xorl %ecx, %ecx
movq $0x0, -0xb0(%rbp)
movq %r13, -0x80(%rbp)
movq %r15, -0x78(%rbp)
movq %rcx, -0x58(%rbp)
leaq (%r15,%rcx), %rdx
movq %r13, %rdi
movl -0x38(%rbp), %esi
xorl %ecx, %ecx
callq 0x2bd80
movl %eax, -0x2c(%rbp)
testl %eax, %eax
jne 0x2d030
movq %r12, %rbx
movq (%r15,%r14,8), %rax
movzwl 0x10(%rax), %ecx
movzbl 0x1(%rax), %eax
movslq -0xb0(%rbp), %rdx
addq %rcx, %rdx
leaq (%rax,%rdx), %r12
incq %r12
cmpq %r14, -0x90(%rbp)
je 0x2d04c
movq %r12, -0xb0(%rbp)
movq -0x68(%rbp), %r15
movzwl 0x14(%r15), %ecx
movq -0x40(%rbp), %rax
leal (%rax,%r14), %edx
movb 0x1(%r15), %al
cmpl %ecx, %edx
jne 0x2cf37
testb %al, %al
je 0x2cf37
movq 0x20(%r15), %r12
movq -0x98(%rbp), %rax
movq %r12, (%rax,%r14,8)
movq %r12, %rdi
callq 0x180a3
movl %eax, -0x38(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2c1c4
movzwl %ax, %eax
movq -0x60(%rbp), %rcx
movl %eax, (%rcx,%r14,4)
movb $0x0, 0x1(%r15)
jmp 0x2d008
movzbl %al, %eax
movzwl 0x12(%r15), %ecx
movq 0x60(%r15), %rdx
addl %eax, %eax
movl -0x48(%rbp), %esi
subl %eax, %esi
movslq %esi, %rax
movzbl (%rdx,%rax), %esi
shll $0x8, %esi
movzbl 0x1(%rdx,%rax), %r12d
orl %esi, %r12d
andl %ecx, %r12d
addq 0x50(%r15), %r12
movq -0x98(%rbp), %rax
movq %r12, (%rax,%r14,8)
movq %r12, %rdi
callq 0x180a3
movl %eax, -0x38(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2c1c4
movq %r13, %rcx
movzwl %ax, %r13d
movq -0x60(%rbp), %rax
movl %r13d, (%rax,%r14,4)
testb $0x4, 0x26(%rcx)
je 0x2cfe6
movl 0x50(%r15), %ecx
movl %r12d, %eax
subl %ecx, %eax
leal (%rax,%r13), %ecx
movq -0x80(%rbp), %rdx
cmpl 0x34(%rdx), %ecx
jg 0x2d510
movslq %eax, %rdi
movq -0xf8(%rbp), %r15
addq %r15, %rdi
movl %r13d, %edx
movq %r12, %rsi
callq 0x82c0
movq -0x68(%rbp), %rax
subq 0x50(%rax), %r12
addq %r15, %r12
movq -0x68(%rbp), %r15
movq -0x98(%rbp), %rax
movq %r12, (%rax,%r14,8)
movzbl 0x1(%r15), %eax
movq -0x40(%rbp), %rcx
leal (%rcx,%r14), %esi
subl %eax, %esi
movq %r15, %rdi
movl %r13d, %edx
leaq -0x2c(%rbp), %rcx
callq 0x2c3f4
movq -0x80(%rbp), %r13
movq -0x58(%rbp), %rcx
addq $-0x8, %rcx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rbx, %r12
addq %rax, %r12
decq %r14
addl $-0x2, -0x48(%rbp)
movq -0x78(%rbp), %r15
jmp 0x2ce8c
sarq $0x1d, %r12
xorl %ebx, %ebx
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x81e0
jmp 0x2d508
movl -0x38(%rbp), %eax
movl %eax, -0xe4(%rbp)
addq $0x3, %r12
andq $-0x4, %r12
movl 0x30(%r13), %eax
leal 0x78(%rax), %edx
imull $0xa, %r12d, %ecx
movl %edx, -0x100(%rbp)
movl -0x88(%rbp), %edi
imull %edx, %edi
addl %eax, %edi
addl %ecx, %edi
callq 0x15019
testq %rax, %rax
je 0x2d4ff
movq %rax, %r14
leaq (%rax,%r12,8), %rbx
leaq (%rbx,%r12,2), %rax
movq %rax, -0x190(%rbp)
movq -0xd0(%rbp), %rcx
movzbl 0x3(%rcx), %eax
movl %eax, -0xdc(%rbp)
shll $0x2, %eax
movq %rax, -0x88(%rbp)
movq %rcx, -0x1d8(%rbp)
movzbl 0x4(%rcx), %eax
movq %rax, -0xa0(%rbp)
movq -0x50(%rbp), %rcx
leaq 0x1(%rcx), %rax
movq $0x0, -0x60(%rbp)
testq %rax, %rax
movl $0x0, %edx
movq %rax, -0x108(%rbp)
cmovgq %rax, %rdx
movq %rdx, -0x1f8(%rbp)
movq %r12, -0xb0(%rbp)
imulq $0xa, %r12, %rax
leaq (%r14,%rax), %rdx
movq %rdx, -0x1f0(%rbp)
addq %r14, %rax
addq $0x79, %rax
movq %rax, -0x1e8(%rbp)
xorl %esi, %esi
movl $0x0, -0xe0(%rbp)
movq $0x0, -0x38(%rbp)
movq %r14, -0x40(%rbp)
movq %rbx, -0x58(%rbp)
movzwl -0x88(%rbp), %ecx
cmpq -0x1f8(%rbp), %rsi
movq %rcx, -0x198(%rbp)
je 0x2d3ae
movq %r13, %r8
movl 0x30(%r13), %r13d
movl -0x100(%rbp), %eax
movl %eax, %edx
imull %esi, %edx
addl %r13d, %edx
movq -0x190(%rbp), %r9
leaq (%r9,%rdx), %rbx
movq %rbx, -0x1b0(%rbp,%rsi,8)
movq %rsi, -0x78(%rbp)
movq -0xd0(%rbp,%rsi,8), %rax
pushq $0xf
popq %rcx
movq %rbx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x78(%r9,%rdx), %r12
movq %r12, -0x28(%r12)
movq 0x50(%rax), %rsi
movl 0x30(%r8), %edx
movq %r12, %rdi
callq 0x82c0
movzwl -0x68(%r12), %r15d
movzbl -0x77(%r12), %eax
addl %eax, %r15d
testl %eax, %eax
je 0x2d24d
movq -0x38(%rbp), %rax
cltq
movq %rax, -0x38(%rbp)
addl -0x60(%rbp), %r13d
addq -0x1f0(%rbp), %r13
xorl %r12d, %r12d
cmpl %r15d, %r12d
je 0x2d2d3
movzbl 0x1(%rbx), %eax
movl %r12d, %ecx
testq %rax, %rax
jle 0x2d1fe
movzwl 0x12(%r13,%rax,2), %edx
decq %rax
cmpl %edx, %ecx
jl 0x2d1e6
je 0x2d246
decl %ecx
jmp 0x2d1e6
movzwl 0x12(%rbx), %eax
movq 0x60(%rbx), %rdx
movslq %ecx, %rcx
movzbl (%rdx,%rcx,2), %edi
shll $0x8, %edi
movzbl 0x1(%rdx,%rcx,2), %esi
orl %edi, %esi
andl %eax, %esi
addq 0x50(%rbx), %rsi
movq -0x38(%rbp), %r14
movq -0x40(%rbp), %rax
movq %rsi, (%rax,%r14,8)
movq %rbx, %rdi
callq 0x2c1c4
movq -0x58(%rbp), %rcx
movw %ax, (%rcx,%r14,2)
incq %r14
movq %r14, -0x38(%rbp)
incl %r12d
jmp 0x2d1d6
movq 0x20(%r13,%rax,8), %rsi
jmp 0x2d21d
movzwl 0x12(%rbx), %eax
movq %rax, -0x98(%rbp)
movzwl 0xc(%rbx), %eax
movq -0x38(%rbp), %rdx
movslq %edx, %rdx
movl %r15d, %ecx
movq %rcx, -0x48(%rbp)
movq -0x58(%rbp), %rcx
leaq (%rcx,%rdx,2), %rcx
movq %rcx, -0x90(%rbp)
movq %rdx, -0x38(%rbp)
leaq (%r14,%rdx,8), %r14
addl -0x60(%rbp), %r13d
addq -0x1e8(%rbp), %r13
addq %rax, %r13
xorl %r15d, %r15d
cmpq %r15, -0x48(%rbp)
je 0x2d2cf
movzbl -0x1(%r13,%r15,2), %eax
shll $0x8, %eax
movzbl (%r13,%r15,2), %esi
orl %eax, %esi
andl -0x98(%rbp), %esi
addq %r12, %rsi
movq %rsi, (%r14,%r15,8)
movq %rbx, %rdi
callq 0x2c1c4
movq -0x90(%rbp), %rcx
movw %ax, (%rcx,%r15,2)
incq %r15
jmp 0x2d292
addq %r15, -0x38(%rbp)
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %r14
movq -0x78(%rbp), %rsi
cmpq %rcx, %rsi
movq -0x80(%rbp), %r13
jge 0x2d366
cmpb $0x0, -0xa0(%rbp)
jne 0x2d366
movl -0x160(%rbp,%rsi,4), %eax
movzwl %ax, %r12d
movslq -0x38(%rbp), %r14
movq -0x58(%rbp), %r15
movw %r12w, (%r15,%r14,2)
movslq -0xe0(%rbp), %r13
addq -0x190(%rbp), %r13
movq -0x220(%rbp,%rsi,8), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x82c0
addq -0x88(%rbp), %r13
movq -0x40(%rbp), %rax
movq %r13, (%rax,%r14,8)
movzwl (%r15,%r14,2), %eax
subl -0x198(%rbp), %eax
movw %ax, (%r15,%r14,2)
cmpb $0x0, 0x3(%rbx)
je 0x2d36c
cmpw $0x3, %ax
movq -0x80(%rbp), %r13
movq -0x58(%rbp), %rbx
ja 0x2d37f
movw $0x4, (%rbx,%r14,2)
jmp 0x2d37f
movq -0x58(%rbp), %rbx
jmp 0x2d398
movq 0x50(%rbx), %rax
movl 0x8(%rax), %eax
movl %eax, (%r13)
movq -0x80(%rbp), %r13
movq -0x58(%rbp), %rbx
addl %r12d, -0xe0(%rbp)
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %r14
movq -0x78(%rbp), %rsi
incq %rsi
movq -0x60(%rbp), %rax
addl -0x100(%rbp), %eax
movq %rax, -0x60(%rbp)
jmp 0x2d132
movl 0x34(%r13), %eax
addl %ecx, %eax
addl $-0xc, %eax
xorl %esi, %esi
movq -0xa0(%rbp), %rcx
negq %rcx
movl $0x0, %ecx
sbbl %ecx, %ecx
xorl %r12d, %r12d
xorl %edx, %edx
movslq %r12d, %r13
cmpl -0x38(%rbp), %edx
jge 0x2d411
movslq %edx, %rdi
movzwl (%rbx,%rdi,2), %edi
addl %esi, %edi
addl $0x2, %edi
cmpl %eax, %edi
jle 0x2d40b
addl $0x2, %esi
movl %esi, -0x160(%rbp,%r13,4)
movl %edx, -0x180(%rbp,%r13,4)
cmpl $0x4, %r12d
jge 0x2d63b
addl %ecx, %edx
incl %r12d
xorl %edi, %edi
incl %edx
movl %edi, %esi
jmp 0x2d3cf
movl %esi, -0x160(%rbp,%r13,4)
movq -0x38(%rbp), %rax
movl %eax, -0x180(%rbp,%r13,4)
movl %r13d, %eax
movq -0xa0(%rbp), %rcx
addl %ecx, %ecx
movq %r14, %rdx
subq %rcx, %rdx
movq -0xb0(%rbp), %rcx
leaq (%rdx,%rcx,8), %rcx
testl %eax, %eax
jle 0x2d4e8
movl -0x164(%rbp,%rax,4), %r8d
movl -0x160(%rbp,%rax,4), %r9d
leaq -0x1(%rax), %rdx
movslq -0x184(%rbp,%rax,4), %rdi
leal -0x1(%rdi), %esi
leaq (%rcx,%rdi,2), %rdi
movslq %esi, %r11
testl %r9d, %r9d
je 0x2d4a4
cmpb $0x0, -0x70(%rbp)
jne 0x2d4d0
movzwl (%rdi), %r10d
addl %r9d, %r10d
addl $0x2, %r10d
movq -0x58(%rbp), %rbx
movzwl (%rbx,%r11,2), %ebx
movl %r8d, %r11d
subl %ebx, %r11d
movq -0x58(%rbp), %rbx
addl $-0x2, %r11d
cmpl %r11d, %r10d
jle 0x2d4bb
jmp 0x2d4d0
movzwl (%rdi), %r10d
movzwl (%rbx,%r11,2), %r9d
addl $0x2, %r10d
subl %r9d, %r8d
addl $-0x2, %r8d
movl %r8d, %r11d
movl %esi, -0x180(%rbp,%rdx,4)
decl %esi
addq $-0x2, %rdi
movl %r10d, %r9d
movl %r11d, %r8d
jmp 0x2d46d
movl %r9d, -0x160(%rbp,%rax,4)
movl %r8d, -0x160(%rbp,%rdx,4)
movq %rdx, %rax
jmp 0x2d442
movq -0x1d8(%rbp), %rax
cmpl $0x1, 0x70(%rax)
ja 0x2d545
movl $0xdac9, %edi           # imm = 0xDAC9
jmp 0x2d640
movl $0x7, -0x2c(%rbp)
xorl %ebx, %ebx
xorl %r15d, %r15d
jmp 0x2d652
movl $0xda00, %edi           # imm = 0xDA00
callq 0x1a1fc
movl $0xb, -0x2c(%rbp)
movq -0x50(%rbp), %r14
movq -0x58(%rbp), %rax
leaq (%rax,%r14,8), %rdx
xorl %ebx, %ebx
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
callq 0x81e0
xorl %r15d, %r15d
jmp 0x2d656
movq 0x50(%rax), %rax
testq %r13, %r13
pushq $-0x1
popq %rcx
cmovsq %rcx, %r13
movzbl (%rax), %eax
movl %eax, -0x90(%rbp)
incq %r13
xorl %ebx, %ebx
movq $0x0, -0x48(%rbp)
cmpq %rbx, %r13
je 0x2d6fc
cmpq -0x50(%rbp), %rbx
jle 0x2d5f7
pushq $0x1
popq %rcx
cmpb $0x0, -0x70(%rbp)
jne 0x2d587
movl -0xe4(%rbp), %ecx
movq -0x80(%rbp), %r14
movq %r14, %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0xe4(%rbp), %rdx
xorl %r8d, %r8d
callq 0x1ec5e
movl %eax, -0x2c(%rbp)
testl %eax, %eax
jne 0x2d979
movq -0x1d0(%rbp), %rax
movq %rax, -0x140(%rbp,%rbx,8)
movq -0x48(%rbp), %rcx
incl %ecx
movq %rcx, -0x48(%rbp)
cmpb $0x0, 0x21(%r14)
je 0x2d62f
movl 0x70(%rax), %esi
movq -0x68(%rbp), %rax
movl 0x70(%rax), %ecx
movq %r14, %rdi
pushq $0x5
popq %rdx
leaq -0x2c(%rbp), %r8
callq 0x1f801
cmpl $0x0, -0x2c(%rbp)
movq -0x40(%rbp), %r14
je 0x2d633
jmp 0x2d97d
movq -0xd0(%rbp,%rbx,8), %rax
movq %rax, -0x140(%rbp,%rbx,8)
andq $0x0, -0xd0(%rbp,%rbx,8)
movq 0x68(%rax), %rdi
callq 0xd10b
movl %eax, -0x2c(%rbp)
movq -0x48(%rbp), %rcx
incl %ecx
movq %rcx, -0x48(%rbp)
testl %eax, %eax
je 0x2d633
jmp 0x2d97d
movq -0x40(%rbp), %r14
incq %rbx
jmp 0x2d569
movl $0xda8b, %edi           # imm = 0xDA8B
callq 0x1a1fc
movl $0xb, -0x2c(%rbp)
xorl %r15d, %r15d
movq %r14, %rbx
movq -0x50(%rbp), %r14
movq %rbx, %rdi
callq 0x150da
testq %r14, %r14
pushq $-0x1
popq %rax
cmovsq %rax, %r14
incq %r14
xorl %ebx, %ebx
cmpq %rbx, %r14
je 0x2d684
movq -0xd0(%rbp,%rbx,8), %rdi
callq 0x1d90e
incq %rbx
jmp 0x2d66d
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x2d6a9
movq -0x140(%rbp,%rbx,8), %rdi
callq 0x1d90e
incq %rbx
jmp 0x2d692
movl -0x2c(%rbp), %ebx
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2d6bd
callq 0x1a82f
movq -0xf8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xa8(%rbp), %rdi
movb $0x0, 0x1(%rdi)
callq 0x1d90e
movq -0xd8(%rbp), %rdi
movzwl 0x7a(%rdi), %r13d
decl %r13d
movw %r13w, 0x7a(%rdi)
testl %ebx, %ebx
je 0x2c9e6
jmp 0x2dc69
movq -0x108(%rbp), %rax
cmpq %rax, %r13
cmovgq %r13, %rax
movq %rax, -0x108(%rbp)
cmpq %r13, -0x108(%rbp)
je 0x2d760
movq -0xd0(%rbp,%r13,8), %rbx
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2e26e
cmpl $0x0, -0x2c(%rbp)
jne 0x2d97d
movq %rbx, %rdi
callq 0x1d90e
andq $0x0, -0xd0(%rbp,%r13,8)
incq %r13
jmp 0x2d711
movl $0xd8af, %edi           # imm = 0xD8AF
callq 0x1a1fc
pushq $0xb
popq %rbx
jmp 0x2d6cb
testl %r12d, %r12d
movl $0x0, %eax
cmovgl %r12d, %eax
xorl %ecx, %ecx
pushq $0x1
popq %rdx
cmpq %rax, %rcx
je 0x2d7d0
movq -0x140(%rbp,%rcx,8), %rsi
movl 0x70(%rsi), %edi
movq %rdx, %r8
movl %ecx, %r9d
cmpl %r8d, %r12d
jl 0x2d7a8
movq -0x140(%rbp,%r8,8), %r10
movl 0x70(%r10), %r10d
cmpl %edi, %r10d
cmovbl %r10d, %edi
cmovbl %r8d, %r9d
incq %r8
jmp 0x2d787
movslq %r9d, %rdi
cmpq %rdi, %rcx
jge 0x2d7c8
movq -0x140(%rbp,%rdi,8), %r8
movq %r8, -0x140(%rbp,%rcx,8)
movq %rsi, -0x140(%rbp,%rdi,8)
incq %rcx
incq %rdx
jmp 0x2d771
movq -0x48(%rbp), %rdx
movslq %edx, %rax
movq -0x148(%rbp,%rax,8), %rax
movq %rax, -0x78(%rbp)
movl 0x70(%rax), %eax
bswapl %eax
movq -0x1e0(%rbp), %rcx
movl %eax, (%rcx)
cmpq $0x0, -0xa0(%rbp)
sete -0xb0(%rbp)
xorl %r13d, %r13d
testl %edx, %edx
movl $0x0, %eax
cmovgl %edx, %eax
movq %rax, -0x98(%rbp)
movl $0x0, -0x70(%rbp)
xorl %r14d, %r14d
cmpq %r13, -0x98(%rbp)
je 0x2d98d
movq -0x140(%rbp,%r13,8), %rbx
movq %rbx, %rdi
movl -0x90(%rbp), %esi
callq 0x1db70
movq %r13, %r15
movl -0x180(%rbp,%r13,4), %r12d
movl %r12d, %esi
subl %r14d, %esi
movslq %r14d, %rax
movq -0x40(%rbp), %r14
leaq (%r14,%rax,8), %rdx
movq -0x58(%rbp), %r13
leaq (,%rax,2), %rcx
addq %r13, %rcx
movq %rbx, %rdi
callq 0x2e1a1
cmpl -0x38(%rbp), %r12d
jge 0x2d8f1
movslq %r12d, %rax
movq (%r14,%rax,8), %r10
movzwl (%r13,%rax,2), %esi
movq -0x198(%rbp), %rdx
leal (%rsi,%rdx), %ecx
movslq -0x70(%rbp), %r8
addq -0xf8(%rbp), %r8
cmpb $0x0, 0x3(%rbx)
je 0x2d8f6
cmpq $0x0, -0xa0(%rbp)
movq -0x50(%rbp), %r14
movq %r15, %r13
je 0x2d909
movq %rax, %r12
decq %r12
movq -0x40(%rbp), %rcx
movq -0x8(%rcx,%rax,8), %rsi
movq %rbx, %rdi
leaq -0x1d0(%rbp), %rdx
movq %r8, %r15
callq 0x1e436
leaq 0x4(%r15), %rdi
movq -0x1d0(%rbp), %rsi
callq 0x2bb2a
movl %eax, %ecx
addl $0x4, %ecx
movq %r15, %r10
xorl %r8d, %r8d
jmp 0x2d930
movq %r15, %r13
jmp 0x2d96e
movq 0x50(%rbx), %rax
movl (%r10), %edx
movl %edx, 0x8(%rax)
movq -0x50(%rbp), %r14
movq %r15, %r13
jmp 0x2d930
addq $-0x4, %r10
cmpw $0x4, %si
jne 0x2d930
movq -0x68(%rbp), %rdi
movq %r10, %rsi
movq %r8, -0x60(%rbp)
movq %r10, %r15
callq 0x2c1c4
movq %r15, %r10
movq -0x60(%rbp), %r8
movzwl %ax, %ecx
movl 0x70(%rbx), %r9d
leaq -0x2c(%rbp), %rax
movq %rax, (%rsp)
movq -0x68(%rbp), %rdi
movq -0x188(%rbp), %rbx
movl %ebx, %esi
movq %r10, %rdx
movl %ecx, %r15d
callq 0x2c687
cmpl $0x0, -0x2c(%rbp)
jne 0x2dc40
addl %r15d, -0x70(%rbp)
incl %r12d
incl %ebx
movq %rbx, -0x188(%rbp)
incq %r13
movl %r12d, %r14d
jmp 0x2d81e
movq -0x40(%rbp), %r14
movq %r14, %rbx
movq -0x50(%rbp), %r14
movq -0x48(%rbp), %r15
jmp 0x2d656
testb $0x8, -0x90(%rbp)
movq -0x50(%rbp), %r14
jne 0x2d9b4
movq -0x1b0(%rbp,%r14,8), %rax
movq 0x50(%rax), %rax
movq -0x78(%rbp), %rcx
movq 0x50(%rcx), %rcx
movl 0x8(%rax), %eax
movl %eax, 0x8(%rcx)
cmpw $0x1, -0x10c(%rbp)
movq -0x80(%rbp), %rcx
movq -0x68(%rbp), %rsi
jne 0x2d9e2
cmpw $0x0, 0x10(%rsi)
jne 0x2d9e2
movzbl 0x5(%rsi), %eax
movq -0x140(%rbp), %rbx
cmpw %ax, 0xe(%rbx)
jae 0x2dc22
cmpb $0x0, 0x21(%rcx)
je 0x2dc40
movq -0x1b0(%rbp), %r13
movzbl 0x1(%r13), %r8d
pushq $-0x1
popq %rdi
testl %r8d, %r8d
movq -0x48(%rbp), %r15
je 0x2da09
movzwl 0x14(%r13), %edi
movq -0x140(%rbp), %r9
movzwl 0x10(%r13), %ebx
addl %r8d, %ebx
xorl %eax, %eax
cmpq $0x0, -0xa0(%rbp)
sete %al
movq %rax, -0x100(%rbp)
xorl %r10d, %r10d
movq -0x38(%rbp), %rax
testl %eax, %eax
cmovlel %r10d, %eax
movq %rax, -0x38(%rbp)
xorl %r11d, %r11d
xorl %r12d, %r12d
cmpq -0x38(%rbp), %r10
je 0x2dbc8
movq -0x100(%rbp), %rax
leal (%r10,%rax), %ecx
movslq %r12d, %r12
xorl %eax, %eax
movb -0xb0(%rbp), %sil
movl %ebx, %edx
cmpq %rdx, %r10
jne 0x2da98
movq -0x1a8(%rbp,%r12,8), %r13
incq %r12
movzwl 0x10(%r13), %ebx
addl %ecx, %ebx
movzbl 0x1(%r13), %edx
addl %edx, %ebx
movl %esi, %eax
testl %edx, %edx
je 0x2da64
movzwl 0x14(%r13), %edi
addl %ecx, %edi
movl %edx, %r8d
movl %esi, %eax
jmp 0x2da64
movl %edi, %ecx
xorl %r15d, %r15d
cmpq %rcx, %r10
sete -0x90(%rbp)
cmpl $0x2, %r8d
setge %r14b
movslq %r11d, %rdx
movl -0x180(%rbp,%rdx,4), %esi
cmpq %rsi, %r10
jne 0x2dad8
leal 0x1(%rdx), %r11d
movq -0x138(%rbp,%rdx,8), %r9
cmpq $0x0, -0xa0(%rbp)
je 0x2dba7
cmpq %rcx, %r10
sete %cl
orb %al, %cl
testb $0x1, %cl
jne 0x2daf3
movl 0x70(%r13), %eax
cmpl 0x70(%r9), %eax
je 0x2dba7
cmpb $0x0, -0xdc(%rbp)
jne 0x2db51
movq -0x40(%rbp), %rax
movl %edi, -0x70(%rbp)
movq (%rax,%r10,8), %rdi
movl %r8d, -0x60(%rbp)
movb %r14b, -0x78(%rbp)
movq %r9, %r14
movq %r10, -0x68(%rbp)
movl %r11d, -0x88(%rbp)
callq 0x180a3
movl 0x70(%r14), %ecx
movq -0x80(%rbp), %rdi
movl %eax, %esi
pushq $0x5
popq %rdx
leaq -0x2c(%rbp), %r8
callq 0x1f801
movl -0x88(%rbp), %r11d
movq -0x68(%rbp), %r10
movq %r14, %r9
movb -0x78(%rbp), %r14b
movl -0x60(%rbp), %r8d
movl -0x70(%rbp), %edi
movq -0x58(%rbp), %rax
movzwl (%rax,%r10,2), %eax
cmpw 0xa(%r9), %ax
jbe 0x2dba7
movq -0x40(%rbp), %rax
movq (%rax,%r10,8), %rsi
movl %edi, -0x70(%rbp)
movq %r9, %rdi
leaq -0x2c(%rbp), %rdx
movl %r8d, -0x60(%rbp)
movq %r9, -0x88(%rbp)
movq %r10, -0x68(%rbp)
movb %r14b, -0x78(%rbp)
movl %r11d, %r14d
callq 0x1fa21
movl %r14d, %r11d
movb -0x78(%rbp), %r14b
movq -0x68(%rbp), %r10
movq -0x88(%rbp), %r9
movl -0x60(%rbp), %r8d
movl -0x70(%rbp), %edi
movb -0x90(%rbp), %al
movb %al, %r15b
subl %r15d, %r8d
andb %r14b, %r15b
movzbl %r15b, %eax
addl %eax, %edi
incq %r10
movq -0x48(%rbp), %r15
jmp 0x2da43
cmpb $0x0, -0xdc(%rbp)
je 0x2dbde
movq -0x50(%rbp), %r14
movq -0x40(%rbp), %rbx
jmp 0x2d656
xorl %ebx, %ebx
movq -0x80(%rbp), %r15
cmpq %rbx, -0x98(%rbp)
je 0x2dc1c
movq -0x140(%rbp,%rbx,8), %r14
movq 0x50(%r14), %rdi
addq $0x8, %rdi
callq 0x180a3
movl 0x70(%r14), %ecx
movq %r15, %rdi
movl %eax, %esi
pushq $0x5
popq %rdx
leaq -0x2c(%rbp), %r8
callq 0x1f801
incq %rbx
jmp 0x2dbe4
movq -0x50(%rbp), %r14
jmp 0x2dc40
movq %rbx, %rdi
leaq -0x2c(%rbp), %r14
movq %r14, %rdx
callq 0x2e0ee
movq %rbx, %rdi
movq %r14, %rsi
movq -0x50(%rbp), %r14
callq 0x2e26e
movq -0x40(%rbp), %rbx
jmp 0x2d984
xorl %ebx, %ebx
jmp 0x2dc69
movl %eax, %ebx
xorl %r14d, %r14d
movq -0xd8(%rbp), %rax
andq $0x0, 0xb0(%rax)
movq %r14, %rdi
callq 0x1d90e
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2dc7a
callq 0x1a82f
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq