// File: /workspace/github_c_makefile_star2_O0/skeeto[P]flappy/sqlite3.c
// Function: whereLoopAddOr
static int whereLoopAddOr(WhereLoopBuilder *pBuilder, Bitmask mExtra){
  WhereInfo *pWInfo = pBuilder->pWInfo;
  WhereClause *pWC;
  WhereLoop *pNew;
  WhereTerm *pTerm, *pWCEnd;
  int rc = SQLITE_OK;
  int iCur;
  WhereClause tempWC;
  WhereLoopBuilder sSubBuild;
  WhereOrSet sSum, sCur, sPrev;
  struct SrcList_item *pItem;
  
  pWC = pBuilder->pWC;
  if( pWInfo->wctrlFlags & WHERE_AND_ONLY ) return SQLITE_OK;
  pWCEnd = pWC->a + pWC->nTerm;
  pNew = pBuilder->pNew;
  memset(&sSum, 0, sizeof(sSum));
  pItem = pWInfo->pTabList->a + pNew->iTab;
  if( !HasRowid(pItem->pTab) ) return SQLITE_OK;
  iCur = pItem->iCursor;

  for(pTerm=pWC->a; pTerm<pWCEnd && rc==SQLITE_OK; pTerm++){
    if( (pTerm->eOperator & WO_OR)!=0
     && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 
    ){
      WhereClause * const pOrWC = &pTerm->u.pOrInfo->wc;
      WhereTerm * const pOrWCEnd = &pOrWC->a[pOrWC->nTerm];
      WhereTerm *pOrTerm;
      int once = 1;
      int i, j;
    
      sSubBuild = *pBuilder;
      sSubBuild.pOrderBy = 0;
      sSubBuild.pOrSet = &sCur;

      for(pOrTerm=pOrWC->a; pOrTerm<pOrWCEnd; pOrTerm++){
        if( (pOrTerm->eOperator & WO_AND)!=0 ){
          sSubBuild.pWC = &pOrTerm->u.pAndInfo->wc;
        }else if( pOrTerm->leftCursor==iCur ){
          tempWC.pWInfo = pWC->pWInfo;
          tempWC.pOuter = pWC;
          tempWC.op = TK_AND;
          tempWC.nTerm = 1;
          tempWC.a = pOrTerm;
          sSubBuild.pWC = &tempWC;
        }else{
          continue;
        }
        sCur.n = 0;
#ifndef SQLITE_OMIT_VIRTUALTABLE
        if( IsVirtual(pItem->pTab) ){
          rc = whereLoopAddVirtual(&sSubBuild, mExtra);
        }else
#endif
        {
          rc = whereLoopAddBtree(&sSubBuild, mExtra);
        }
        assert( rc==SQLITE_OK || sCur.n==0 );
        if( sCur.n==0 ){
          sSum.n = 0;
          break;
        }else if( once ){
          whereOrMove(&sSum, &sCur);
          once = 0;
        }else{
          whereOrMove(&sPrev, &sSum);
          sSum.n = 0;
          for(i=0; i<sPrev.n; i++){
            for(j=0; j<sCur.n; j++){
              whereOrInsert(&sSum, sPrev.a[i].prereq | sCur.a[j].prereq,
                            sqlite3LogEstAdd(sPrev.a[i].rRun, sCur.a[j].rRun),
                            sqlite3LogEstAdd(sPrev.a[i].nOut, sCur.a[j].nOut));
            }
          }
        }
      }
      pNew->nLTerm = 1;
      pNew->aLTerm[0] = pTerm;
      pNew->wsFlags = WHERE_MULTI_OR;
      pNew->rSetup = 0;
      pNew->iSortIdx = 0;
      memset(&pNew->u, 0, sizeof(pNew->u));
      for(i=0; rc==SQLITE_OK && i<sSum.n; i++){
        /* TUNING: Multiple by 3.5 for the secondary table lookup */
        pNew->rRun = sSum.a[i].rRun + 18;
        pNew->nOut = sSum.a[i].nOut;
        pNew->prereq = sSum.a[i].prereq;
        rc = whereLoopInsert(pBuilder, pNew);
      }
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x340, %rsp            # imm = 0x340
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x32(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x7f48f
movl $0x0, -0x4(%rbp)
jmp 0x7f9fa
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x290(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x71a0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rax
movq -0x30(%rbp), %rcx
movzbl 0x10(%rcx), %ecx
movslq %ecx, %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x308(%rbp)
movq -0x308(%rbp), %rax
movq 0x20(%rax), %rax
movzbl 0x48(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7f511
movl $0x0, -0x4(%rbp)
jmp 0x7f9fa
movq -0x308(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x40(%rbp), %rcx
movb %al, -0x32d(%rbp)
jae 0x7f549
cmpl $0x0, -0x44(%rbp)
sete %al
movb %al, -0x32d(%rbp)
movb -0x32d(%rbp), %al
testb $0x1, %al
jne 0x7f558
jmp 0x7f9f4
movq -0x38(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x7f9e1
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x1e8(%rax), %rax
movq -0x30(%rbp), %rcx
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
je 0x7f9e1
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x310(%rbp)
movq -0x310(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x310(%rbp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x318(%rbp)
movl $0x1, -0x324(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x258(%rbp), %rdi
movl $0x28, %edx
callq 0x7260
movq $0x0, -0x248(%rbp)
leaq -0x2c8(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x310(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x320(%rbp)
movq -0x320(%rbp), %rax
cmpq -0x318(%rbp), %rax
jae 0x7f8bf
movq -0x320(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x7f649
movq -0x320(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x7f6a7
movq -0x320(%rbp), %rax
movl 0xc(%rax), %eax
cmpl -0x48(%rbp), %eax
jne 0x7f6a0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x230(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x228(%rbp)
movb $0x46, -0x220(%rbp)
movl $0x1, -0x21c(%rbp)
movq -0x320(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0x230(%rbp), %rax
movq %rax, -0x250(%rbp)
jmp 0x7f6a5
jmp 0x7f8a8
jmp 0x7f6a7
movw $0x0, -0x2c8(%rbp)
movq -0x308(%rbp), %rax
movq 0x20(%rax), %rax
movzbl 0x48(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x7f6dc
movq -0x18(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x7e580
movl %eax, -0x44(%rbp)
jmp 0x7f6ef
movq -0x18(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x7ec20
movl %eax, -0x44(%rbp)
movzwl -0x2c8(%rbp), %eax
cmpl $0x0, %eax
jne 0x7f709
movw $0x0, -0x290(%rbp)
jmp 0x7f8bf
cmpl $0x0, -0x324(%rbp)
je 0x7f734
leaq -0x290(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x815c0
movl $0x0, -0x324(%rbp)
jmp 0x7f8a4
leaq -0x300(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x815c0
movw $0x0, -0x290(%rbp)
movl $0x0, -0x328(%rbp)
movl -0x328(%rbp), %eax
movzwl -0x300(%rbp), %ecx
cmpl %ecx, %eax
jge 0x7f8a2
movl $0x0, -0x32c(%rbp)
movl -0x32c(%rbp), %eax
movzwl -0x2c8(%rbp), %ecx
cmpl %ecx, %eax
jge 0x7f88c
leaq -0x300(%rbp), %rax
addq $0x8, %rax
movslq -0x328(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
leaq -0x2c8(%rbp), %rcx
addq $0x8, %rcx
movslq -0x32c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
orq (%rcx), %rax
movq %rax, -0x338(%rbp)
leaq -0x300(%rbp), %rax
addq $0x8, %rax
movslq -0x328(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movw 0x8(%rax), %cx
leaq -0x2c8(%rbp), %rax
addq $0x8, %rax
movslq -0x32c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movswl %cx, %edi
movswl 0x8(%rax), %esi
callq 0x807c0
movw %ax, -0x330(%rbp)
leaq -0x300(%rbp), %rax
addq $0x8, %rax
movslq -0x328(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movw 0xa(%rax), %cx
leaq -0x2c8(%rbp), %rax
addq $0x8, %rax
movslq -0x32c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movswl %cx, %edi
movswl 0xa(%rax), %esi
callq 0x807c0
movq -0x338(%rbp), %rsi
movw -0x330(%rbp), %cx
leaq -0x290(%rbp), %rdi
movswl %cx, %edx
movswl %ax, %ecx
callq 0x80330
movl -0x32c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x32c(%rbp)
jmp 0x7f779
jmp 0x7f88e
movl -0x328(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x328(%rbp)
jmp 0x7f75a
jmp 0x7f8a4
jmp 0x7f8a6
jmp 0x7f8a8
movq -0x320(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x320(%rbp)
jmp 0x7f60c
movq -0x30(%rbp), %rax
movw $0x1, 0x2c(%rax)
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl $0x2000, 0x28(%rax)     # imm = 0x2000
movq -0x30(%rbp), %rax
movw $0x0, 0x12(%rax)
movq -0x30(%rbp), %rax
movb $0x0, 0x11(%rax)
movq -0x30(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x71a0
movl $0x0, -0x328(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x44(%rbp)
movb %al, -0x339(%rbp)
jne 0x7f939
movl -0x328(%rbp), %eax
movzwl -0x290(%rbp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x339(%rbp)
movb -0x339(%rbp), %al
testb $0x1, %al
jne 0x7f948
jmp 0x7f9df
leaq -0x290(%rbp), %rax
addq $0x8, %rax
movslq -0x328(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movswl 0x8(%rax), %eax
addl $0x12, %eax
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, 0x14(%rax)
leaq -0x290(%rbp), %rax
addq $0x8, %rax
movslq -0x328(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movw 0xa(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x16(%rax)
leaq -0x290(%rbp), %rax
addq $0x8, %rax
movslq -0x328(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x80060
movl %eax, -0x44(%rbp)
movl -0x328(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x328(%rbp)
jmp 0x7f913
jmp 0x7f9e1
jmp 0x7f9e3
movq -0x38(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x38(%rbp)
jmp 0x7f52a
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x340, %rsp            # imm = 0x340
popq %rbp
retq
nopw %cs:(%rax,%rax)