// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: whereLoopAddAll
static int whereLoopAddAll(WhereLoopBuilder *pBuilder){
  WhereInfo *pWInfo = pBuilder->pWInfo;
  Bitmask mPrereq = 0;
  Bitmask mPrior = 0;
  int iTab;
  SrcList *pTabList = pWInfo->pTabList;
  struct SrcList_item *pItem;
  struct SrcList_item *pEnd = &pTabList->a[pWInfo->nLevel];
  sqlite3 *db = pWInfo->pParse->db;
  int rc = SQLITE_OK;
  WhereLoop *pNew;

  /* Loop over the tables in the join, from left to right */
  pNew = pBuilder->pNew;
  whereLoopInit(pNew);
  pBuilder->iPlanLimit = SQLITE_QUERY_PLANNER_LIMIT;
  for(iTab=0, pItem=pTabList->a; pItem<pEnd; iTab++, pItem++){
    Bitmask mUnusable = 0;
    pNew->iTab = iTab;
    pBuilder->iPlanLimit += SQLITE_QUERY_PLANNER_LIMIT_INCR;
    pNew->maskSelf = sqlite3WhereGetMask(&pWInfo->sMaskSet, pItem->iCursor);
    if( (pItem->fg.jointype & (JT_LEFT|JT_CROSS))!=0 ){
      /* This condition is true when pItem is the FROM clause term on the
      ** right-hand-side of a LEFT or CROSS JOIN.  */
      mPrereq = mPrior;
    }else{
      mPrereq = 0;
    }
#ifndef SQLITE_OMIT_VIRTUALTABLE
    if( IsVirtual(pItem->pTab) ){
      struct SrcList_item *p;
      for(p=&pItem[1]; p<pEnd; p++){
        if( mUnusable || (p->fg.jointype & (JT_LEFT|JT_CROSS)) ){
          mUnusable |= sqlite3WhereGetMask(&pWInfo->sMaskSet, p->iCursor);
        }
      }
      rc = whereLoopAddVirtual(pBuilder, mPrereq, mUnusable);
    }else
#endif /* SQLITE_OMIT_VIRTUALTABLE */
    {
      rc = whereLoopAddBtree(pBuilder, mPrereq);
    }
    if( rc==SQLITE_OK && pBuilder->pWC->hasOr ){
      rc = whereLoopAddOr(pBuilder, mPrereq, mUnusable);
    }
    mPrior |= pNew->maskSelf;
    if( rc || db->mallocFailed ){
      if( rc==SQLITE_DONE ){
        /* We hit the query planner search limit set by iPlanLimit */
        sqlite3_log(SQLITE_WARNING, "abbreviated query algorithm search");
        rc = SQLITE_OK;
      }else{
        break;
      }
    }
  }

  whereLoopClear(db, pNew);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq -0x10(%rbp), %rcx
movzbl 0x40(%rcx), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x448870
movq -0x8(%rbp), %rax
movl $0x4e20, 0x2c(%rax)     # imm = 0x4E20
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x44934c
movq $0x0, -0x60(%rbp)
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x3e8, %ecx            # imm = 0x3E8
movl %ecx, 0x2c(%rax)
movq -0x10(%rbp), %rdi
addq $0x290, %rdi            # imm = 0x290
movq -0x38(%rbp), %rax
movl 0x40(%rax), %esi
callq 0x44e910
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movzbl 0x3c(%rax), %eax
andl $0xa, %eax
cmpl $0x0, %eax
je 0x449224
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x44922c
movq $0x0, -0x18(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $0x0, 0x54(%rax)
je 0x4492ac
movq -0x38(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x449296
cmpq $0x0, -0x60(%rbp)
jne 0x449267
movq -0x68(%rbp), %rax
movzbl 0x3c(%rax), %eax
andl $0xa, %eax
cmpl $0x0, %eax
je 0x449286
movq -0x10(%rbp), %rdi
addq $0x290, %rdi            # imm = 0x290
movq -0x68(%rbp), %rax
movl 0x40(%rax), %esi
callq 0x44e910
orq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x449288
movq -0x68(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x68(%rbp)
jmp 0x449246
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x450df0
movl %eax, -0x4c(%rbp)
jmp 0x4492bc
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4511d0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0x4492e7
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movzbl 0x11(%rax), %eax
cmpl $0x0, %eax
je 0x4492e7
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x451c70
movl %eax, -0x4c(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
orq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0x44930a
movq -0x48(%rbp), %rax
movzbl 0x61(%rax), %eax
cmpl $0x0, %eax
je 0x449330
cmpl $0x65, -0x4c(%rbp)
jne 0x44932c
movl $0x1c, %edi
leaq 0x164ac7(%rip), %rsi    # 0x5adde3
movb $0x0, %al
callq 0x3c3970
movl $0x0, -0x4c(%rbp)
jmp 0x44932e
jmp 0x44934c
jmp 0x449330
jmp 0x449332
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x38(%rbp)
jmp 0x4491b6
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x452210
movl -0x4c(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)