// File: /workspace/github_c_makefile_star2_O2/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 %edx, %r12d
movl %esi, %ebx
movq %rdi, %r14
movl 0x20(%rdi), %eax
movl %eax, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
movl %ecx, %ebp
movl %esi, 0x1c(%rsp)
testl %r12d, %r12d
je 0x4310f1
cmpl $0x0, 0x1c(%r14)
je 0x4310f1
movq %r14, %rdi
movl %r12d, %esi
callq 0x43197c
testl %eax, %eax
jne 0x4310d5
leal -0x1(%rbp), %r13d
movq 0x8(%r14), %rdi
movl %r12d, %esi
leaq 0x20(%rsp), %rdx
xorl %ecx, %ecx
callq *0x108(%rdi)
testl %eax, %eax
jne 0x4310da
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r15
testl %ebx, %ebx
je 0x431037
movq %r15, 0x8(%rsp)
leaq 0x4(%r15), %rdi
callq 0x415e33
movl %eax, %r15d
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x43100a
movq %r14, %rdi
movl %r12d, %esi
pushq $0x2
popq %rdx
xorl %ecx, %ecx
callq 0x431233
movq (%r14), %rax
movl 0x34(%rax), %eax
cltd
pushq $0x4
popq %rcx
idivl %ecx
addl $-0x2, %eax
cmpl %eax, %r15d
jle 0x43105f
movq %r14, %rdi
leaq 0x10e535(%rip), %rsi    # 0x53f55a
movl %r12d, %edx
xorl %eax, %eax
callq 0x43113d
addl $-0x2, %ebp
movl %ebp, %r13d
jmp 0x4310b3
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x4310b8
cmpl $0x2, %ebp
jl 0x4310b8
movq %r15, %rdi
callq 0x415e33
movq %r14, %rdi
movl %eax, %esi
pushq $0x4
popq %rdx
movl %r12d, %ecx
callq 0x431233
jmp 0x4310b8
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %r12
testl %r15d, %r15d
movl $0x0, %ebx
cmovgl %r15d, %ebx
subq $0x1, %rbx
jb 0x4310ac
movq %r12, %rdi
callq 0x415e33
movl %eax, %ebp
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x43109c
movq %r14, %rdi
movl %ebp, %esi
pushq $0x2
popq %rdx
xorl %ecx, %ecx
callq 0x431233
movq %r14, %rdi
movl %ebp, %esi
callq 0x43197c
addq $0x4, %r12
jmp 0x431074
subl %r15d, %r13d
movl 0x1c(%rsp), %ebx
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x415e33
movl %eax, %r12d
movq 0x20(%rsp), %rdi
callq 0x408b67
movl %r13d, %ebp
jmp 0x430f89
movl %ebp, %r13d
jmp 0x4310ee
leaq 0x10e463(%rip), %rsi    # 0x53f544
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x43113d
movl %r13d, %ebp
testl %ebp, %ebp
je 0x43112e
movl 0x18(%rsp), %eax
cmpl 0x20(%r14), %eax
jne 0x43112e
testl %ebx, %ebx
leaq 0x10e493(%rip), %rax    # 0x53f59b
leaq 0x114b5b(%rip), %rdx    # 0x545c6a
cmoveq %rax, %rdx
movl 0x14(%rsp), %r8d
movl %r8d, %ecx
subl %ebp, %ecx
leaq 0x10e45d(%rip), %rsi    # 0x53f581
movq %r14, %rdi
xorl %eax, %eax
callq 0x43113d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq