// File: /workspace/github_c_makefile_star2_O1/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, 0x4(%rsp)
movq %rdi, %r14
movl 0x20(%rdi), %eax
movl %eax, 0x1c(%rsp)
leaq 0x8(%rsp), %r15
movl %ecx, 0x18(%rsp)
movl %ecx, %ebx
testl %r12d, %r12d
je 0x439ca8
cmpl $0x0, 0x1c(%r14)
je 0x439ca8
movq %r14, %rdi
movl %r12d, %esi
callq 0x43a694
testl %eax, %eax
je 0x439b34
xorl %ebp, %ebp
jmp 0x439c9f
leal -0x1(%rbx), %r13d
movq 0x8(%r14), %rdi
movl %r12d, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq *0x108(%rdi)
testl %eax, %eax
je 0x439b6c
xorl %ebp, %ebp
movq %r14, %rdi
leaq 0x1179da(%rip), %rsi    # 0x551534
movl %r12d, %edx
xorl %eax, %eax
callq 0x439cf7
movl %r13d, %ebx
jmp 0x439c9f
movl %r13d, (%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r15
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x439c11
movzbl 0x4(%r15), %edx
movzbl 0x5(%r15), %edi
movzbl 0x6(%r15), %ebp
movzbl 0x7(%r15), %esi
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x439bcc
movq %rdi, 0x20(%rsp)
movq %r14, %rdi
movl %esi, 0x14(%rsp)
movl %r12d, %esi
movq %rdx, %r13
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x439e07
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %esi
movq %r13, %rdx
shll $0x18, %edx
shll $0x10, %edi
leal (%rdi,%rdx), %r13d
shll $0x8, %ebp
orl %ebp, %r13d
orl %esi, %r13d
movq (%r14), %rax
movl 0x34(%rax), %eax
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x2, %ecx
addl $-0x2, %ecx
cmpl %ecx, %r13d
jle 0x439c39
movq %r14, %rdi
leaq 0x117948(%rip), %rsi    # 0x55154a
movl %r12d, %edx
xorl %eax, %eax
callq 0x439cf7
addl $-0x2, %ebx
jmp 0x439c82
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x439c34
cmpl $0x2, %ebx
jl 0x439c34
movl (%r15), %esi
bswapl %esi
movq %r14, %rdi
movl $0x4, %edx
movl %r12d, %ecx
callq 0x439e07
movl (%rsp), %ebx
jmp 0x439c82
testl %r13d, %r13d
jle 0x439c7c
addl %edi, %edx
addl %esi, %ebp
addl %edx, %ebp
xorl %ebx, %ebx
movl 0x8(%r15,%rbx,4), %r12d
bswapl %r12d
movq (%r14), %rax
cmpb $0x0, 0x21(%rax)
je 0x439c69
movq %r14, %rdi
movl %r12d, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x439e07
movq %r14, %rdi
movl %r12d, %esi
callq 0x43a694
incq %rbx
cmpq %rbx, %rbp
jne 0x439c46
movl (%rsp), %ebx
subl %r13d, %ebx
movl (%r15), %r12d
bswapl %r12d
movq 0x8(%rsp), %rdi
movb $0x1, %bpl
testq %rdi, %rdi
je 0x439c9a
callq 0x41e68a
leaq 0x8(%rsp), %r15
testb %bpl, %bpl
jne 0x439b0a
testl %ebx, %ebx
je 0x439ce8
movl 0x1c(%rsp), %eax
cmpl 0x20(%r14), %eax
jne 0x439ce8
cmpl $0x0, 0x4(%rsp)
leaq 0x1178c9(%rip), %rax    # 0x55158b
leaq 0x11df81(%rip), %rdx    # 0x557c4a
cmoveq %rax, %rdx
movl 0x18(%rsp), %r8d
movl %r8d, %ecx
subl %ebx, %ecx
leaq 0x117893(%rip), %rsi    # 0x551571
movq %r14, %rdi
xorl %eax, %eax
callq 0x439cf7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq