// File: /workspace/github_c_makefile_star2_O2/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 $0xd8, %rsp
movq %rcx, %r12
andq $0x0, 0x58(%rsp)
movq %rcx, 0x20(%rsp)
xorl %ecx, %ecx
testl %esi, %esi
je 0x24beb7
movl %esi, %ebp
movq %rdi, %rbx
movq %rdx, 0xb8(%rsp)
movq (%rdi), %r15
movq 0x28(%rdi), %r14
movsd 0x30(%rdi), %xmm0
movaps %xmm0, 0xc0(%rsp)
movl 0x38(%r15), %r13d
callq 0x24c475
xorl %ecx, %ecx
testl %eax, %eax
jne 0x24beb7
movq %r13, 0x50(%rsp)
leaq 0x12af51(%rip), %rax    # 0x376d70
movq %rax, 0x28(%rbx)
movl %ebp, 0x30(%rbx)
leaq 0x58(%rsp), %rdx
movq %r15, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x23639b
pushq $-0x1
popq %rcx
movl %ecx, 0x10(%rsp)
testl %eax, %eax
je 0x24be4b
leaq 0x12af31(%rip), %rsi    # 0x376d7a
jmp 0x24be8b
movq %r15, 0x40(%rsp)
movq 0x58(%rsp), %r13
movb (%r13), %r15b
movb $0x0, (%r13)
movq %r13, %rdi
callq 0x23499e
testl %eax, %eax
je 0x24be73
leaq 0x12af2f(%rip), %rsi    # 0x376da0
jmp 0x24be8b
movb %r15b, 0xb(%rsp)
movq %r13, %rdi
callq 0x2468e4
testl %eax, %eax
je 0x24becb
leaq 0x12af3b(%rip), %rsi    # 0x376dc6
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x24bc2c
movq 0x58(%rsp), %rdi
callq 0x2376c6
movq %r14, 0x28(%rbx)
movaps 0xc0(%rsp), %xmm0
movlps %xmm0, 0x30(%rbx)
movl 0x10(%rsp), %ecx
incl %ecx
movl %ecx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x28(%rsp)
movq 0x50(%r13), %rdx
movzbl 0x9(%r13), %edi
leaq 0x12aefc(%rip), %rax    # 0x376ddc
movq %rax, 0x28(%rbx)
leaq (%rdx,%rdi), %rsi
movzbl 0x5(%rdx,%rdi), %eax
shll $0x8, %eax
movzbl 0x6(%rdx,%rdi), %ecx
addl %ecx, %eax
decl %eax
movzwl %ax, %eax
movq %rax, 0x48(%rsp)
movzbl 0x3(%rdx,%rdi), %ecx
shll $0x8, %ecx
movq %rdx, 0x38(%rsp)
movzbl 0x4(%rdx,%rdi), %eax
movq %rcx, 0x80(%rsp)
movq %rax, 0x78(%rsp)
addl %ecx, %eax
movq %r13, 0x30(%rsp)
movzbl 0x8(%r13), %r8d
leal (,%r8,4), %ecx
movq %rdi, 0xb0(%rsp)
movl %edi, %edx
subl %ecx, %edx
leal (%rdx,%rax,2), %eax
addl $-0x2, %eax
movslq %eax, %r14
pushq $0x1
popq %rax
movq %r8, 0xa8(%rsp)
testl %r8d, %r8d
movq %rsi, 0x70(%rsp)
movl %eax, 0x1c(%rsp)
je 0x24bf74
movq 0x58(%rbx), %r12
andl $0x0, (%r12)
pushq $-0x1
popq %rcx
movl %eax, 0x14(%rsp)
jmp 0x24bfc6
leaq 0x8(%rsi), %rdi
callq 0x22fc59
movl %eax, %r13d
movq 0x40(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x24bfa6
leaq 0x12ae64(%rip), %rax    # 0x376df6
movq %rax, 0x28(%rbx)
pushq $0x5
popq %rdx
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %ecx
callq 0x24bd22
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movl %r13d, %esi
movq %r12, %rcx
callq 0x24bdb6
movl %eax, %ecx
xorl %r12d, %r12d
movl $0x0, 0x14(%rsp)
movq 0x48(%rsp), %rax
incl %eax
movl %eax, 0x6c(%rsp)
movq 0x80(%rsp), %rax
movq 0x78(%rsp), %rdx
leal -0x1(%rax,%rdx), %edx
movq 0x38(%rsp), %rax
leaq 0xc(%r14,%rax), %rsi
movq 0x50(%rsp), %rax
leal -0x4(%rax), %edi
addl $-0x5, %eax
movl %eax, 0x64(%rsp)
movq 0x28(%rsp), %r14
movb 0xb(%rsp), %r13b
movl %edi, 0xc(%rsp)
movl %ecx, 0x10(%rsp)
testl %edx, %edx
js 0x24c277
cmpl $0x0, 0x1c(%rbx)
je 0x24c277
movl %edx, 0x18(%rsp)
movl %edx, 0x34(%rbx)
movq %rsi, %r15
movzwl (%rsi), %eax
rolw $0x8, %ax
movzwl %ax, %r14d
cmpl 0x48(%rsp), %r14d
setbe %al
cmpl %edi, %r14d
seta %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x24c082
movl $0x0, 0x1c(%rsp)
movq %rbx, %rdi
leaq 0x12adb7(%rip), %rsi    # 0x376e12
movl %r14d, %edx
movl 0x6c(%rsp), %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x24bc2c
movl 0xc(%rsp), %edi
movl 0x10(%rsp), %ecx
movl 0x18(%rsp), %edx
movq %r15, %rsi
jmp 0x24c1e2
movl %r14d, %esi
addq 0x38(%rsp), %rsi
movq 0x30(%rsp), %r13
movq %r13, %rdi
movq %rsi, 0x88(%rsp)
leaq 0x90(%rsp), %rdx
callq *0x80(%r13)
movzwl 0xa6(%rsp), %eax
addl %r14d, %eax
cmpl 0x50(%rsp), %eax
jbe 0x24c0d8
movl $0x0, 0x1c(%rsp)
movq %rbx, %rdi
leaq 0x12ad64(%rip), %rsi    # 0x376e30
xorl %eax, %eax
callq 0x24bc2c
jmp 0x24c1ce
cmpb $0x0, 0x2(%r13)
je 0x24c12d
movq 0x90(%rsp), %rdx
movq 0x20(%rsp), %rax
cmpl $0x0, 0x14(%rsp)
movq 0x40(%rsp), %r13
je 0x24c245
cmpq %rax, %rdx
jle 0x24c11a
movq %rbx, %rdi
leaq 0x12ad3d(%rip), %rsi    # 0x376e48
xorl %eax, %eax
callq 0x24bc2c
movq 0x90(%rsp), %rdx
movl 0xc(%rsp), %esi
movq %rdx, 0x20(%rsp)
movl $0x0, 0x14(%rsp)
jmp 0x24c136
movq 0x40(%rsp), %r13
movl 0xc(%rsp), %esi
movl 0xa0(%rsp), %eax
movzwl 0xa4(%rsp), %ecx
cmpl %ecx, %eax
jbe 0x24c1a5
addl 0x64(%rsp), %eax
subl %ecx, %eax
xorl %edx, %edx
divl %esi
movl %eax, 0x68(%rsp)
movzwl 0xa6(%rsp), %eax
movq 0x88(%rsp), %rcx
leaq (%rcx,%rax), %rdi
addq $-0x4, %rdi
callq 0x22fc59
cmpb $0x0, 0x21(%r13)
je 0x24c195
movq %rbx, %rdi
movl %eax, %esi
pushq $0x3
popq %rdx
movl %ebp, %ecx
movl %eax, %r13d
callq 0x24bd22
movl %r13d, %eax
movq 0x40(%rsp), %r13
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
movl 0x68(%rsp), %ecx
callq 0x24ba58
movq 0x30(%rsp), %rax
cmpb $0x0, 0x8(%rax)
je 0x24c1f2
movzwl 0xa6(%rsp), %eax
movl %r14d, %ecx
shll $0x10, %ecx
leal (%r14,%rax), %esi
decl %esi
orl %ecx, %esi
movq %r12, %rdi
callq 0x24c4e6
movl 0x10(%rsp), %ecx
movb 0xb(%rsp), %r13b
movl 0x18(%rsp), %edx
movq %r15, %rsi
movl 0xc(%rsp), %edi
decl %edx
addq $-0x2, %rsi
movq 0x28(%rsp), %r14
jmp 0x24c009
movq 0x88(%rsp), %rdi
callq 0x22fc59
movl %eax, %r14d
cmpb $0x0, 0x21(%r13)
je 0x24c219
movq %rbx, %rdi
movl %r14d, %esi
pushq $0x5
popq %rdx
movl %ebp, %ecx
callq 0x24bd22
movq 0x20(%rsp), %rcx
movq %rbx, %rdi
movl %r14d, %esi
leaq 0x20(%rsp), %rdx
callq 0x24bdb6
movl 0x10(%rsp), %ecx
cmpl %ecx, %eax
movb 0xb(%rsp), %r13b
jne 0x24c253
movl $0x0, 0x14(%rsp)
jmp 0x24c1d7
cmpq %rax, %rdx
jge 0x24c101
jmp 0x24c11a
movl %eax, %r14d
movl $0x0, 0x14(%rsp)
movq %rbx, %rdi
leaq 0x12abf8(%rip), %rsi    # 0x376e60
xorl %eax, %eax
callq 0x24bc2c
movl %r14d, %ecx
jmp 0x24c1d7
movq 0x20(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq %rax, (%rcx)
andq $0x0, 0x28(%rbx)
cmpl $0x0, 0x1c(%rsp)
je 0x24c390
cmpl $0x0, 0x1c(%rbx)
jle 0x24be97
movq 0x30(%rsp), %rax
cmpb $0x0, 0x8(%rax)
je 0x24c3f6
movq 0x70(%rsp), %rax
leaq 0x1(%rax), %r13
leaq 0x2(%rax), %r14
movzbl (%r13), %ecx
shll $0x8, %ecx
movzbl (%r14), %eax
orq %rcx, %rax
testq %rax, %rax
je 0x24c303
movq 0x38(%rsp), %rcx
leaq (%rcx,%rax), %r13
leaq (%rcx,%rax), %r14
incq %r14
movzwl 0x1(%r14), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %eax, %edx
shll $0x10, %edx
leal (%rax,%rcx), %esi
decl %esi
orl %edx, %esi
movq %r12, %rdi
callq 0x24c4e6
jmp 0x24c2bd
movl (%r12), %ecx
xorl %r14d, %r14d
pushq $0x1
popq %rax
movq 0x48(%rsp), %r10
testl %ecx, %ecx
je 0x24c39d
movl 0x4(%r12), %esi
movl %ecx, %edx
movl (%r12,%rdx,4), %edi
movl %edi, 0x4(%r12)
orl $-0x1, (%r12,%rdx,4)
decl %ecx
movl %ecx, (%r12)
movl %eax, %edx
leal (%rdx,%rdx), %r8d
cmpl %ecx, %r8d
ja 0x24c374
movl %r8d, %edi
movl (%r12,%rdi,4), %r9d
movl %r8d, %edi
orl $0x1, %edi
cmpl (%r12,%rdi,4), %r9d
cmovbel %r8d, %edi
movl %edx, %edx
movl (%r12,%rdx,4), %r8d
movl (%r12,%rdi,4), %r9d
cmpl %r9d, %r8d
jb 0x24c374
movl %r9d, (%r12,%rdx,4)
movl %r8d, (%r12,%rdi,4)
movl (%r12), %ecx
movl %edi, %edx
jmp 0x24c337
movzwl %r10w, %r13d
movl %esi, %edx
shrl $0x10, %edx
cmpl %edx, %r13d
jae 0x24c3a3
notl %r13d
addl %edx, %r14d
addl %r13d, %r14d
movl %esi, %r10d
jmp 0x24c312
movq 0x30(%rsp), %rax
movb %r13b, (%rax)
jmp 0x24be97
movzwl %r10w, %r13d
jmp 0x24c3bd
leaq 0x12aacf(%rip), %rsi    # 0x376e79
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x24bc2c
cmpl $0x0, (%r12)
jne 0x24c3ec
notl %r13d
movq 0x50(%rsp), %rdx
addl %r13d, %edx
addl %r14d, %edx
movq 0x70(%rsp), %rax
movzbl 0x7(%rax), %ecx
cmpl %ecx, %edx
je 0x24c3ec
leaq 0x12aabf(%rip), %rsi    # 0x376e9e
movq %rbx, %rdi
movl %ebp, %r8d
xorl %eax, %eax
callq 0x24bc2c
movq 0x28(%rsp), %r14
jmp 0x24be97
movq 0x58(%rbx), %r12
andl $0x0, (%r12)
movq 0x80(%rsp), %r15
orl 0x78(%rsp), %r15d
movq 0xa8(%rsp), %rax
shll $0x2, %eax
movq 0xb0(%rsp), %rcx
subq %rax, %rcx
movq 0x38(%rsp), %rax
leaq (%rcx,%rax), %r14
addq $0xb, %r14
testq %r15, %r15
jle 0x24c2b0
movzwl -0x1(%r14,%r15,2), %eax
decq %r15
rolw $0x8, %ax
movzwl %ax, %r13d
movq 0x38(%rsp), %rax
leaq (%rax,%r13), %rsi
movq 0x30(%rsp), %rdi
callq *0x78(%rdi)
movzwl %ax, %eax
movl %r13d, %ecx
shll $0x10, %ecx
leal (%rax,%r13), %esi
decl %esi
orl %ecx, %esi
movq %r12, %rdi
callq 0x24c4e6
jmp 0x24c42f