// File: /workspace/github_c_makefile_star2_O3/ukontainer[P]sqlite-bench/sqlite3.c
// Function: checkList
static void checkList(
  IntegrityCk *pCheck,  /* Integrity checking context */
  int isFreeList,       /* True for a freelist.  False for overflow page list */
  int iPage,            /* Page number for first page in the list */
  int N                 /* Expected number of pages in the list */
){
  int i;
  int expected = N;
  int nErrAtStart = pCheck->nErr;
  while( iPage!=0 && pCheck->mxErr ){
    DbPage *pOvflPage;
    unsigned char *pOvflData;
    if( checkRef(pCheck, iPage) ) break;
    N--;
    if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage, 0) ){
      checkAppendMsg(pCheck, "failed to get page %d", iPage);
      break;
    }
    pOvflData = (unsigned char *)sqlite3PagerGetData(pOvflPage);
    if( isFreeList ){
      int n = get4byte(&pOvflData[4]);
#ifndef SQLITE_OMIT_AUTOVACUUM
      if( pCheck->pBt->autoVacuum ){
        checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0);
      }
#endif
      if( n>(int)pCheck->pBt->usableSize/4-2 ){
        checkAppendMsg(pCheck,
           "freelist leaf count too big on page %d", iPage);
        N--;
      }else{
        for(i=0; i<n; i++){
          Pgno iFreePage = get4byte(&pOvflData[8+i*4]);
#ifndef SQLITE_OMIT_AUTOVACUUM
          if( pCheck->pBt->autoVacuum ){
            checkPtrmap(pCheck, iFreePage, PTRMAP_FREEPAGE, 0);
          }
#endif
          checkRef(pCheck, iFreePage);
        }
        N -= n;
      }
    }
#ifndef SQLITE_OMIT_AUTOVACUUM
    else{
      /* If this database supports auto-vacuum and iPage is not the last
      ** page in this overflow list, check that the pointer-map entry for
      ** the following page matches iPage.
      */
      if( pCheck->pBt->autoVacuum && N>0 ){
        i = get4byte(pOvflData);
        checkPtrmap(pCheck, i, PTRMAP_OVERFLOW2, iPage);
      }
    }
#endif
    iPage = get4byte(pOvflData);
    sqlite3PagerUnref(pOvflPage);
  }
  if( N && nErrAtStart==pCheck->nErr ){
    checkAppendMsg(pCheck,
      "%s is %d but should be %d",
      isFreeList ? "size" : "overflow list length",
      expected-N, expected);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl 0x20(%rdi), %eax
movl %eax, 0x8(%rsp)
movl %ecx, (%rsp)
movl %ecx, %r12d
testl %edx, %edx
je 0x438820
movl %edx, %r13d
movl (%rsp), %eax
movl %eax, %r12d
movl %ebx, 0x4(%rsp)
cmpl $0x0, 0x1c(%r14)
je 0x438820
movq %r14, %rdi
movl %r13d, %esi
callq 0x43921b
testl %eax, %eax
jne 0x438804
leal -0x1(%r12), %ebp
movq 0x8(%r14), %rdi
movl %r13d, %esi
leaq 0x10(%rsp), %rdx
xorl %ecx, %ecx
callq *0x108(%rdi)
testl %eax, %eax
jne 0x438809
movq 0x10(%rsp), %rax
movq 0x8(%rax), %r15
testl %ebx, %ebx
je 0x43876a
movl %ebp, 0xc(%rsp)
movq %r12, 0x20(%rsp)
movzbl 0x4(%r15), %ebx
movzbl 0x5(%r15), %esi
movzbl 0x6(%r15), %ebp
movzbl 0x7(%r15), %edx
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x438722
movq %r14, %rdi
movq %rsi, 0x18(%rsp)
movl %r13d, %esi
movl %edx, %r12d
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x43897c
movq 0x18(%rsp), %rsi
movl %r12d, %edx
movq (%r14), %rax
shll $0x18, %ebx
shll $0x10, %esi
leal (%rsi,%rbx), %r12d
shll $0x8, %ebp
orl %ebp, %r12d
orl %edx, %r12d
movl 0x34(%rax), %eax
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x2, %ecx
addl $-0x2, %ecx
cmpl %ecx, %r12d
jle 0x438793
movq %r14, %rdi
leaq 0x118e7d(%rip), %rsi    # 0x5515d2
movl %r13d, %edx
xorl %eax, %eax
callq 0x43886d
movq 0x20(%rsp), %r12
addl $-0x2, %r12d
jmp 0x4387e0
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x43878e
cmpl $0x2, %r12d
jl 0x43878e
movl (%r15), %esi
bswapl %esi
movq %r14, %rdi
movl $0x4, %edx
movl %r13d, %ecx
callq 0x43897c
movl %ebp, %r12d
jmp 0x4387e4
testl %r12d, %r12d
jle 0x4387d6
addl %esi, %ebx
addl %edx, %ebp
addl %ebx, %ebp
xorl %ebx, %ebx
movl 0x8(%r15,%rbx,4), %r13d
bswapl %r13d
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x4387c3
movq %r14, %rdi
movl %r13d, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x43897c
movq %r14, %rdi
movl %r13d, %esi
callq 0x43921b
incq %rbx
cmpq %rbx, %rbp
jne 0x4387a0
movl 0xc(%rsp), %eax
subl %r12d, %eax
movl %eax, %r12d
movl 0x4(%rsp), %ebx
movl (%r15), %r13d
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4387f6
callq 0x41e4ba
bswapl %r13d
testl %r13d, %r13d
jne 0x438687
jmp 0x438820
movl %r12d, %ebp
jmp 0x43881d
leaq 0x118dac(%rip), %rsi    # 0x5515bc
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x43886d
movl %ebp, %r12d
testl %r12d, %r12d
je 0x43885e
movl 0x8(%rsp), %eax
cmpl 0x20(%r14), %eax
jne 0x43885e
testl %ebx, %ebx
leaq 0x118ddb(%rip), %rax    # 0x551613
leaq 0x11f4eb(%rip), %rdx    # 0x557d2a
cmoveq %rax, %rdx
movl (%rsp), %r8d
movl %r8d, %ecx
subl %r12d, %ecx
leaq 0x118da5(%rip), %rsi    # 0x5515f9
movq %r14, %rdi
xorl %eax, %eax
callq 0x43886d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq