// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/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 */
  char *zContext        /* Context for error messages */
){
  int i;
  int expected = N;
  int iFirst = iPage;
  while( N-- > 0 && pCheck->mxErr ){
    DbPage *pOvflPage;
    unsigned char *pOvflData;
    if( iPage<1 ){
      checkAppendMsg(pCheck, zContext,
         "%d of %d pages missing from overflow list starting at %d",
          N+1, expected, iFirst);
      break;
    }
    if( checkRef(pCheck, iPage, zContext) ) break;
    if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage) ){
      checkAppendMsg(pCheck, zContext, "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, zContext);
      }
#endif
      if( n>(int)pCheck->pBt->usableSize/4-2 ){
        checkAppendMsg(pCheck, zContext,
           "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, zContext);
          }
#endif
          checkRef(pCheck, iFreePage, zContext);
        }
        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, zContext);
      }
    }
#endif
    iPage = get4byte(pOvflData);
    sqlite3PagerUnref(pOvflPage);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x14(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x49(%rbp)
jle 0x47838
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x47844
jmp 0x47a24
cmpl $0x1, -0x10(%rbp)
jge 0x47873
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movl -0x28(%rbp), %r8d
movl -0x2c(%rbp), %r9d
leaq 0x673b8(%rip), %rdx     # 0xaec1f
movb $0x0, %al
callq 0x48550
jmp 0x47a24
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x48680
cmpl $0x0, %eax
je 0x4788d
jmp 0x47a24
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x10(%rbp), %esi
leaq -0x38(%rbp), %rdx
xorl %ecx, %ecx
callq 0xe5f0
cmpl $0x0, %eax
je 0x478c6
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x10(%rbp), %ecx
leaq 0x6739e(%rip), %rdx     # 0xaec58
movb $0x0, %al
callq 0x48550
jmp 0x47a24
movq -0x38(%rbp), %rdi
callq 0xec10
movq %rax, -0x40(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x479ce
movq -0x40(%rbp), %rdi
addq $0x4, %rdi
callq 0x20a50
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpb $0x0, 0x21(%rax)
je 0x47911
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
movq -0x20(%rbp), %r8
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x47a30
movl -0x44(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x34(%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x50(%rbp), %eax
subl $0x2, %ecx
cmpl %ecx, %eax
jle 0x47959
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x10(%rbp), %ecx
leaq 0x67327(%rip), %rdx     # 0xaec6e
movb $0x0, %al
callq 0x48550
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x479cc
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x479c1
movq -0x40(%rbp), %rdi
movl -0x24(%rbp), %eax
shll $0x2, %eax
addl $0x8, %eax
cltq
addq %rax, %rdi
callq 0x20a50
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
cmpb $0x0, 0x21(%rax)
je 0x479a6
movq -0x8(%rbp), %rdi
movl -0x48(%rbp), %esi
movq -0x20(%rbp), %r8
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x47a30
movq -0x8(%rbp), %rdi
movl -0x48(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x48680
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x47960
movl -0x44(%rbp), %ecx
movl -0x14(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x14(%rbp)
jmp 0x47a0a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movzbl 0x21(%rax), %eax
cmpl $0x0, %eax
je 0x47a08
cmpl $0x0, -0x14(%rbp)
jle 0x47a08
movq -0x40(%rbp), %rdi
callq 0x20a50
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x10(%rbp), %ecx
movq -0x20(%rbp), %r8
movl $0x4, %edx
callq 0x47a30
jmp 0x47a0a
movq -0x40(%rbp), %rdi
callq 0x20a50
movl %eax, -0x10(%rbp)
movq -0x38(%rbp), %rdi
callq 0xec30
jmp 0x47815
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)