// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: whereLoopAddBtree
static int whereLoopAddBtree(
  WhereLoopBuilder *pBuilder, /* WHERE clause information */
  Bitmask mPrereq             /* Extra prerequesites for using this table */
){
  WhereInfo *pWInfo;          /* WHERE analysis context */
  Index *pProbe;              /* An index we are evaluating */
  Index sPk;                  /* A fake index object for the primary key */
  LogEst aiRowEstPk[2];       /* The aiRowLogEst[] value for the sPk index */
  i16 aiColumnPk = -1;        /* The aColumn[] value for the sPk index */
  SrcList *pTabList;          /* The FROM clause */
  struct SrcList_item *pSrc;  /* The FROM clause btree term to add */
  WhereLoop *pNew;            /* Template WhereLoop object */
  int rc = SQLITE_OK;         /* Return code */
  int iSortIdx = 1;           /* Index number */
  int b;                      /* A boolean value */
  LogEst rSize;               /* number of rows in the table */
  LogEst rLogSize;            /* Logarithm of the number of rows in the table */
  WhereClause *pWC;           /* The parsed WHERE clause */
  Table *pTab;                /* Table being queried */

  pNew = pBuilder->pNew;
  pWInfo = pBuilder->pWInfo;
  pTabList = pWInfo->pTabList;
  pSrc = pTabList->a + pNew->iTab;
  pTab = pSrc->pTab;
  pWC = pBuilder->pWC;
  assert( !IsVirtual(pSrc->pTab) );

  if( pSrc->pIBIndex ){
    /* An INDEXED BY clause specifies a particular index to use */
    pProbe = pSrc->pIBIndex;
  }else if( !HasRowid(pTab) ){
    pProbe = pTab->pIndex;
  }else{
    /* There is no INDEXED BY clause.  Create a fake Index object in local
    ** variable sPk to represent the rowid primary key index.  Make this
    ** fake index the first in a chain of Index objects with all of the real
    ** indices to follow */
    Index *pFirst;                  /* First of real indices on the table */
    memset(&sPk, 0, sizeof(Index));
    sPk.nKeyCol = 1;
    sPk.nColumn = 1;
    sPk.aiColumn = &aiColumnPk;
    sPk.aiRowLogEst = aiRowEstPk;
    sPk.onError = OE_Replace;
    sPk.pTable = pTab;
    sPk.szIdxRow = pTab->szTabRow;
    sPk.idxType = SQLITE_IDXTYPE_IPK;
    aiRowEstPk[0] = pTab->nRowLogEst;
    aiRowEstPk[1] = 0;
    pFirst = pSrc->pTab->pIndex;
    if( pSrc->fg.notIndexed==0 ){
      /* The real indices of the table are only considered if the
      ** NOT INDEXED qualifier is omitted from the FROM clause */
      sPk.pNext = pFirst;
    }
    pProbe = &sPk;
  }
  rSize = pTab->nRowLogEst;
  rLogSize = estLog(rSize);

#ifndef SQLITE_OMIT_AUTOMATIC_INDEX
  /* Automatic indexes */
  if( !pBuilder->pOrSet      /* Not part of an OR optimization */
   && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0
   && (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
   && pSrc->pIBIndex==0      /* Has no INDEXED BY clause */
   && !pSrc->fg.notIndexed   /* Has no NOT INDEXED clause */
   && HasRowid(pTab)         /* Not WITHOUT ROWID table. (FIXME: Why not?) */
   && !pSrc->fg.isCorrelated /* Not a correlated subquery */
   && !pSrc->fg.isRecursive  /* Not a recursive common table expression. */
  ){
    /* Generate auto-index WhereLoops */
    WhereTerm *pTerm;
    WhereTerm *pWCEnd = pWC->a + pWC->nTerm;
    for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
      if( pTerm->prereqRight & pNew->maskSelf ) continue;
      if( termCanDriveIndex(pTerm, pSrc, 0) ){
        pNew->u.btree.nEq = 1;
        pNew->nSkip = 0;
        pNew->u.btree.pIndex = 0;
        pNew->nLTerm = 1;
        pNew->aLTerm[0] = pTerm;
        /* TUNING: One-time cost for computing the automatic index is
        ** estimated to be X*N*log2(N) where N is the number of rows in
        ** the table being indexed and where X is 7 (LogEst=28) for normal
        ** tables or 0.5 (LogEst=-10) for views and subqueries.  The value
        ** of X is smaller for views and subqueries so that the query planner
        ** will be more aggressive about generating automatic indexes for
        ** those objects, since there is no opportunity to add schema
        ** indexes on subqueries and views. */
        pNew->rSetup = rLogSize + rSize;
        if( pTab->pSelect==0 && (pTab->tabFlags & TF_Ephemeral)==0 ){
          pNew->rSetup += 28;
        }else{
          pNew->rSetup -= 10;
        }
        ApplyCostMultiplier(pNew->rSetup, pTab->costMult);
        if( pNew->rSetup<0 ) pNew->rSetup = 0;
        /* TUNING: Each index lookup yields 20 rows in the table.  This
        ** is more than the usual guess of 10 rows, since we have no way
        ** of knowing how selective the index will ultimately be.  It would
        ** not be unreasonable to make this value much larger. */
        pNew->nOut = 43;  assert( 43==sqlite3LogEst(20) );
        pNew->rRun = sqlite3LogEstAdd(rLogSize,pNew->nOut);
        pNew->wsFlags = WHERE_AUTO_INDEX;
        pNew->prereq = mPrereq | pTerm->prereqRight;
        rc = whereLoopInsert(pBuilder, pNew);
      }
    }
  }
#endif /* SQLITE_OMIT_AUTOMATIC_INDEX */

  /* Loop over all indices. If there was an INDEXED BY clause, then only
  ** consider index pProbe.  */
  for(; rc==SQLITE_OK && pProbe;
      pProbe=(pSrc->pIBIndex ? 0 : pProbe->pNext), iSortIdx++
  ){
    int isLeft = (pSrc->fg.jointype & JT_OUTER)!=0;
    if( pProbe->pPartIdxWhere!=0
     && !whereUsablePartialIndex(pSrc->iCursor, isLeft, pWC,
                                 pProbe->pPartIdxWhere)
    ){
      testcase( pNew->iTab!=pSrc->iCursor );  /* See ticket [98d973b8f5] */
      continue;  /* Partial index inappropriate for this query */
    }
    if( pProbe->bNoQuery ) continue;
    rSize = pProbe->aiRowLogEst[0];
    pNew->u.btree.nEq = 0;
    pNew->u.btree.nBtm = 0;
    pNew->u.btree.nTop = 0;
    pNew->nSkip = 0;
    pNew->nLTerm = 0;
    pNew->iSortIdx = 0;
    pNew->rSetup = 0;
    pNew->prereq = mPrereq;
    pNew->nOut = rSize;
    pNew->u.btree.pIndex = pProbe;
    b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor);

    /* The ONEPASS_DESIRED flags never occurs together with ORDER BY */
    assert( (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || b==0 );
    if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){
      /* Integer primary key index */
      pNew->wsFlags = WHERE_IPK;

      /* Full table scan */
      pNew->iSortIdx = b ? iSortIdx : 0;
      /* TUNING: Cost of full table scan is (N*3.0). */
      pNew->rRun = rSize + 16;
      ApplyCostMultiplier(pNew->rRun, pTab->costMult);
      whereLoopOutputAdjust(pWC, pNew, rSize);
      rc = whereLoopInsert(pBuilder, pNew);
      pNew->nOut = rSize;
      if( rc ) break;
    }else{
      Bitmask m;
      if( pProbe->isCovering ){
        pNew->wsFlags = WHERE_IDX_ONLY | WHERE_INDEXED;
        m = 0;
      }else{
        m = pSrc->colUsed & pProbe->colNotIdxed;
        pNew->wsFlags = (m==0) ? (WHERE_IDX_ONLY|WHERE_INDEXED) : WHERE_INDEXED;
      }

      /* Full scan via index */
      if( b
       || !HasRowid(pTab)
       || pProbe->pPartIdxWhere!=0
       || pSrc->fg.isIndexedBy
       || ( m==0
         && pProbe->bUnordered==0
         && (pProbe->szIdxRow<pTab->szTabRow)
         && (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0
         && sqlite3GlobalConfig.bUseCis
         && OptimizationEnabled(pWInfo->pParse->db, SQLITE_CoverIdxScan)
          )
      ){
        pNew->iSortIdx = b ? iSortIdx : 0;

        /* The cost of visiting the index rows is N*K, where K is
        ** between 1.1 and 3.0, depending on the relative sizes of the
        ** index and table rows. */
        pNew->rRun = rSize + 1 + (15*pProbe->szIdxRow)/pTab->szTabRow;
        if( m!=0 ){
          /* If this is a non-covering index scan, add in the cost of
          ** doing table lookups.  The cost will be 3x the number of
          ** lookups.  Take into account WHERE clause terms that can be
          ** satisfied using just the index, and that do not require a
          ** table lookup. */
          LogEst nLookup = rSize + 16;  /* Base cost:  N*3 */
          int ii;
          int iCur = pSrc->iCursor;
          WhereClause *pWC2 = &pWInfo->sWC;
          for(ii=0; ii<pWC2->nTerm; ii++){
            WhereTerm *pTerm = &pWC2->a[ii];
            if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){
              break;
            }
            /* pTerm can be evaluated using just the index.  So reduce
            ** the expected number of table lookups accordingly */
            if( pTerm->truthProb<=0 ){
              nLookup += pTerm->truthProb;
            }else{
              nLookup--;
              if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19;
            }
          }

          pNew->rRun = sqlite3LogEstAdd(pNew->rRun, nLookup);
        }
        ApplyCostMultiplier(pNew->rRun, pTab->costMult);
        whereLoopOutputAdjust(pWC, pNew, rSize);
        rc = whereLoopInsert(pBuilder, pNew);
        pNew->nOut = rSize;
        if( rc ) break;
      }
    }

    pBuilder->bldFlags1 = 0;
    rc = whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, 0);
    if( pBuilder->bldFlags1==SQLITE_BLDF1_INDEXED ){
      /* If a non-unique index is used, or if a prefix of the key for
      ** unique index is used (making the index functionally non-unique)
      ** then the sqlite_stat1 data becomes important for scoring the
      ** plan */
      pTab->tabFlags |= TF_StatsUsed;
    }
#ifdef SQLITE_ENABLE_STAT4
    sqlite3Stat4ProbeFree(pBuilder->pRec);
    pBuilder->nRecValid = 0;
    pBuilder->pRec = 0;
#endif
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, 0x58(%rsp)
movq %rdi, %r14
movw $0xffff, 0x36(%rsp)     # imm = 0xFFFF
movq 0x18(%rdi), %r15
movq (%rdi), %rax
movq %rax, 0x50(%rsp)
movq 0x8(%rax), %rax
movzbl 0x10(%r15), %ecx
imulq $0x70, %rcx, %rcx
leaq (%rax,%rcx), %r12
addq $0x8, %r12
movq 0x20(%r12), %rdx
movq 0x68(%r12), %r13
testq %r13, %r13
jne 0x2e3a7b
testb $-0x80, 0x40(%rdx)
jne 0x2e3a77
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %r13
movaps %xmm0, 0x50(%r13)
movaps %xmm0, 0x60(%r13)
movaps %xmm0, (%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, 0x40(%r13)
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x20(%r13)
movw $0x1, %ax
movw %ax, 0x5e(%r13)
movw %ax, 0x60(%r13)
leaq 0x36(%rsp), %rax
movq %rax, 0x8(%r13)
leaq 0x6c(%rsp), %rax
movq %rax, 0x10(%r13)
movb $0x5, 0x62(%r13)
movq %rdx, 0x18(%r13)
movzwl 0x4c(%rdx), %ecx
movw %cx, 0x5c(%r13)
orb $0x3, 0x63(%r13)
movzwl 0x4a(%rdx), %ecx
movw %cx, (%rax)
movw $0x0, 0x2(%rax)
testb $0x1, 0x3d(%r12)
jne 0x2e3a7b
movq 0x20(%r12), %rax
movq 0x10(%rax), %rax
movq %rax, 0x98(%rsp)
jmp 0x2e3a7b
movq 0x10(%rdx), %r13
movq 0x8(%r14), %rax
movq %rax, 0x48(%rsp)
movq %rdx, 0x38(%rsp)
movswq 0x4a(%rdx), %rbp
xorl %ebx, %ebx
movl $0x0, %eax
cmpq $0xb, %rbp
jl 0x2e3aa6
movq %rbp, %rdi
callq 0x2a680d
addl $-0x21, %eax
cmpq $0x0, 0x20(%r14)
movq %r14, 0x20(%rsp)
movq %r15, 0x10(%rsp)
movq %r12, 0x28(%rsp)
jne 0x2e3c33
movq 0x50(%rsp), %rcx
testb $0x20, 0x3c(%rcx)
jne 0x2e3c33
movq (%rcx), %rcx
movq (%rcx), %rcx
testb $-0x80, 0x31(%rcx)
je 0x2e3c33
cmpq $0x0, 0x68(%r12)
jne 0x2e3c33
movb 0x3d(%r12), %cl
testb $0x1, %cl
jne 0x2e3c33
testb $0x28, %cl
jne 0x2e3c33
movl $0x80, %ecx
movq 0x38(%rsp), %rdx
andl 0x40(%rdx), %ecx
jne 0x2e3c33
movq 0x48(%rsp), %rcx
movslq 0x14(%rcx), %r14
testq %r14, %r14
jle 0x2e3c33
movq 0x48(%rsp), %rcx
movq 0x20(%rcx), %r12
shlq $0x6, %r14
addq %r12, %r14
leal (%rax,%rbp), %r15d
leal (%rax,%rbp), %ecx
addl $-0xa, %ecx
movl %ecx, 0x1c(%rsp)
leal (%rax,%rbp), %ecx
addl $0x1c, %ecx
movl %ecx, 0x40(%rsp)
addq $0x40, %r12
cwtl
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movl $0x0, %ebx
testq %rax, -0x10(%r12)
jne 0x2e3c1e
leaq -0x40(%r12), %rbp
xorl %ebx, %ebx
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
xorl %edx, %edx
callq 0x2e4ece
testl %eax, %eax
je 0x2e3c1e
movq 0x10(%rsp), %rcx
movw $0x1, 0x18(%rcx)
movq $0x0, 0x20(%rcx)
movl $0x1, 0x2c(%rcx)
movq 0x38(%rcx), %rax
movq %rbp, (%rax)
movw %r15w, 0x12(%rcx)
movq 0x38(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2e3bcb
testb $0x2, 0x40(%rax)
movl 0x40(%rsp), %eax
je 0x2e3bcf
movl 0x1c(%rsp), %eax
testw %ax, %ax
movl $0x0, %ecx
cmovgl %eax, %ecx
movq 0x10(%rsp), %rbx
movw %cx, 0x12(%rbx)
movw $0x2b, 0x16(%rbx)
movl 0xc(%rsp), %edi
movl $0x2b, %esi
callq 0x2dc90b
movw %ax, 0x14(%rbx)
movl $0x4000, 0x28(%rbx)     # imm = 0x4000
movq -0x10(%r12), %rax
orq 0x58(%rsp), %rax
movq %rax, (%rbx)
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x2e4a10
movl %eax, %ebx
testl %ebx, %ebx
jne 0x2e3c33
leaq 0x40(%r12), %rax
cmpq %r14, %r12
movq %rax, %r12
jb 0x2e3b58
testl %ebx, %ebx
jne 0x2e407c
testq %r13, %r13
movq 0x20(%rsp), %r14
movq 0x10(%rsp), %r15
movq 0x28(%rsp), %r12
je 0x2e407c
movl $0x1, 0xc(%rsp)
movq 0x48(%r13), %rcx
testq %rcx, %rcx
je 0x2e3c86
movl 0x3c(%r12), %esi
movl 0x40(%r12), %edi
shrl $0x5, %esi
andl $0x1, %esi
movq 0x48(%rsp), %rdx
callq 0x2e4f1e
testl %eax, %eax
je 0x2e3de3
testb $0x1, 0x64(%r13)
jne 0x2e3de3
movq 0x10(%r13), %rax
movzwl (%rax), %ecx
xorl %eax, %eax
movl %eax, 0x18(%r15)
movw %ax, 0x1c(%r15)
movl %eax, 0x2c(%r15)
movb $0x0, 0x11(%r15)
movw %ax, 0x12(%r15)
movq 0x58(%rsp), %rax
movq %rax, (%r15)
movq %rcx, 0x40(%rsp)
movw %cx, 0x16(%r15)
movq %r13, 0x20(%r15)
movb $0x1, %dl
testb $0x4, 0x63(%r13)
jne 0x2e3e2f
movq (%r14), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x2e3e2f
cmpl $0x0, (%rax)
jle 0x2e3e2f
movl 0x40(%r12), %ecx
movl %ecx, 0x1c(%rsp)
leaq 0x8(%rax), %rcx
movq %rcx, 0x60(%rsp)
xorl %r12d, %r12d
movq %rax, %r14
leaq (%r12,%r12,2), %rax
movq 0x60(%rsp), %rcx
movq (%rcx,%rax,8), %rbp
testq %rbp, %rbp
je 0x2e3d3b
movl 0x4(%rbp), %eax
testl $0x41000, %eax          # imm = 0x41000
je 0x2e3d3b
btl $0x12, %eax
jb 0x2e3d2d
addq $0x10, %rbp
jmp 0x2e3d35
movq 0x20(%rbp), %rbp
addq $0x8, %rbp
movq (%rbp), %rbp
jmp 0x2e3d12
cmpb $-0x5c, (%rbp)
jne 0x2e3d7b
movl 0x1c(%rsp), %eax
cmpl %eax, 0x2c(%rbp)
jne 0x2e3d7b
movzwl 0x30(%rbp), %eax
testw %ax, %ax
js 0x2e3e1e
movzwl 0x5e(%r13), %ecx
testq %rcx, %rcx
je 0x2e3dc1
movq 0x8(%r13), %rdx
xorl %esi, %esi
cmpw (%rdx,%rsi,2), %ax
je 0x2e3e1e
incq %rsi
cmpq %rsi, %rcx
jne 0x2e3d67
jmp 0x2e3dc1
movq 0x50(%r13), %r15
testq %r15, %r15
je 0x2e3dc1
cmpw $0x0, 0x5e(%r13)
je 0x2e3dc1
addq $0x8, %r15
xorl %ebx, %ebx
movq 0x8(%r13), %rax
cmpw $-0x2, (%rax,%rbx,2)
jne 0x2e3db0
movq (%r15), %rsi
movq %rbp, %rdi
movl 0x1c(%rsp), %edx
callq 0x2e2f38
testl %eax, %eax
je 0x2e3e1e
incq %rbx
movzwl 0x5e(%r13), %eax
addq $0x18, %r15
cmpq %rax, %rbx
jb 0x2e3d92
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x2e3d05
movq 0x20(%rsp), %r14
movq 0x10(%rsp), %r15
movq 0x28(%rsp), %r12
movb $0x1, %dl
jmp 0x2e3e2f
xorl %ebx, %ebx
movl $0x7, %ebp
cmpl $0x5, %ebp
je 0x2e407c
cmpq $0x0, 0x68(%r12)
je 0x2e3e00
xorl %r13d, %r13d
jmp 0x2e3e04
movq 0x28(%r13), %r13
testl %ebx, %ebx
jne 0x2e407c
incl 0xc(%rsp)
testq %r13, %r13
jne 0x2e3c5b
jmp 0x2e407c
xorl %edx, %edx
movq 0x20(%rsp), %r14
movq 0x10(%rsp), %r15
movq 0x28(%rsp), %r12
movzwl 0x63(%r13), %eax
movl %eax, %ecx
notl %ecx
testb $0x3, %cl
jne 0x2e3e98
testb %dl, %dl
movl 0xc(%rsp), %eax
movl $0x0, %ecx
cmovnel %ecx, %eax
movl $0x100, 0x28(%r15)      # imm = 0x100
movb %al, 0x11(%r15)
movq 0x40(%rsp), %rbp
leal 0x10(%rbp), %eax
movw %ax, 0x14(%r15)
movswl %bp, %edx
movq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x2e4fe2
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e4a10
movw %bp, 0x16(%r15)
testl %eax, %eax
je 0x2e404a
movl %eax, %ebx
movl $0x5, %ebp
jmp 0x2e3dea
testb $0x20, %al
jne 0x2e3eb8
movq 0x68(%r13), %rax
xorl %ecx, %ecx
testq %rax, 0x58(%r12)
sete %cl
movl %ecx, %eax
orl $0x8, %eax
shll $0x6, %eax
movl %eax, 0x28(%r15)
jmp 0x2e3ec2
movl $0x240, 0x28(%r15)      # imm = 0x240
movb $0x1, %cl
movl 0xc(%rsp), %eax
testb %dl, %dl
je 0x2e3f3e
xorl %eax, %eax
movq 0x38(%rsp), %rdx
testb $-0x80, 0x40(%rdx)
jne 0x2e3f3e
cmpq $0x0, 0x48(%r13)
jne 0x2e3f3e
testb $0x2, 0x3d(%r12)
jne 0x2e3f3e
testb %cl, %cl
je 0x2e403c
testb $0x4, 0x63(%r13)
jne 0x2e403c
movzwl 0x5c(%r13), %edx
movq 0x38(%rsp), %rsi
cmpw 0x4c(%rsi), %dx
jge 0x2e403c
movq 0x50(%rsp), %rdx
testb $0x4, 0x3c(%rdx)
jne 0x2e403c
cmpb $0x0, 0x1e2744(%rip)    # 0x4c6667
je 0x2e403c
movq 0x50(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx), %rdx
testb $0x20, 0x5c(%rdx)
jne 0x2e403c
movq 0x40(%rsp), %rbp
movzwl %bp, %esi
movb %al, 0x11(%r15)
movswl 0x5c(%r13), %eax
leal (%rax,%rax,4), %eax
leal (%rax,%rax,2), %eax
movq 0x38(%rsp), %rdx
movswl 0x4c(%rdx), %edi
cltd
idivl %edi
addl %esi, %eax
incl %eax
movw %ax, 0x14(%r15)
testb %cl, %cl
jne 0x2e400d
addl $0x10, %ebp
movq 0x50(%rsp), %rcx
cmpl $0x0, 0x7c(%rcx)
jle 0x2e3fe7
movl 0x40(%r12), %ebx
movl $0x14, %r12d
xorl %r15d, %r15d
movq 0x88(%rcx), %r14
movq -0x14(%r14,%r12), %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x2e5117
testl %eax, %eax
je 0x2e3fce
movzwl -0x4(%r14,%r12), %ecx
testw %cx, %cx
jle 0x2e3fca
movb (%r14,%r12), %cl
andb $-0x7e, %cl
cmpb $0x1, %cl
movl $0x0, %ecx
sbbl %ecx, %ecx
orl $0xffec, %ecx           # imm = 0xFFEC
addl %ebp, %ecx
movl %ecx, %ebp
testl %eax, %eax
movq 0x50(%rsp), %rcx
je 0x2e3fe7
incq %r15
movslq 0x7c(%rcx), %rax
addq $0x40, %r12
cmpq %rax, %r15
jl 0x2e3f8e
movq 0x10(%rsp), %r15
movswl 0x14(%r15), %edi
movswl %bp, %esi
callq 0x2dc90b
movw %ax, 0x14(%r15)
movq 0x20(%rsp), %r14
movq 0x28(%rsp), %r12
movq 0x40(%rsp), %rbp
movswl %bp, %edx
movq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x2e4fe2
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e4a10
movw %bp, 0x16(%r15)
testl %eax, %eax
je 0x2e403c
movl %eax, %ebx
movl $0x5, %ebp
xorl %eax, %eax
jmp 0x2e4042
xorl %ebp, %ebp
movb $0x1, %al
xorl %ebx, %ebx
testb %al, %al
je 0x2e3dea
movb $0x0, 0x28(%r14)
xorl %ebp, %ebp
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x2e516b
movl %eax, %ebx
cmpb $0x1, 0x28(%r14)
jne 0x2e3dea
movq 0x38(%rsp), %rax
orb $0x1, 0x41(%rax)
jmp 0x2e3dea
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq