// File: /workspace/github_c_makefile_star2_O3/ukontainer[P]sqlite-bench/sqlite3.c
// Function: whereLoopAddBtreeIndex
static int whereLoopAddBtreeIndex(
  WhereLoopBuilder *pBuilder,     /* The WhereLoop factory */
  struct SrcList_item *pSrc,      /* FROM clause term being analyzed */
  Index *pProbe,                  /* An index on pSrc */
  LogEst nInMul                   /* log(Number of iterations due to IN) */
){
  WhereInfo *pWInfo = pBuilder->pWInfo;  /* WHERE analyse context */
  Parse *pParse = pWInfo->pParse;        /* Parsing context */
  sqlite3 *db = pParse->db;       /* Database connection malloc context */
  WhereLoop *pNew;                /* Template WhereLoop under construction */
  WhereTerm *pTerm;               /* A WhereTerm under consideration */
  int opMask;                     /* Valid operators for constraints */
  WhereScan scan;                 /* Iterator for WHERE terms */
  Bitmask saved_prereq;           /* Original value of pNew->prereq */
  u16 saved_nLTerm;               /* Original value of pNew->nLTerm */
  u16 saved_nEq;                  /* Original value of pNew->u.btree.nEq */
  u16 saved_nBtm;                 /* Original value of pNew->u.btree.nBtm */
  u16 saved_nTop;                 /* Original value of pNew->u.btree.nTop */
  u16 saved_nSkip;                /* Original value of pNew->nSkip */
  u32 saved_wsFlags;              /* Original value of pNew->wsFlags */
  LogEst saved_nOut;              /* Original value of pNew->nOut */
  int rc = SQLITE_OK;             /* Return code */
  LogEst rSize;                   /* Number of rows in the table */
  LogEst rLogSize;                /* Logarithm of table size */
  WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */

  pNew = pBuilder->pNew;
  if( db->mallocFailed ) return SQLITE_NOMEM_BKPT;
  WHERETRACE(0x800, ("BEGIN %s.addBtreeIdx(%s), nEq=%d\n",
                     pProbe->pTable->zName,pProbe->zName, pNew->u.btree.nEq));

  assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 );
  assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 );
  if( pNew->wsFlags & WHERE_BTM_LIMIT ){
    opMask = WO_LT|WO_LE;
  }else{
    assert( pNew->u.btree.nBtm==0 );
    opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE|WO_ISNULL|WO_IS;
  }
  if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);

  assert( pNew->u.btree.nEq<pProbe->nColumn );

  saved_nEq = pNew->u.btree.nEq;
  saved_nBtm = pNew->u.btree.nBtm;
  saved_nTop = pNew->u.btree.nTop;
  saved_nSkip = pNew->nSkip;
  saved_nLTerm = pNew->nLTerm;
  saved_wsFlags = pNew->wsFlags;
  saved_prereq = pNew->prereq;
  saved_nOut = pNew->nOut;
  pTerm = whereScanInit(&scan, pBuilder->pWC, pSrc->iCursor, saved_nEq,
                        opMask, pProbe);
  pNew->rSetup = 0;
  rSize = pProbe->aiRowLogEst[0];
  rLogSize = estLog(rSize);
  for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
    u16 eOp = pTerm->eOperator;   /* Shorthand for pTerm->eOperator */
    LogEst rCostIdx;
    LogEst nOutUnadjusted;        /* nOut before IN() and WHERE adjustments */
    int nIn = 0;
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    int nRecValid = pBuilder->nRecValid;
#endif
    if( (eOp==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0)
     && indexColumnNotNull(pProbe, saved_nEq)
    ){
      continue; /* ignore IS [NOT] NULL constraints on NOT NULL columns */
    }
    if( pTerm->prereqRight & pNew->maskSelf ) continue;

    /* Do not allow the upper bound of a LIKE optimization range constraint
    ** to mix with a lower range bound from some other source */
    if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue;

    /* Do not allow constraints from the WHERE clause to be used by the
    ** right table of a LEFT JOIN.  Only constraints in the ON clause are
    ** allowed */
    if( (pSrc->fg.jointype & JT_LEFT)!=0
     && !ExprHasProperty(pTerm->pExpr, EP_FromJoin)
    ){
      continue;
    }

    if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){
      pBuilder->bldFlags |= SQLITE_BLDF_UNIQUE;
    }else{
      pBuilder->bldFlags |= SQLITE_BLDF_INDEXED;
    }
    pNew->wsFlags = saved_wsFlags;
    pNew->u.btree.nEq = saved_nEq;
    pNew->u.btree.nBtm = saved_nBtm;
    pNew->u.btree.nTop = saved_nTop;
    pNew->nLTerm = saved_nLTerm;
    if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
    pNew->aLTerm[pNew->nLTerm++] = pTerm;
    pNew->prereq = (saved_prereq | pTerm->prereqRight) & ~pNew->maskSelf;

    assert( nInMul==0
        || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0 
        || (pNew->wsFlags & WHERE_COLUMN_IN)!=0 
        || (pNew->wsFlags & WHERE_SKIPSCAN)!=0 
    );

    if( eOp & WO_IN ){
      Expr *pExpr = pTerm->pExpr;
      if( ExprHasProperty(pExpr, EP_xIsSelect) ){
        /* "x IN (SELECT ...)":  TUNING: the SELECT returns 25 rows */
        int i;
        nIn = 46;  assert( 46==sqlite3LogEst(25) );

        /* The expression may actually be of the form (x, y) IN (SELECT...).
        ** In this case there is a separate term for each of (x) and (y).
        ** However, the nIn multiplier should only be applied once, not once
        ** for each such term. The following loop checks that pTerm is the
        ** first such term in use, and sets nIn back to 0 if it is not. */
        for(i=0; i<pNew->nLTerm-1; i++){
          if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0;
        }
      }else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){
        /* "x IN (value, value, ...)" */
        nIn = sqlite3LogEst(pExpr->x.pList->nExpr);
        assert( nIn>0 );  /* RHS always has 2 or more terms...  The parser
                          ** changes "x IN (?)" into "x=?". */
      }
      if( pProbe->hasStat1 ){
        LogEst M, logK, safetyMargin;
        /* Let:
        **   N = the total number of rows in the table
        **   K = the number of entries on the RHS of the IN operator
        **   M = the number of rows in the table that match terms to the 
        **       to the left in the same index.  If the IN operator is on
        **       the left-most index column, M==N.
        **
        ** Given the definitions above, it is better to omit the IN operator
        ** from the index lookup and instead do a scan of the M elements,
        ** testing each scanned row against the IN operator separately, if:
        **
        **        M*log(K) < K*log(N)
        **
        ** Our estimates for M, K, and N might be inaccurate, so we build in
        ** a safety margin of 2 (LogEst: 10) that favors using the IN operator
        ** with the index, as using an index has better worst-case behavior.
        ** If we do not have real sqlite_stat1 data, always prefer to use
        ** the index.
        */
        M = pProbe->aiRowLogEst[saved_nEq];
        logK = estLog(nIn);
        safetyMargin = 10;  /* TUNING: extra weight for indexed IN */
        if( M + logK + safetyMargin < nIn + rLogSize ){
          WHERETRACE(0x40,
            ("Scan preferred over IN operator on column %d of \"%s\" (%d<%d)\n",
             saved_nEq, pProbe->zName, M+logK+10, nIn+rLogSize));
          continue;
        }else{
          WHERETRACE(0x40,
            ("IN operator preferred on column %d of \"%s\" (%d>=%d)\n",
             saved_nEq, pProbe->zName, M+logK+10, nIn+rLogSize));
        }
      }
      pNew->wsFlags |= WHERE_COLUMN_IN;
    }else if( eOp & (WO_EQ|WO_IS) ){
      int iCol = pProbe->aiColumn[saved_nEq];
      pNew->wsFlags |= WHERE_COLUMN_EQ;
      assert( saved_nEq==pNew->u.btree.nEq );
      if( iCol==XN_ROWID 
       || (iCol>=0 && nInMul==0 && saved_nEq==pProbe->nKeyCol-1)
      ){
        if( iCol==XN_ROWID || pProbe->uniqNotNull 
         || (pProbe->nKeyCol==1 && pProbe->onError && eOp==WO_EQ) 
        ){
          pNew->wsFlags |= WHERE_ONEROW;
        }else{
          pNew->wsFlags |= WHERE_UNQ_WANTED;
        }
      }
    }else if( eOp & WO_ISNULL ){
      pNew->wsFlags |= WHERE_COLUMN_NULL;
    }else if( eOp & (WO_GT|WO_GE) ){
      testcase( eOp & WO_GT );
      testcase( eOp & WO_GE );
      pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_BTM_LIMIT;
      pNew->u.btree.nBtm = whereRangeVectorLen(
          pParse, pSrc->iCursor, pProbe, saved_nEq, pTerm
      );
      pBtm = pTerm;
      pTop = 0;
      if( pTerm->wtFlags & TERM_LIKEOPT ){
        /* Range contraints that come from the LIKE optimization are
        ** always used in pairs. */
        pTop = &pTerm[1];
        assert( (pTop-(pTerm->pWC->a))<pTerm->pWC->nTerm );
        assert( pTop->wtFlags & TERM_LIKEOPT );
        assert( pTop->eOperator==WO_LT );
        if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
        pNew->aLTerm[pNew->nLTerm++] = pTop;
        pNew->wsFlags |= WHERE_TOP_LIMIT;
        pNew->u.btree.nTop = 1;
      }
    }else{
      assert( eOp & (WO_LT|WO_LE) );
      testcase( eOp & WO_LT );
      testcase( eOp & WO_LE );
      pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_TOP_LIMIT;
      pNew->u.btree.nTop = whereRangeVectorLen(
          pParse, pSrc->iCursor, pProbe, saved_nEq, pTerm
      );
      pTop = pTerm;
      pBtm = (pNew->wsFlags & WHERE_BTM_LIMIT)!=0 ?
                     pNew->aLTerm[pNew->nLTerm-2] : 0;
    }

    /* At this point pNew->nOut is set to the number of rows expected to
    ** be visited by the index scan before considering term pTerm, or the
    ** values of nIn and nInMul. In other words, assuming that all 
    ** "x IN(...)" terms are replaced with "x = ?". This block updates
    ** the value of pNew->nOut to account for pTerm (but not nIn/nInMul).  */
    assert( pNew->nOut==saved_nOut );
    if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
      /* Adjust nOut using stat3/stat4 data. Or, if there is no stat3/stat4
      ** data, using some other estimate.  */
      whereRangeScanEst(pParse, pBuilder, pBtm, pTop, pNew);
    }else{
      int nEq = ++pNew->u.btree.nEq;
      assert( eOp & (WO_ISNULL|WO_EQ|WO_IN|WO_IS) );

      assert( pNew->nOut==saved_nOut );
      if( pTerm->truthProb<=0 && pProbe->aiColumn[saved_nEq]>=0 ){
        assert( (eOp & WO_IN) || nIn==0 );
        testcase( eOp & WO_IN );
        pNew->nOut += pTerm->truthProb;
        pNew->nOut -= nIn;
      }else{
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
        tRowcnt nOut = 0;
        if( nInMul==0 
         && pProbe->nSample 
         && pNew->u.btree.nEq<=pProbe->nSampleCol
         && ((eOp & WO_IN)==0 || !ExprHasProperty(pTerm->pExpr, EP_xIsSelect))
         && OptimizationEnabled(db, SQLITE_Stat34)
        ){
          Expr *pExpr = pTerm->pExpr;
          if( (eOp & (WO_EQ|WO_ISNULL|WO_IS))!=0 ){
            testcase( eOp & WO_EQ );
            testcase( eOp & WO_IS );
            testcase( eOp & WO_ISNULL );
            rc = whereEqualScanEst(pParse, pBuilder, pExpr->pRight, &nOut);
          }else{
            rc = whereInScanEst(pParse, pBuilder, pExpr->x.pList, &nOut);
          }
          if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
          if( rc!=SQLITE_OK ) break;          /* Jump out of the pTerm loop */
          if( nOut ){
            pNew->nOut = sqlite3LogEst(nOut);
            if( pNew->nOut>saved_nOut ) pNew->nOut = saved_nOut;
            pNew->nOut -= nIn;
          }
        }
        if( nOut==0 )
#endif
        {
          pNew->nOut += (pProbe->aiRowLogEst[nEq] - pProbe->aiRowLogEst[nEq-1]);
          if( eOp & WO_ISNULL ){
            /* TUNING: If there is no likelihood() value, assume that a 
            ** "col IS NULL" expression matches twice as many rows 
            ** as (col=?). */
            pNew->nOut += 10;
          }
        }
      }
    }

    /* Set rCostIdx to the cost of visiting selected rows in index. Add
    ** it to pNew->rRun, which is currently set to the cost of the index
    ** seek only. Then, if this is a non-covering index, add the cost of
    ** visiting the rows in the main table.  */
    rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow;
    pNew->rRun = sqlite3LogEstAdd(rLogSize, rCostIdx);
    if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){
      pNew->rRun = sqlite3LogEstAdd(pNew->rRun, pNew->nOut + 16);
    }
    ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);

    nOutUnadjusted = pNew->nOut;
    pNew->rRun += nInMul + nIn;
    pNew->nOut += nInMul + nIn;
    whereLoopOutputAdjust(pBuilder->pWC, pNew, rSize);
    rc = whereLoopInsert(pBuilder, pNew);

    if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
      pNew->nOut = saved_nOut;
    }else{
      pNew->nOut = nOutUnadjusted;
    }

    if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
     && pNew->u.btree.nEq<pProbe->nColumn
    ){
      whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn);
    }
    pNew->nOut = saved_nOut;
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    pBuilder->nRecValid = nRecValid;
#endif
  }
  pNew->prereq = saved_prereq;
  pNew->u.btree.nEq = saved_nEq;
  pNew->u.btree.nBtm = saved_nBtm;
  pNew->u.btree.nTop = saved_nTop;
  pNew->nSkip = saved_nSkip;
  pNew->wsFlags = saved_wsFlags;
  pNew->nOut = saved_nOut;
  pNew->nLTerm = saved_nLTerm;

  /* Consider using a skip-scan if there are no WHERE clause constraints
  ** available for the left-most terms of the index, and if the average
  ** number of repeats in the left-most terms is at least 18. 
  **
  ** The magic number 18 is selected on the basis that scanning 17 rows
  ** is almost always quicker than an index seek (even though if the index
  ** contains fewer than 2^17 rows we assume otherwise in other parts of
  ** the code). And, even if it is not, it should not be too much slower. 
  ** On the other hand, the extra seeks could end up being significantly
  ** more expensive.  */
  assert( 42==sqlite3LogEst(18) );
  if( saved_nEq==saved_nSkip
   && saved_nEq+1<pProbe->nKeyCol
   && pProbe->noSkipScan==0
   && OptimizationEnabled(db, SQLITE_SkipScan)
   && pProbe->aiRowLogEst[saved_nEq+1]>=42  /* TUNING: Minimum for skip-scan */
   && (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK
  ){
    LogEst nIter;
    pNew->u.btree.nEq++;
    pNew->nSkip++;
    pNew->aLTerm[pNew->nLTerm++] = 0;
    pNew->wsFlags |= WHERE_SKIPSCAN;
    nIter = pProbe->aiRowLogEst[saved_nEq] - pProbe->aiRowLogEst[saved_nEq+1];
    pNew->nOut -= nIter;
    /* TUNING:  Because uncertainties in the estimates for skip-scan queries,
    ** add a 1.375 fudge factor to make skip-scan slightly less likely. */
    nIter += 5;
    whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul);
    pNew->nOut = saved_nOut;
    pNew->u.btree.nEq = saved_nEq;
    pNew->nSkip = saved_nSkip;
    pNew->wsFlags = saved_wsFlags;
  }

  WHERETRACE(0x800, ("END %s.addBtreeIdx(%s), nEq=%d, rc=%d\n",
                      pProbe->pTable->zName, pProbe->zName, saved_nEq, rc));
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, %rbx
movq (%rdi), %rax
movq (%rax), %rdx
movq (%rdx), %rax
movl $0x7, %r13d
cmpb $0x0, 0x61(%rax)
jne 0x46a689
movq %rsi, %r15
movq %rdx, 0x60(%rsp)
movq %rax, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq 0x18(%rdi), %r12
movl 0x28(%r12), %eax
movl %eax, 0x28(%rsp)
testb $0x20, %al
movl $0x1bf, %eax            # imm = 0x1BF
movl $0x18, %ecx
cmovel %eax, %ecx
movzwl 0x63(%rbx), %eax
movl %ecx, %r8d
andl $-0x7d, %r8d
testb $0x4, %al
cmovel %ecx, %r8d
movzwl 0x18(%r12), %eax
movw %ax, 0x4(%rsp)
movzwl %ax, %ecx
movzwl 0x1a(%r12), %eax
movw %ax, 0x16(%rsp)
movzwl 0x1c(%r12), %eax
movw %ax, 0x14(%rsp)
movzwl 0x2e(%r12), %eax
movw %ax, 0x2e(%rsp)
movzwl 0x2c(%r12), %eax
movw %ax, 0x6(%rsp)
movq (%r12), %rax
movq %rax, 0x80(%rsp)
movzwl 0x16(%r12), %eax
movl %eax, 0x24(%rsp)
movq %rdi, 0x38(%rsp)
movq 0x8(%rdi), %rsi
movl 0x40(%r15), %edx
leaq 0x88(%rsp), %rdi
movq %rcx, 0x8(%rsp)
movq %rbx, %r9
callq 0x467df7
movq %rax, %r14
movw $0x0, 0x12(%r12)
movq 0x10(%rbx), %rax
movswq (%rax), %rcx
xorl %r13d, %r13d
movl $0x0, %eax
movq %rcx, 0x78(%rsp)
cmpq $0xb, %rcx
jl 0x469ee4
movq 0x78(%rsp), %rdi
callq 0x4309c4
addl $-0x21, %eax
movzwl 0x6(%rsp), %ecx
movq %rcx, 0x68(%rsp)
testq %r14, %r14
je 0x46a53b
movq 0x68(%rsp), %rcx
incl %ecx
movl %ecx, 0x5c(%rsp)
cwtl
movq %rax, 0x70(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x18(%rsp)
movq %r15, 0x40(%rsp)
movzwl 0x14(%r14), %ebp
cmpl $0x100, %ebp            # imm = 0x100
jne 0x469f67
movq 0x8(%rbx), %rax
movq 0x8(%rsp), %rcx
movswq (%rax,%rcx,2), %rax
testq %rax, %rax
js 0x469f52
movq 0x18(%rbx), %rcx
movq 0x8(%rcx), %rcx
shlq $0x5, %rax
movzbl 0x18(%rcx,%rax), %ecx
jmp 0x469f5b
xorl %ecx, %ecx
cmpw $-0x1, %ax
sete %cl
testl %ecx, %ecx
je 0x469f67
xorl %r13d, %r13d
jmp 0x46a3f8
movq 0x8(%r12), %rax
xorl %r13d, %r13d
testq %rax, 0x30(%r14)
jne 0x46a3f8
cmpl $0x10, %ebp
jne 0x469f8e
movzwl 0x12(%r14), %eax
andl $0x100, %eax            # imm = 0x100
jne 0x46a3f8
testb $0x8, 0x3c(%r15)
je 0x469fa2
movq (%r14), %rax
testb $0x1, 0x4(%rax)
je 0x46a3f8
cmpb $0x0, 0x62(%rbx)
je 0x469fb9
movzwl 0x5e(%rbx), %ecx
decl %ecx
movl $0x2, %eax
cmpl 0x8(%rsp), %ecx
je 0x469fbe
movl $0x1, %eax
movq 0x38(%rsp), %rcx
orl %eax, 0x28(%rcx)
movl 0x28(%rsp), %eax
movl %eax, 0x28(%r12)
movzwl 0x4(%rsp), %eax
movw %ax, 0x18(%r12)
movzwl 0x16(%rsp), %eax
movw %ax, 0x1a(%r12)
movzwl 0x14(%rsp), %eax
movw %ax, 0x1c(%r12)
movzwl 0x6(%rsp), %eax
movw %ax, 0x2c(%r12)
movq 0x50(%rsp), %rdi
movq %r12, %rsi
movl 0x5c(%rsp), %edx
callq 0x46921c
xorl %r13d, %r13d
testl %eax, %eax
jne 0x46a53b
movq 0x38(%r12), %rax
movzwl 0x2c(%r12), %edx
leal 0x1(%rdx), %ecx
movw %cx, 0x2c(%r12)
movq %r14, (%rax,%rdx,8)
movq 0x30(%r14), %rax
orq 0x80(%rsp), %rax
movq 0x8(%r12), %rdx
notq %rdx
andq %rax, %rdx
movq %rdx, (%r12)
testb $0x1, %bpl
jne 0x46a0e3
testb $-0x7e, %bpl
je 0x46a16b
movq 0x8(%rbx), %rax
movq 0x8(%rsp), %rcx
movzwl (%rax,%rcx,2), %ecx
movl 0x28(%r12), %eax
movl %eax, %r13d
orl $0x1, %r13d
movl %r13d, 0x28(%r12)
cmpw $-0x1, %cx
je 0x46a0ce
xorl %r15d, %r15d
cmpw $0x0, 0x48(%rsp)
jne 0x46a226
testw %cx, %cx
js 0x46a226
movzwl 0x5e(%rbx), %ecx
leal -0x1(%rcx), %edx
cmpl 0x8(%rsp), %edx
jne 0x46a226
testb $0x8, 0x63(%rbx)
jne 0x46a0ce
cmpw $0x1, %cx
jne 0x46a4ec
cmpl $0x2, %ebp
jne 0x46a4ec
cmpb $0x0, 0x62(%rbx)
je 0x46a4ec
orl $0x1001, %eax           # imm = 0x1001
movl %eax, 0x28(%r12)
xorl %r15d, %r15d
movl %eax, %r13d
jmp 0x46a226
movq (%r14), %rax
testb $0x8, 0x5(%rax)
jne 0x46a10b
movq 0x20(%rax), %rax
xorl %r15d, %r15d
testq %rax, %rax
je 0x46a142
movslq (%rax), %rdi
testq %rdi, %rdi
je 0x46a142
callq 0x4309c4
movswl %ax, %r15d
jmp 0x46a142
cmpw $0x2, %cx
jb 0x46a1ce
movzwl %cx, %ecx
decl %ecx
movq 0x38(%r12), %rdx
movl $0x2e, %r15d
xorl %esi, %esi
xorl %r8d, %r8d
movq (%rdx,%rsi,8), %rdi
testq %rdi, %rdi
je 0x46a13a
cmpq %rax, (%rdi)
cmovel %r8d, %r15d
incq %rsi
cmpq %rsi, %rcx
jne 0x46a12a
testb $-0x80, 0x63(%rbx)
je 0x46a218
movq 0x10(%rbx), %rax
movq 0x8(%rsp), %rcx
movzwl (%rax,%rcx,2), %r13d
xorl %eax, %eax
cmpl $0xb, %r15d
jge 0x46a1ee
jmp 0x46a1fb
btl $0x8, %ebp
jb 0x46a41f
movl 0x28(%r12), %eax
testb $0x24, %bpl
je 0x46a435
orl $0x22, %eax
movl %eax, 0x28(%r12)
movl 0x40(%r15), %esi
movq 0x60(%rsp), %rdi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
movq %r14, %r8
callq 0x46a7a1
movw %ax, 0x1a(%r12)
testb $0x1, 0x13(%r14)
jne 0x46a48b
movl 0x28(%r12), %r13d
xorl %r15d, %r15d
movq %r14, 0x18(%rsp)
movq $0x0, 0x30(%rsp)
jmp 0x46a226
movl $0x2e, %r15d
testb $-0x80, 0x63(%rbx)
je 0x46a218
movq 0x10(%rbx), %rax
movq 0x8(%rsp), %rcx
movzwl (%rax,%rcx,2), %r13d
movl $0x2e, %r15d
movzwl %r15w, %edi
callq 0x4309c4
addl $-0x21, %eax
cwtl
movswl %r13w, %ecx
addl %ecx, %eax
addl $0xa, %eax
movq 0x70(%rsp), %rcx
addl %r15d, %ecx
cmpl %ecx, %eax
jge 0x46a218
xorl %r13d, %r13d
jmp 0x46a3f3
movl 0x28(%r12), %r13d
orl $0x4, %r13d
movl %r13d, 0x28(%r12)
testb $0x2, %r13b
jne 0x46a268
movl 0x18(%r12), %eax
incl %eax
movw %ax, 0x18(%r12)
movzwl 0x10(%r14), %r14d
testw %r14w, %r14w
jle 0x46a295
movzwl %ax, %eax
movq 0x10(%rbx), %rcx
movzwl (%rcx,%rax,2), %edx
subw -0x2(%rcx,%rax,2), %dx
addw 0x16(%r12), %dx
leal 0xa(%rdx), %r14d
btl $0x8, %ebp
cmovael %edx, %r14d
jmp 0x46a2ae
movzwl 0x16(%r12), %ecx
movl %ecx, %eax
cmpq $0x0, 0x18(%rsp)
movq 0x38(%rsp), %rbp
movq 0x30(%rsp), %r14
je 0x46a2b7
movq 0x18(%rsp), %rax
movzwl 0x10(%rax), %eax
testw %ax, %ax
jle 0x46a2b5
leal -0x14(%rcx), %eax
jmp 0x46a2b7
movq 0x8(%rbx), %rcx
movq 0x8(%rsp), %rdx
cmpw $0x0, (%rcx,%rdx,2)
js 0x46a244
subl %r15d, %r14d
addw 0x16(%r12), %r14w
movq 0x38(%rsp), %rbp
jmp 0x46a332
addl %ecx, %eax
testq %r14, %r14
je 0x46a2cb
movzwl 0x10(%r14), %edx
testw %dx, %dx
jle 0x46a2d0
addl $-0x14, %eax
jmp 0x46a2d4
xorl %r14d, %r14d
jmp 0x46a2d4
addl %eax, %edx
movl %edx, %eax
cmpq $0x0, 0x18(%rsp)
je 0x46a2fb
testq %r14, %r14
je 0x46a2fb
movq 0x18(%rsp), %rdx
cmpw $0x0, 0x10(%rdx)
jle 0x46a2fb
cmpw $0x0, 0x10(%r14)
leal -0x14(%rax), %edx
cmovlel %eax, %edx
movl %edx, %eax
movswl %cx, %ecx
movq %r14, 0x30(%rsp)
negq %r14
movl $0x0, %r14d
sbbl %r14d, %r14d
cmpq $0x1, 0x18(%rsp)
adcl $-0x1, %r14d
addl %ecx, %r14d
cmpw $0xb, %ax
movl $0xa, %ecx
cmovgel %eax, %ecx
movzwl %cx, %eax
cmpl %eax, %r14d
cmovgel %eax, %r14d
movswl 0x5c(%rbx), %eax
leal (%rax,%rax,4), %eax
leal (%rax,%rax,2), %eax
movq 0x40(%rsp), %rcx
movq 0x20(%rcx), %rcx
movswl 0x4a(%rcx), %ecx
cltd
idivl %ecx
addl %r14d, %eax
incl %eax
movswl %ax, %esi
movq 0x70(%rsp), %rdi
callq 0x4618c3
testl $0x140, %r13d           # imm = 0x140
jne 0x46a376
leal 0x10(%r14), %ecx
movswl %cx, %esi
movswl %ax, %edi
callq 0x4618c3
addl 0x48(%rsp), %r15d
addl %r15d, %eax
movw %ax, 0x14(%r12)
leal (%r15,%r14), %eax
movw %ax, 0x16(%r12)
movq 0x8(%rbp), %rdi
movq %r12, %rsi
movq 0x78(%rsp), %rdx
callq 0x469c46
movq (%rbp), %rdi
movq 0x20(%rbp), %rsi
movq %r12, %rdx
callq 0x4696da
movl %eax, %r13d
movl 0x28(%r12), %eax
testb $0x2, %al
cmovnel 0x24(%rsp), %r14d
movw %r14w, 0x16(%r12)
testb $0x10, %al
jne 0x46a3e9
movzwl 0x18(%r12), %eax
cmpw 0x60(%rbx), %ax
jae 0x46a3e9
movswl %r15w, %ecx
movq %rbp, %rdi
movq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x469dd3
movl 0x24(%rsp), %eax
movw %ax, 0x16(%r12)
movq 0x40(%rsp), %r15
leaq 0x88(%rsp), %rdi
callq 0x467e94
testl %r13d, %r13d
jne 0x46a53b
movq %rax, %r14
testq %rax, %rax
jne 0x469f1f
jmp 0x46a53b
movl 0x28(%r12), %r13d
orl $0x8, %r13d
movl %r13d, 0x28(%r12)
xorl %r15d, %r15d
jmp 0x46a226
orl $0x12, %eax
movl %eax, 0x28(%r12)
movl 0x40(%r15), %esi
movq 0x60(%rsp), %rdi
movq %rbx, %rdx
movq 0x8(%rsp), %rcx
movq %r14, %r8
callq 0x46a7a1
movw %ax, 0x1c(%r12)
movl 0x28(%r12), %r13d
testb $0x20, %r13b
jne 0x46a4fb
testb $0x2, %r13b
jne 0x46a51d
movq $0x0, 0x18(%rsp)
movq %r14, 0x30(%rsp)
xorl %r15d, %r15d
jmp 0x46a22c
movzwl 0x2c(%r12), %edx
incl %edx
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x46921c
testl %eax, %eax
jne 0x46a53b
leaq 0x40(%r14), %rsi
movq 0x38(%r12), %rax
movzwl 0x2c(%r12), %ecx
leal 0x1(%rcx), %edx
movw %dx, 0x2c(%r12)
movq %rsi, 0x30(%rsp)
movq %rsi, (%rax,%rcx,8)
movl 0x28(%r12), %r13d
orl $0x10, %r13d
movl %r13d, 0x28(%r12)
movw $0x1, 0x1c(%r12)
xorl %r15d, %r15d
movq %r14, 0x18(%rsp)
jmp 0x46a226
orl $0x10001, %eax          # imm = 0x10001
movl %eax, 0x28(%r12)
jmp 0x46a0db
movq 0x38(%r12), %rax
movzwl 0x2c(%r12), %ecx
movq -0x10(%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
xorl %r15d, %r15d
movq %r14, 0x30(%rsp)
jmp 0x46a226
movzwl 0x16(%r12), %eax
movq $0x0, 0x18(%rsp)
xorl %r15d, %r15d
movl %eax, %ecx
movq 0x38(%rsp), %rbp
jmp 0x46a2bc
movq 0x80(%rsp), %rax
movq %rax, (%r12)
movzwl 0x4(%rsp), %ecx
movw %cx, 0x18(%r12)
movzwl 0x16(%rsp), %eax
movw %ax, 0x1a(%r12)
movzwl 0x14(%rsp), %eax
movw %ax, 0x1c(%r12)
movzwl 0x2e(%rsp), %edx
movw %dx, 0x2e(%r12)
movl 0x28(%rsp), %eax
movl %eax, 0x28(%r12)
movl 0x24(%rsp), %eax
movw %ax, 0x16(%r12)
movzwl 0x6(%rsp), %eax
movw %ax, 0x2c(%r12)
cmpw %dx, %cx
jne 0x46a689
movq 0x8(%rsp), %rax
incl %eax
movzwl 0x5e(%rbx), %ecx
cmpl %ecx, %eax
jae 0x46a689
testb $0x40, 0x63(%rbx)
movq 0x38(%rsp), %r14
jne 0x46a689
movq 0x50(%rsp), %rdi
testb $0x40, 0x5d(%rdi)
jne 0x46a689
movq 0x10(%rbx), %rax
movq 0x8(%rsp), %rcx
cmpw $0x2a, 0x2(%rax,%rcx,2)
movq 0x48(%rsp), %rbp
jl 0x46a689
movq 0x68(%rsp), %rdx
incl %edx
movq %r12, %rsi
callq 0x46921c
movl %eax, %r13d
testl %eax, %eax
jne 0x46a689
incw 0x18(%r12)
movq 0x38(%r12), %rax
movl 0x2c(%r12), %ecx
movd %ecx, %xmm0
pcmpeqd %xmm1, %xmm1
psubw %xmm1, %xmm0
movd %xmm0, 0x2c(%r12)
movzwl %cx, %ecx
movq $0x0, (%rax,%rcx,8)
orb $-0x80, 0x29(%r12)
movq 0x10(%rbx), %rax
movq 0x8(%rsp), %rdx
movzwl (%rax,%rdx,2), %ecx
subw 0x2(%rax,%rdx,2), %cx
subw %cx, 0x16(%r12)
leal (%rcx,%rbp), %eax
addl $0x5, %eax
movswl %ax, %ecx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x469dd3
movl 0x24(%rsp), %eax
movw %ax, 0x16(%r12)
movzwl 0x4(%rsp), %eax
movw %ax, 0x18(%r12)
movw %ax, 0x2e(%r12)
movl 0x28(%rsp), %eax
movl %eax, 0x28(%r12)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq