// File: /workspace/github_c_makefile_star2_O3/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, 0x50(%rsp)
movq %rdi, %r15
movw $0xffff, 0x2e(%rsp)     # imm = 0xFFFF
movq 0x18(%rdi), %r12
movq (%rdi), %rax
movq %rax, 0x38(%rsp)
movq 0x8(%rax), %rax
movzbl 0x10(%r12), %ecx
imulq $0x70, %rcx, %rcx
leaq (%rax,%rcx), %rdx
addq $0x8, %rdx
movq 0x20(%rdx), %rsi
movq 0x68(%rdx), %r14
movq %r14, %r13
testq %r14, %r14
jne 0x2da601
testb $-0x80, 0x40(%rsi)
jne 0x2da5fd
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 0x2e(%rsp), %rax
movq %rax, 0x8(%r13)
leaq 0x6c(%rsp), %rax
movq %rax, 0x10(%r13)
movb $0x5, 0x62(%r13)
movq %rsi, 0x18(%r13)
movzwl 0x4c(%rsi), %ecx
movw %cx, 0x5c(%r13)
movw $0x3, 0x63(%r13)
movzwl 0x4a(%rsi), %ecx
movw %cx, (%rax)
movw $0x0, 0x2(%rax)
testb $0x1, 0x3d(%rdx)
jne 0x2da601
movq 0x10(%rsi), %rax
movq %rax, 0x98(%rsp)
jmp 0x2da601
movq 0x10(%rsi), %r13
movq %rdx, 0x18(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x48(%rsp)
movq %rsi, 0x30(%rsp)
movswq 0x4a(%rsi), %rbp
xorl %ebx, %ebx
movl $0x0, %eax
cmpq $0xb, %rbp
jl 0x2da631
movq %rbp, %rdi
callq 0x29d44f
addl $-0x21, %eax
cmpq $0x0, 0x20(%r15)
movq %r15, 0x20(%rsp)
movq %r12, 0x10(%rsp)
jne 0x2da7ad
movq 0x38(%rsp), %rcx
testb $0x20, 0x3c(%rcx)
jne 0x2da7ad
movq (%rcx), %rcx
movq (%rcx), %rcx
testb $-0x80, 0x31(%rcx)
je 0x2da7ad
testq %r14, %r14
jne 0x2da7ad
movq 0x18(%rsp), %rcx
movb 0x3d(%rcx), %cl
testb $0x1, %cl
jne 0x2da7ad
testb $0x28, %cl
jne 0x2da7ad
movl $0x80, %ecx
movq 0x30(%rsp), %rdx
andl 0x40(%rdx), %ecx
jne 0x2da7ad
movq 0x48(%rsp), %rcx
movslq 0x14(%rcx), %r14
testq %r14, %r14
jle 0x2da7ad
movq 0x48(%rsp), %rcx
movq 0x20(%rcx), %r12
shlq $0x6, %r14
addq %r12, %r14
leal (%rax,%rbp), %r15d
addl $-0xa, %r15d
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 0x2da798
leaq -0x40(%r12), %rbp
xorl %ebx, %ebx
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
xorl %edx, %edx
callq 0x2db9f8
testl %eax, %eax
je 0x2da798
movq 0x10(%rsp), %rax
movw $0x1, 0x18(%rax)
movq $0x0, 0x20(%rax)
movl $0x1, 0x2c(%rax)
movq 0x38(%rax), %rax
movq %rbp, (%rax)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2da746
testb $0x2, 0x40(%rax)
movl 0x40(%rsp), %eax
je 0x2da749
movl %r15d, %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 0x2d31ea
movw %ax, 0x14(%rbx)
movl $0x4000, 0x28(%rbx)     # imm = 0x4000
movq -0x10(%r12), %rax
orq 0x50(%rsp), %rax
movq %rax, (%rbx)
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x2db54b
movl %eax, %ebx
testl %ebx, %ebx
jne 0x2da7ad
leaq 0x40(%r12), %rax
cmpq %r14, %r12
movq %rax, %r12
jb 0x2da6d8
testl %ebx, %ebx
jne 0x2dabce
testq %r13, %r13
movq 0x20(%rsp), %r15
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rbp
je 0x2dabce
movl $0x1, 0xc(%rsp)
movq 0x48(%r13), %rcx
testq %rcx, %rcx
je 0x2da7fc
movl 0x3c(%rbp), %esi
movl 0x40(%rbp), %edi
shrl $0x5, %esi
andl $0x1, %esi
movq 0x48(%rsp), %rdx
callq 0x2dba48
testl %eax, %eax
je 0x2da965
testb $0x1, 0x64(%r13)
jne 0x2da965
movq 0x10(%r13), %rax
movzwl (%rax), %r14d
xorl %eax, %eax
movl %eax, 0x18(%r12)
movw %ax, 0x1c(%r12)
movl %eax, 0x2c(%r12)
movb $0x0, 0x11(%r12)
movw %ax, 0x12(%r12)
movq 0x50(%rsp), %rax
movq %rax, (%r12)
movw %r14w, 0x16(%r12)
movq %r13, 0x20(%r12)
movb $0x1, %r8b
testb $0x4, 0x63(%r13)
jne 0x2da9a1
movq (%r15), %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x2da9a1
movl (%rcx), %eax
testl %eax, %eax
jle 0x2da9a1
movl 0x40(%rbp), %edx
movl %edx, 0x40(%rsp)
movq %rcx, 0x60(%rsp)
leaq 0x8(%rcx), %r9
xorl %r12d, %r12d
movq %r9, 0x58(%rsp)
leaq (%r12,%r12,2), %rcx
movq (%r9,%rcx,8), %rbp
testq %rbp, %rbp
je 0x2da8b3
movl 0x4(%rbp), %ecx
testl $0x41000, %ecx          # imm = 0x41000
je 0x2da8b5
btl $0x12, %ecx
jb 0x2da8a5
addq $0x10, %rbp
jmp 0x2da8ad
movq 0x20(%rbp), %rbp
addq $0x8, %rbp
movq (%rbp), %rbp
jmp 0x2da889
xorl %ebp, %ebp
cmpb $-0x5c, (%rbp)
jne 0x2da8fa
movl 0x40(%rsp), %ecx
cmpl %ecx, 0x2c(%rbp)
jne 0x2da8fa
movzwl 0x30(%rbp), %ecx
testw %cx, %cx
js 0x2da98f
movzwl 0x5e(%r13), %edx
testq %rdx, %rdx
movq 0x18(%rsp), %rbp
je 0x2da954
movq 0x8(%r13), %rsi
xorl %edi, %edi
cmpw (%rsi,%rdi,2), %cx
je 0x2da980
incq %rdi
cmpq %rdi, %rdx
jne 0x2da8e6
jmp 0x2da954
movq 0x50(%r13), %r15
testq %r15, %r15
je 0x2da954
movzwl 0x5e(%r13), %ecx
testw %cx, %cx
je 0x2da954
addq $0x8, %r15
xorl %ebx, %ebx
movq 0x8(%r13), %rax
cmpw $-0x2, (%rax,%rbx,2)
jne 0x2da936
movq (%r15), %rsi
movq %rbp, %rdi
movl 0x40(%rsp), %edx
callq 0x2d9af8
testl %eax, %eax
je 0x2da96c
movzwl 0x5e(%r13), %ecx
incq %rbx
movzwl %cx, %eax
addq $0x18, %r15
cmpq %rax, %rbx
jb 0x2da913
movq 0x60(%rsp), %rax
movl (%rax), %eax
movb $0x1, %r8b
movq 0x58(%rsp), %r9
incq %r12
movslq %eax, %rcx
cmpq %rcx, %r12
jl 0x2da881
jmp 0x2da992
xorl %ebx, %ebx
jmp 0x2dabae
movq 0x20(%rsp), %r15
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rbp
xorl %r8d, %r8d
jmp 0x2da9a1
xorl %r8d, %r8d
movq 0x20(%rsp), %r15
movq 0x10(%rsp), %r12
jmp 0x2da9a1
xorl %r8d, %r8d
movq 0x20(%rsp), %r15
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rbp
movzwl 0x63(%r13), %eax
movl %eax, %ecx
notl %ecx
testb $0x3, %cl
jne 0x2da9db
testb %r8b, %r8b
movl 0xc(%rsp), %eax
movl $0x0, %ecx
cmovnel %ecx, %eax
movl $0x100, 0x28(%r12)      # imm = 0x100
movb %al, 0x11(%r12)
leal 0x10(%r14), %eax
movw %ax, 0x14(%r12)
jmp 0x2dab61
testb $0x20, %al
jne 0x2da9f6
movq 0x68(%r13), %rax
xorl %ecx, %ecx
testq %rax, 0x58(%rbp)
sete %cl
movl %ecx, %eax
orl $0x8, %eax
shll $0x6, %eax
jmp 0x2da9fd
movb $0x1, %cl
movl $0x240, %eax            # imm = 0x240
movl %eax, 0x28(%r12)
movl 0xc(%rsp), %eax
testb %r8b, %r8b
je 0x2daa7d
xorl %eax, %eax
movq 0x30(%rsp), %rdx
testb $-0x80, 0x40(%rdx)
jne 0x2daa7d
cmpq $0x0, 0x48(%r13)
jne 0x2daa7d
testb $0x2, 0x3d(%rbp)
jne 0x2daa7d
testb %cl, %cl
je 0x2dab87
testb $0x4, 0x63(%r13)
jne 0x2dab87
movzwl 0x5c(%r13), %edx
movq 0x30(%rsp), %rsi
cmpw 0x4c(%rsi), %dx
jge 0x2dab87
movq 0x38(%rsp), %rdx
testb $0x4, 0x3c(%rdx)
jne 0x2dab87
cmpb $0x0, 0x1e0c05(%rip)    # 0x4bb667
je 0x2dab87
movq 0x38(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx), %rdx
testb $0x20, 0x5c(%rdx)
jne 0x2dab87
movzwl %r14w, %esi
movb %al, 0x11(%r12)
movswl 0x5c(%r13), %eax
leal (%rax,%rax,4), %eax
leal (%rax,%rax,2), %eax
movq 0x30(%rsp), %rdx
movswl 0x4c(%rdx), %edi
cltd
idivl %edi
leal (%rsi,%rax), %edx
incl %edx
movw %dx, 0x14(%r12)
testb %cl, %cl
jne 0x2dab61
leal 0x10(%r14), %ebp
movq 0x38(%rsp), %rax
cmpl $0x0, 0x7c(%rax)
jle 0x2dab4b
movq %r14, 0x40(%rsp)
movq 0x18(%rsp), %rax
movl 0x40(%rax), %ebx
movl $0x14, %r12d
xorl %r15d, %r15d
movq 0x38(%rsp), %rdx
movq 0x88(%rdx), %r14
movq -0x14(%r14,%r12), %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x2dbc33
testl %eax, %eax
je 0x2dab32
movzwl -0x4(%r14,%r12), %eax
testw %ax, %ax
jle 0x2dab17
movb (%r14,%r12), %al
andb $-0x7e, %al
cmpb $0x1, %al
movl $0x0, %eax
sbbl %eax, %eax
orl $0xffec, %eax           # imm = 0xFFEC
addl %ebp, %eax
incq %r15
movq 0x38(%rsp), %rdx
movslq 0x7c(%rdx), %rcx
addq $0x40, %r12
movl %eax, %ebp
cmpq %rcx, %r15
jl 0x2daade
jmp 0x2dab34
movl %ebp, %eax
movq 0x10(%rsp), %r12
movzwl 0x14(%r12), %edx
movl %eax, %ebp
movq 0x20(%rsp), %r15
movq 0x40(%rsp), %r14
movswl %dx, %edi
movswl %bp, %esi
callq 0x2d31ea
movw %ax, 0x14(%r12)
movq 0x18(%rsp), %rbp
movswl %r14w, %edx
movq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x2dbafc
movq %r15, %rdi
movq %r12, %rsi
callq 0x2db54b
movw %r14w, 0x16(%r12)
testl %eax, %eax
jne 0x2dabcc
movb $0x0, 0x28(%r15)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x2dbc96
movl %eax, %ebx
cmpb $0x1, 0x28(%r15)
jne 0x2dabae
movq 0x30(%rsp), %rax
orb $0x1, 0x41(%rax)
cmpq $0x0, 0x68(%rbp)
jne 0x2dabce
testl %ebx, %ebx
jne 0x2dabce
movq 0x28(%r13), %r13
incl 0xc(%rsp)
testq %r13, %r13
jne 0x2da7d5
jmp 0x2dabce
movl %eax, %ebx
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq