// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: checkTreePage
static int checkTreePage(
  IntegrityCk *pCheck,  /* Context for the sanity check */
  Pgno iPage,           /* Page number of the page to check */
  i64 *piMinKey,        /* Write minimum integer primary key here */
  i64 maxKey            /* Error if integer primary key greater than this */
){
  MemPage *pPage = 0;      /* The page being analyzed */
  int i;                   /* Loop counter */
  int rc;                  /* Result code from subroutine call */
  int depth = -1, d2;      /* Depth of a subtree */
  int pgno;                /* Page number */
  int nFrag;               /* Number of fragmented bytes on the page */
  int hdr;                 /* Offset to the page header */
  int cellStart;           /* Offset to the start of the cell pointer array */
  int nCell;               /* Number of cells */
  int doCoverageCheck = 1; /* True if cell coverage checking should be done */
  int keyCanBeEqual = 1;   /* True if IPK can be equal to maxKey
                           ** False if IPK must be strictly less than maxKey */
  u8 *data;                /* Page content */
  u8 *pCell;               /* Cell content */
  u8 *pCellIdx;            /* Next element of the cell pointer array */
  BtShared *pBt;           /* The BtShared object that owns pPage */
  u32 pc;                  /* Address of a cell */
  u32 usableSize;          /* Usable size of the page */
  u32 contentOffset;       /* Offset to the start of the cell content area */
  u32 *heap = 0;           /* Min-heap used for checking cell coverage */
  u32 x, prev = 0;         /* Next and previous entry on the min-heap */
  const char *saved_zPfx = pCheck->zPfx;
  int saved_v1 = pCheck->v1;
  int saved_v2 = pCheck->v2;
  u8 savedIsInit = 0;

  /* Check that the page exists
  */
  pBt = pCheck->pBt;
  usableSize = pBt->usableSize;
  if( iPage==0 ) return 0;
  if( checkRef(pCheck, iPage) ) return 0;
  pCheck->zPfx = "Page %u: ";
  pCheck->v1 = iPage;
  if( (rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0 ){
    checkAppendMsg(pCheck,
       "unable to get the page. error code=%d", rc);
    goto end_of_check;
  }

  /* Clear MemPage.isInit to make sure the corruption detection code in
  ** btreeInitPage() is executed.  */
  savedIsInit = pPage->isInit;
  pPage->isInit = 0;
  if( (rc = btreeInitPage(pPage))!=0 ){
    assert( rc==SQLITE_CORRUPT );  /* The only possible error from InitPage */
    checkAppendMsg(pCheck,
                   "btreeInitPage() returns error code %d", rc);
    goto end_of_check;
  }
  if( (rc = btreeComputeFreeSpace(pPage))!=0 ){
    assert( rc==SQLITE_CORRUPT );
    checkAppendMsg(pCheck, "free space corruption", rc);
    goto end_of_check;
  }
  data = pPage->aData;
  hdr = pPage->hdrOffset;

  /* Set up for cell analysis */
  pCheck->zPfx = "On tree page %u cell %d: ";
  contentOffset = get2byteNotZero(&data[hdr+5]);
  assert( contentOffset<=usableSize );  /* Enforced by btreeInitPage() */

  /* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the
  ** number of cells on the page. */
  nCell = get2byte(&data[hdr+3]);
  assert( pPage->nCell==nCell );

  /* EVIDENCE-OF: R-23882-45353 The cell pointer array of a b-tree page
  ** immediately follows the b-tree page header. */
  cellStart = hdr + 12 - 4*pPage->leaf;
  assert( pPage->aCellIdx==&data[cellStart] );
  pCellIdx = &data[cellStart + 2*(nCell-1)];

  if( !pPage->leaf ){
    /* Analyze the right-child page of internal pages */
    pgno = get4byte(&data[hdr+8]);
#ifndef SQLITE_OMIT_AUTOVACUUM
    if( pBt->autoVacuum ){
      pCheck->zPfx = "On page %u at right child: ";
      checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
    }
#endif
    depth = checkTreePage(pCheck, pgno, &maxKey, maxKey);
    keyCanBeEqual = 0;
  }else{
    /* For leaf pages, the coverage check will occur in the same loop
    ** as the other cell checks, so initialize the heap.  */
    heap = pCheck->heap;
    heap[0] = 0;
  }

  /* EVIDENCE-OF: R-02776-14802 The cell pointer array consists of K 2-byte
  ** integer offsets to the cell contents. */
  for(i=nCell-1; i>=0 && pCheck->mxErr; i--){
    CellInfo info;

    /* Check cell size */
    pCheck->v2 = i;
    assert( pCellIdx==&data[cellStart + i*2] );
    pc = get2byteAligned(pCellIdx);
    pCellIdx -= 2;
    if( pc<contentOffset || pc>usableSize-4 ){
      checkAppendMsg(pCheck, "Offset %d out of range %d..%d",
                             pc, contentOffset, usableSize-4);
      doCoverageCheck = 0;
      continue;
    }
    pCell = &data[pc];
    pPage->xParseCell(pPage, pCell, &info);
    if( pc+info.nSize>usableSize ){
      checkAppendMsg(pCheck, "Extends off end of page");
      doCoverageCheck = 0;
      continue;
    }

    /* Check for integer primary key out of range */
    if( pPage->intKey ){
      if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){
        checkAppendMsg(pCheck, "Rowid %lld out of order", info.nKey);
      }
      maxKey = info.nKey;
      keyCanBeEqual = 0;     /* Only the first key on the page may ==maxKey */
    }

    /* Check the content overflow list */
    if( info.nPayload>info.nLocal ){
      u32 nPage;       /* Number of pages on the overflow chain */
      Pgno pgnoOvfl;   /* First page of the overflow chain */
      assert( pc + info.nSize - 4 <= usableSize );
      nPage = (info.nPayload - info.nLocal + usableSize - 5)/(usableSize - 4);
      pgnoOvfl = get4byte(&pCell[info.nSize - 4]);
#ifndef SQLITE_OMIT_AUTOVACUUM
      if( pBt->autoVacuum ){
        checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage);
      }
#endif
      checkList(pCheck, 0, pgnoOvfl, nPage);
    }

    if( !pPage->leaf ){
      /* Check sanity of left child page for internal pages */
      pgno = get4byte(pCell);
#ifndef SQLITE_OMIT_AUTOVACUUM
      if( pBt->autoVacuum ){
        checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
      }
#endif
      d2 = checkTreePage(pCheck, pgno, &maxKey, maxKey);
      keyCanBeEqual = 0;
      if( d2!=depth ){
        checkAppendMsg(pCheck, "Child page depth differs");
        depth = d2;
      }
    }else{
      /* Populate the coverage-checking heap for leaf pages */
      btreeHeapInsert(heap, (pc<<16)|(pc+info.nSize-1));
    }
  }
  *piMinKey = maxKey;

  /* Check for complete coverage of the page
  */
  pCheck->zPfx = 0;
  if( doCoverageCheck && pCheck->mxErr>0 ){
    /* For leaf pages, the min-heap has already been initialized and the
    ** cells have already been inserted.  But for internal pages, that has
    ** not yet been done, so do it now */
    if( !pPage->leaf ){
      heap = pCheck->heap;
      heap[0] = 0;
      for(i=nCell-1; i>=0; i--){
        u32 size;
        pc = get2byteAligned(&data[cellStart+i*2]);
        size = pPage->xCellSize(pPage, &data[pc]);
        btreeHeapInsert(heap, (pc<<16)|(pc+size-1));
      }
    }
    /* Add the freeblocks to the min-heap
    **
    ** EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header
    ** is the offset of the first freeblock, or zero if there are no
    ** freeblocks on the page.
    */
    i = get2byte(&data[hdr+1]);
    while( i>0 ){
      int size, j;
      assert( (u32)i<=usableSize-4 ); /* Enforced by btreeComputeFreeSpace() */
      size = get2byte(&data[i+2]);
      assert( (u32)(i+size)<=usableSize ); /* due to btreeComputeFreeSpace() */
      btreeHeapInsert(heap, (((u32)i)<<16)|(i+size-1));
      /* EVIDENCE-OF: R-58208-19414 The first 2 bytes of a freeblock are a
      ** big-endian integer which is the offset in the b-tree page of the next
      ** freeblock in the chain, or zero if the freeblock is the last on the
      ** chain. */
      j = get2byte(&data[i]);
      /* EVIDENCE-OF: R-06866-39125 Freeblocks are always connected in order of
      ** increasing offset. */
      assert( j==0 || j>i+size );     /* Enforced by btreeComputeFreeSpace() */
      assert( (u32)j<=usableSize-4 ); /* Enforced by btreeComputeFreeSpace() */
      i = j;
    }
    /* Analyze the min-heap looking for overlap between cells and/or
    ** freeblocks, and counting the number of untracked bytes in nFrag.
    **
    ** Each min-heap entry is of the form:    (start_address<<16)|end_address.
    ** There is an implied first entry the covers the page header, the cell
    ** pointer index, and the gap between the cell pointer index and the start
    ** of cell content.
    **
    ** The loop below pulls entries from the min-heap in order and compares
    ** the start_address against the previous end_address.  If there is an
    ** overlap, that means bytes are used multiple times.  If there is a gap,
    ** that gap is added to the fragmentation count.
    */
    nFrag = 0;
    prev = contentOffset - 1;   /* Implied first min-heap entry */
    while( btreeHeapPull(heap,&x) ){
      if( (prev&0xffff)>=(x>>16) ){
        checkAppendMsg(pCheck,
          "Multiple uses for byte %u of page %u", x>>16, iPage);
        break;
      }else{
        nFrag += (x>>16) - (prev&0xffff) - 1;
        prev = x;
      }
    }
    nFrag += usableSize - (prev&0xffff) - 1;
    /* EVIDENCE-OF: R-43263-13491 The total number of bytes in all fragments
    ** is stored in the fifth field of the b-tree page header.
    ** EVIDENCE-OF: R-07161-27322 The one-byte integer at offset 7 gives the
    ** number of fragmented free bytes within the cell content area.
    */
    if( heap[0]==0 && nFrag!=data[hdr+7] ){
      checkAppendMsg(pCheck,
          "Fragmentation of %d bytes reported as %d on page %u",
          nFrag, data[hdr+7], iPage);
    }
  }

end_of_check:
  if( !doCoverageCheck ) pPage->isInit = savedIsInit;
  releasePage(pPage);
  pCheck->zPfx = saved_zPfx;
  pCheck->v1 = saved_v1;
  pCheck->v2 = saved_v2;
  return depth+1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, 0x30(%rsp)
movq $0x0, 0x48(%rsp)
xorl %eax, %eax
testl %esi, %esi
je 0x2b06dd
movq %rcx, 0x8(%rsp)
movq %rdx, 0xc0(%rsp)
movq (%rdi), %rbx
movq 0x28(%rdi), %rax
movq %rax, 0x18(%rsp)
movl 0x30(%rdi), %r14d
movl 0x34(%rdi), %r15d
movl 0x38(%rbx), %r13d
movl %esi, %ebp
movq %rdi, %r12
callq 0x2b0d96
testl %eax, %eax
movl $0x0, %eax
jne 0x2b06dd
movq %r13, 0x50(%rsp)
movl %r15d, 0x70(%rsp)
movl %r14d, 0x74(%rsp)
leaq 0x12fa92(%rip), %rax    # 0x3e009d
movq %rax, 0x28(%r12)
movl %ebp, 0x30(%r12)
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x296bb1
testl %eax, %eax
movq %rbx, %r13
movq %r12, %rbx
je 0x2b0650
leaq 0x12fa70(%rip), %rsi    # 0x3e00a7
xorl %r14d, %r14d
movq %r12, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2b03ec
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r15d, %r15d
jmp 0x2b069c
movl %ebp, 0x14(%rsp)
movq 0x48(%rsp), %r14
movb (%r14), %r15b
movb $0x0, (%r14)
movq %r14, %rdi
callq 0x294e54
testl %eax, %eax
je 0x2b0675
leaq 0x12fa5a(%rip), %rsi    # 0x3e00cd
jmp 0x2b0688
movq %r14, %rdi
callq 0x2aa346
testl %eax, %eax
je 0x2b06ef
leaq 0x12fa6b(%rip), %rsi    # 0x3e00f3
xorl %r14d, %r14d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2b03ec
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %r13
movl %eax, %r12d
testb %r14b, %r14b
movl 0x74(%rsp), %ebp
je 0x2b06b5
movq 0x48(%rsp), %rax
movb %r15b, (%rax)
movq 0x48(%rsp), %rax
testq %rax, %rax
movl 0x70(%rsp), %r14d
je 0x2b06cd
movq 0x70(%rax), %rdi
callq 0x2949b7
movq %r13, 0x28(%rbx)
movl %ebp, 0x30(%rbx)
movl %r14d, 0x34(%rbx)
movl %r12d, %eax
incl %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%r14), %rdx
movzbl 0x9(%r14), %esi
leaq 0x12fa0a(%rip), %rax    # 0x3e0109
movq %rbx, %rdi
movq %rax, 0x28(%rbx)
movzbl 0x5(%rdx,%rsi), %eax
shll $0x8, %eax
movzbl 0x6(%rdx,%rsi), %ecx
leal (%rax,%rcx), %r12d
decl %r12d
movzbl 0x3(%rdx,%rsi), %eax
shll $0x8, %eax
movzbl 0x4(%rdx,%rsi), %ecx
movq %rax, 0x88(%rsp)
movq %rcx, 0x80(%rsp)
addl %ecx, %eax
movq %rax, 0x90(%rsp)
movq %r14, 0x40(%rsp)
movzbl 0x8(%r14), %eax
leal (,%rax,4), %ecx
movq %rsi, %rbp
subq %rcx, %rbp
testl %eax, %eax
movq %rdx, 0x28(%rsp)
movq %rsi, 0x78(%rsp)
movq %r13, 0x98(%rsp)
je 0x2b0789
movq 0x58(%rdi), %r13
movl $0x0, (%r13)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, 0x10(%rsp)
jmp 0x2b07dd
movl %r15d, %r14d
movl 0x8(%rdx,%rsi), %r15d
bswapl %r15d
cmpb $0x0, 0x21(%r13)
je 0x2b07ba
leaq 0x12f981(%rip), %rax    # 0x3e0123
movq %rax, 0x28(%rdi)
movl %r15d, %esi
movl $0x5, %edx
movl 0x14(%rsp), %ecx
callq 0x2b04fc
movq %rbx, %rdi
leaq 0x30(%rsp), %rdx
movl %r15d, %esi
movq 0x8(%rsp), %rcx
callq 0x2b0590
movq %rbx, %rdi
xorl %r13d, %r13d
movl $0x0, 0x10(%rsp)
movl %r14d, %r15d
movl %eax, (%rsp)
addq $0xc, %rbp
movzwl %r12w, %r9d
movq 0x90(%rsp), %rcx
testl %ecx, %ecx
movq 0x50(%rsp), %rdx
movq %r9, 0x8(%rsp)
movq %rbp, 0xa0(%rsp)
je 0x2b0b04
movl %r15d, 0x5c(%rsp)
leal -0x2(%rbp,%rcx,2), %eax
movslq %eax, %r14
leal 0x1(%r9), %eax
movl %eax, 0x6c(%rsp)
addq 0x28(%rsp), %r14
movq 0x88(%rsp), %rax
movq 0x80(%rsp), %rcx
leal (%rax,%rcx), %r15d
decl %r15d
leal -0x4(%rdx), %ebp
leal -0x5(%rdx), %eax
movl %eax, 0x68(%rsp)
movl $0x1, 0x24(%rsp)
movl %ebp, 0x4(%rsp)
cmpl $0x0, 0x1c(%rdi)
je 0x2b0af5
movl %r15d, 0x34(%rdi)
movzwl (%r14), %eax
rolw $0x8, %ax
movzwl %ax, %r12d
cmpl %r9d, %r12d
setbe %al
cmpl %ebp, %r12d
seta %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2b08aa
movl $0x0, 0x24(%rsp)
leaq 0x12f8b3(%rip), %rsi    # 0x3e013f
movl %r12d, %edx
movl 0x6c(%rsp), %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x2b03ec
movq %rbx, %rdi
movq 0x8(%rsp), %r9
jmp 0x2b0ae1
movq %r15, 0x38(%rsp)
movq %r14, %r15
movl %r12d, %esi
addq 0x28(%rsp), %rsi
movq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rsi, %rbp
leaq 0xa8(%rsp), %rdx
callq *0x80(%r14)
movzwl 0xbe(%rsp), %eax
addl %r12d, %eax
cmpl 0x50(%rsp), %eax
jbe 0x2b090b
movl $0x0, 0x24(%rsp)
movq %rbx, %rdi
leaq 0x12f866(%rip), %rsi    # 0x3e015d
xorl %eax, %eax
callq 0x2b03ec
movq %rbx, %rdi
movq 0x8(%rsp), %r9
jmp 0x2b0ad5
cmpb $0x0, 0x2(%r14)
movq %rbx, %rdi
je 0x2b096f
movq 0xa8(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpl $0x0, 0x10(%rsp)
movq 0x8(%rsp), %r9
movq %r15, %r14
je 0x2b0a9f
cmpq %rcx, %rax
jle 0x2b0958
movq 0xa8(%rsp), %rdx
leaq 0x12f82c(%rip), %rsi    # 0x3e0175
xorl %eax, %eax
callq 0x2b03ec
movq %rbx, %rdi
movq 0x8(%rsp), %r9
movq 0xa8(%rsp), %rax
movq %rax, 0x30(%rsp)
movl $0x0, 0x10(%rsp)
jmp 0x2b0977
movq 0x8(%rsp), %r9
movq %r15, %r14
movl 0xb8(%rsp), %eax
movzwl 0xbc(%rsp), %ecx
cmpl %ecx, %eax
jbe 0x2b09e6
addl 0x68(%rsp), %eax
subl %ecx, %eax
xorl %edx, %edx
divl 0x4(%rsp)
movl %eax, %ecx
movzwl 0xbe(%rsp), %eax
movl -0x4(%rbp,%rax), %edx
bswapl %edx
movq 0x98(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x2b09d7
movl %edx, %esi
movl %edx, 0x60(%rsp)
movl $0x3, %edx
movl %ecx, 0x64(%rsp)
movl 0x14(%rsp), %ecx
callq 0x2b04fc
movl 0x60(%rsp), %edx
movl 0x64(%rsp), %ecx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2b01d9
movq %rbx, %rdi
movq 0x8(%rsp), %r9
movq 0x40(%rsp), %rax
cmpb $0x0, 0x8(%rax)
je 0x2b0a52
movzwl 0xbe(%rsp), %eax
movl %r12d, %ecx
shll $0x10, %ecx
leal (%r12,%rax), %edx
decl %edx
orl %ecx, %edx
movl (%r13), %eax
incl %eax
movl %eax, (%r13)
movl %edx, (%r13,%rax,4)
cmpl $0x2, %eax
jb 0x2b0ad8
movq 0x38(%rsp), %r15
movl 0x4(%rsp), %ebp
movl %eax, %ecx
shrl %eax
movl (%r13,%rax,4), %edx
movl (%r13,%rcx,4), %esi
cmpl %esi, %edx
jbe 0x2b0ae1
movl %esi, (%r13,%rax,4)
movl %edx, (%r13,%rcx,4)
cmpl $0x3, %ecx
ja 0x2b0a28
jmp 0x2b0ae1
movl (%rbp), %r12d
bswapl %r12d
movq 0x98(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x2b0a7b
movl %r12d, %esi
movl $0x5, %edx
movl 0x14(%rsp), %ecx
callq 0x2b04fc
movq %rbx, %rdi
movq 0x30(%rsp), %rcx
movl %r12d, %esi
leaq 0x30(%rsp), %rdx
movq %rdi, %r14
callq 0x2b0590
cmpl (%rsp), %eax
jne 0x2b0aad
movl $0x0, 0x10(%rsp)
jmp 0x2b0acd
cmpq %rcx, %rax
jge 0x2b093a
jmp 0x2b0958
movl %eax, %r12d
movl $0x0, 0x10(%rsp)
movq %r14, %rdi
leaq 0x12f6cb(%rip), %rsi    # 0x3e018d
xorl %eax, %eax
callq 0x2b03ec
movl %r12d, (%rsp)
movq 0x8(%rsp), %r9
movq %r14, %rdi
movq %r15, %r14
movq 0x38(%rsp), %r15
movl 0x4(%rsp), %ebp
addq $-0x2, %r14
leal -0x1(%r15), %eax
testl %r15d, %r15d
movl %eax, %r15d
jg 0x2b0850
cmpl $0x0, 0x24(%rsp)
sete %al
movl 0x5c(%rsp), %r15d
jmp 0x2b0b06
xorl %eax, %eax
movq 0x30(%rsp), %rcx
movq 0xc0(%rsp), %rdx
movq %rcx, (%rdx)
movq $0x0, 0x28(%rdi)
movb $0x1, %r14b
testb %al, %al
jne 0x2b0d3f
cmpl $0x0, 0x1c(%rdi)
movl (%rsp), %eax
movq 0x90(%rsp), %rcx
jle 0x2b0d12
movq 0x40(%rsp), %rax
cmpb $0x0, 0x8(%rax)
movq 0x28(%rsp), %r8
jne 0x2b0c04
movq 0x58(%rdi), %r13
movl $0x0, (%r13)
testl %ecx, %ecx
je 0x2b0c04
movq 0x88(%rsp), %rax
orl 0x80(%rsp), %eax
addq %r8, 0xa0(%rsp)
movq %rax, %r12
movq 0xa0(%rsp), %rcx
movzwl -0x2(%rcx,%rax,2), %eax
rolw $0x8, %ax
movzwl %ax, %r14d
movq 0x28(%rsp), %rax
leaq (%rax,%r14), %rsi
movq 0x40(%rsp), %rdi
callq *0x78(%rdi)
movzwl %ax, %eax
movl %r14d, %ecx
shll $0x10, %ecx
leal (%r14,%rax), %edx
decl %edx
orl %ecx, %edx
movl (%r13), %eax
incl %eax
movl %eax, (%r13)
movl %edx, (%r13,%rax,4)
cmpl $0x2, %eax
jb 0x2b0bec
movl %eax, %ecx
shrl %eax
movl (%r13,%rax,4), %edx
movl (%r13,%rcx,4), %esi
cmpl %esi, %edx
jbe 0x2b0bec
movl %esi, (%r13,%rax,4)
movl %edx, (%r13,%rcx,4)
cmpl $0x3, %ecx
ja 0x2b0bcb
leaq -0x1(%r12), %rax
cmpq $0x1, %r12
jg 0x2b0b7d
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %r9
movq %rbx, %rdi
movq 0x78(%rsp), %rax
movzwl 0x1(%r8,%rax), %eax
rolw $0x8, %ax
testw %ax, %ax
je 0x2b0c7c
movzwl %ax, %ecx
movl %ecx, %eax
movzwl 0x2(%r8,%rax), %edx
rolw $0x8, %dx
movzwl %dx, %edx
movl %ecx, %esi
shll $0x10, %esi
addl %ecx, %edx
decl %edx
orl %esi, %edx
movl (%r13), %ecx
incl %ecx
movl %ecx, (%r13)
movl %edx, (%r13,%rcx,4)
cmpl $0x2, %ecx
jb 0x2b0c6b
movl %ecx, %edx
shrl %ecx
movl (%r13,%rcx,4), %esi
movl (%r13,%rdx,4), %r10d
cmpl %r10d, %esi
jbe 0x2b0c6b
movl %r10d, (%r13,%rcx,4)
movl %esi, (%r13,%rdx,4)
cmpl $0x3, %edx
ja 0x2b0c49
movzwl (%r8,%rax), %eax
rolw $0x8, %ax
movzwl %ax, %ecx
testw %cx, %cx
jne 0x2b0c1b
xorl %r14d, %r14d
movl (%r13), %ecx
testq %rcx, %rcx
je 0x2b0cf0
movl 0x4(%r13), %eax
movl (%r13,%rcx,4), %edx
movl %edx, 0x4(%r13)
movl $0xffffffff, (%r13,%rcx,4) # imm = 0xFFFFFFFF
leal -0x1(%rcx), %edx
movl %edx, (%r13)
cmpl $0x3, %ecx
jb 0x2b0cf0
movl $0x1, %edx
movl $0x2, %esi
movl %edx, %r10d
movl %esi, %edx
movl (%r13,%rdx,4), %r8d
movl %esi, %edx
orl $0x1, %edx
cmpl (%r13,%rdx,4), %r8d
cmovbel %esi, %edx
movl %r10d, %esi
movl (%r13,%rsi,4), %r10d
movl (%r13,%rdx,4), %r8d
cmpl %r8d, %r10d
jb 0x2b0cf0
movl %r8d, (%r13,%rsi,4)
movl %r10d, (%r13,%rdx,4)
leal (%rdx,%rdx), %esi
cmpl (%r13), %esi
jbe 0x2b0cb4
testq %rcx, %rcx
je 0x2b0d35
movzwl %r9w, %ecx
movl %eax, %edx
shrl $0x10, %edx
cmpl %edx, %ecx
jae 0x2b0d1a
notl %ecx
addl %edx, %r14d
addl %ecx, %r14d
movl %eax, %r9d
jmp 0x2b0c7f
xorl %r14d, %r14d
jmp 0x2b069c
leaq 0x12f485(%rip), %rsi    # 0x3e01a6
movl 0x14(%rsp), %ecx
xorl %eax, %eax
movq %r9, %r12
callq 0x2b03ec
movq %rbx, %rdi
movq %r12, %r9
cmpl $0x0, (%r13)
je 0x2b0d4c
xorl %r14d, %r14d
movq 0x18(%rsp), %r13
movl (%rsp), %eax
jmp 0x2b06a1
notl %r9d
orl $0xffff0000, %r9d       # imm = 0xFFFF0000
movq 0x50(%rsp), %rdx
addl %r9d, %edx
addl %r14d, %edx
movq 0x78(%rsp), %rax
movq 0x28(%rsp), %rcx
movzbl 0x7(%rcx,%rax), %ecx
cmpl %ecx, %edx
movq 0x18(%rsp), %r13
jne 0x2b0d7e
xorl %r14d, %r14d
jmp 0x2b0d44
leaq 0x12f446(%rip), %rsi    # 0x3e01cb
xorl %r14d, %r14d
movl 0x14(%rsp), %r8d
xorl %eax, %eax
callq 0x2b03ec
jmp 0x2b0d44