// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3WhereBegin
SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
  Parse *pParse,        /* The parser context */
  SrcList *pTabList,    /* FROM clause: A list of all tables to be scanned */
  Expr *pWhere,         /* The WHERE clause */
  ExprList *pOrderBy,   /* An ORDER BY clause, or NULL */
  ExprList *pResultSet, /* Result set of the query */
  u16 wctrlFlags,       /* One of the WHERE_* flags defined in sqliteInt.h */
  int iIdxCur           /* If WHERE_ONETABLE_ONLY is set, index cursor number */
){
  int nByteWInfo;            /* Num. bytes allocated for WhereInfo struct */
  int nTabList;              /* Number of elements in pTabList */
  WhereInfo *pWInfo;         /* Will become the return value of this function */
  Vdbe *v = pParse->pVdbe;   /* The virtual database engine */
  Bitmask notReady;          /* Cursors that are not yet positioned */
  WhereLoopBuilder sWLB;     /* The WhereLoop builder */
  WhereMaskSet *pMaskSet;    /* The expression mask set */
  WhereLevel *pLevel;        /* A single level in pWInfo->a[] */
  WhereLoop *pLoop;          /* Pointer to a single WhereLoop object */
  int ii;                    /* Loop counter */
  sqlite3 *db;               /* Database connection */
  int rc;                    /* Return code */


  /* Variable initialization */
  db = pParse->db;
  memset(&sWLB, 0, sizeof(sWLB));
  sWLB.pOrderBy = pOrderBy;

  /* Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via
  ** sqlite3_test_ctrl(SQLITE_TESTCTRL_OPTIMIZATIONS,...) */
  if( OptimizationDisabled(db, SQLITE_DistinctOpt) ){
    wctrlFlags &= ~WHERE_WANT_DISTINCT;
  }

  /* The number of tables in the FROM clause is limited by the number of
  ** bits in a Bitmask 
  */
  testcase( pTabList->nSrc==BMS );
  if( pTabList->nSrc>BMS ){
    sqlite3ErrorMsg(pParse, "at most %d tables in a join", BMS);
    return 0;
  }

  /* This function normally generates a nested loop for all tables in 
  ** pTabList.  But if the WHERE_ONETABLE_ONLY flag is set, then we should
  ** only generate code for the first table in pTabList and assume that
  ** any cursors associated with subsequent tables are uninitialized.
  */
  nTabList = (wctrlFlags & WHERE_ONETABLE_ONLY) ? 1 : pTabList->nSrc;

  /* Allocate and initialize the WhereInfo structure that will become the
  ** return value. A single allocation is used to store the WhereInfo
  ** struct, the contents of WhereInfo.a[], the WhereClause structure
  ** and the WhereMaskSet structure. Since WhereClause contains an 8-byte
  ** field (type Bitmask) it must be aligned on an 8-byte boundary on
  ** some architectures. Hence the ROUND8() below.
  */
  nByteWInfo = ROUND8(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel));
  pWInfo = sqlite3DbMallocZero(db, nByteWInfo + sizeof(WhereLoop));
  if( db->mallocFailed ){
    sqlite3DbFree(db, pWInfo);
    pWInfo = 0;
    goto whereBeginError;
  }
  pWInfo->nLevel = nTabList;
  pWInfo->pParse = pParse;
  pWInfo->pTabList = pTabList;
  pWInfo->pOrderBy = pOrderBy;
  pWInfo->pResultSet = pResultSet;
  pWInfo->iBreak = sqlite3VdbeMakeLabel(v);
  pWInfo->wctrlFlags = wctrlFlags;
  pWInfo->savedNQueryLoop = pParse->nQueryLoop;
  pMaskSet = &pWInfo->sMaskSet;
  sWLB.pWInfo = pWInfo;
  sWLB.pWC = &pWInfo->sWC;
  sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
  assert( EIGHT_BYTE_ALIGNMENT(sWLB.pNew) );
  whereLoopInit(sWLB.pNew);
#ifdef SQLITE_DEBUG
  sWLB.pNew->cId = '*';
#endif

  /* Split the WHERE clause into separate subexpressions where each
  ** subexpression is separated by an AND operator.
  */
  initMaskSet(pMaskSet);
  whereClauseInit(&pWInfo->sWC, pWInfo);
  sqlite3ExprCodeConstants(pParse, pWhere);
  whereSplit(&pWInfo->sWC, pWhere, TK_AND);
  sqlite3CodeVerifySchema(pParse, -1); /* Insert the cookie verifier Goto */
    
  /* Special case: a WHERE clause that is constant.  Evaluate the
  ** expression and either jump over all of the code or fall thru.
  */
  if( pWhere && (nTabList==0 || sqlite3ExprIsConstantNotJoin(pWhere)) ){
    sqlite3ExprIfFalse(pParse, pWhere, pWInfo->iBreak, SQLITE_JUMPIFNULL);
    pWhere = 0;
  }

  /* Special case: No FROM clause
  */
  if( nTabList==0 ){
    if( pOrderBy ) pWInfo->bOBSat = 1;
    if( wctrlFlags & WHERE_WANT_DISTINCT ){
      pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE;
    }
  }

  /* Assign a bit from the bitmask to every term in the FROM clause.
  **
  ** When assigning bitmask values to FROM clause cursors, it must be
  ** the case that if X is the bitmask for the N-th FROM clause term then
  ** the bitmask for all FROM clause terms to the left of the N-th term
  ** is (X-1).   An expression from the ON clause of a LEFT JOIN can use
  ** its Expr.iRightJoinTable value to find the bitmask of the right table
  ** of the join.  Subtracting one from the right table bitmask gives a
  ** bitmask for all tables to the left of the join.  Knowing the bitmask
  ** for all tables to the left of a left join is important.  Ticket #3015.
  **
  ** Note that bitmasks are created for all pTabList->nSrc tables in
  ** pTabList, not just the first nTabList tables.  nTabList is normally
  ** equal to pTabList->nSrc but might be shortened to 1 if the
  ** WHERE_ONETABLE_ONLY flag is set.
  */
  for(ii=0; ii<pTabList->nSrc; ii++){
    createMask(pMaskSet, pTabList->a[ii].iCursor);
  }
#ifndef NDEBUG
  {
    Bitmask toTheLeft = 0;
    for(ii=0; ii<pTabList->nSrc; ii++){
      Bitmask m = getMask(pMaskSet, pTabList->a[ii].iCursor);
      assert( (m-1)==toTheLeft );
      toTheLeft |= m;
    }
  }
#endif

  /* Analyze all of the subexpressions.  Note that exprAnalyze() might
  ** add new virtual terms onto the end of the WHERE clause.  We do not
  ** want to analyze these virtual terms, so start analyzing at the end
  ** and work forward so that the added virtual terms are never processed.
  */
  exprAnalyzeAll(pTabList, &pWInfo->sWC);
  if( db->mallocFailed ){
    goto whereBeginError;
  }

  /* If the ORDER BY (or GROUP BY) clause contains references to general
  ** expressions, then we won't be able to satisfy it using indices, so
  ** go ahead and disable it now.
  */
  if( pOrderBy && (wctrlFlags & WHERE_WANT_DISTINCT)!=0 ){
    for(ii=0; ii<pOrderBy->nExpr; ii++){
      Expr *pExpr = sqlite3ExprSkipCollate(pOrderBy->a[ii].pExpr);
      if( pExpr->op!=TK_COLUMN ){
        pWInfo->pOrderBy = pOrderBy = 0;
        break;
      }else if( pExpr->iColumn<0 ){
        break;
      }
    }
  }

  if( wctrlFlags & WHERE_WANT_DISTINCT ){
    if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){
      /* The DISTINCT marking is pointless.  Ignore it. */
      pWInfo->eDistinct = WHERE_DISTINCT_UNIQUE;
    }else if( pOrderBy==0 ){
      /* Try to ORDER BY the result set to make distinct processing easier */
      pWInfo->wctrlFlags |= WHERE_DISTINCTBY;
      pWInfo->pOrderBy = pResultSet;
    }
  }

  /* Construct the WhereLoop objects */
  WHERETRACE(0xffff,("*** Optimizer Start ***\n"));
  if( nTabList!=1 || whereShortCut(&sWLB)==0 ){
    rc = whereLoopAddAll(&sWLB);
    if( rc ) goto whereBeginError;
  
    /* Display all of the WhereLoop objects if wheretrace is enabled */
#ifdef WHERETRACE_ENABLED
    if( sqlite3WhereTrace ){
      WhereLoop *p;
      int i;
      static char zLabel[] = "0123456789abcdefghijklmnopqrstuvwyxz"
                                       "ABCDEFGHIJKLMNOPQRSTUVWYXZ";
      for(p=pWInfo->pLoops, i=0; p; p=p->pNextLoop, i++){
        p->cId = zLabel[i%sizeof(zLabel)];
        whereLoopPrint(p, pTabList);
      }
    }
#endif
  
    wherePathSolver(pWInfo, 0);
    if( db->mallocFailed ) goto whereBeginError;
    if( pWInfo->pOrderBy ){
       wherePathSolver(pWInfo, pWInfo->nRowOut+1);
       if( db->mallocFailed ) goto whereBeginError;
    }
  }
  if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){
     pWInfo->revMask = (Bitmask)(-1);
  }
  if( pParse->nErr || NEVER(db->mallocFailed) ){
    goto whereBeginError;
  }
#ifdef WHERETRACE_ENABLED
  if( sqlite3WhereTrace ){
    int ii;
    sqlite3DebugPrintf("---- Solution nRow=%d", pWInfo->nRowOut);
    if( pWInfo->bOBSat ){
      sqlite3DebugPrintf(" ORDERBY=0x%llx", pWInfo->revMask);
    }
    switch( pWInfo->eDistinct ){
      case WHERE_DISTINCT_UNIQUE: {
        sqlite3DebugPrintf("  DISTINCT=unique");
        break;
      }
      case WHERE_DISTINCT_ORDERED: {
        sqlite3DebugPrintf("  DISTINCT=ordered");
        break;
      }
      case WHERE_DISTINCT_UNORDERED: {
        sqlite3DebugPrintf("  DISTINCT=unordered");
        break;
      }
    }
    sqlite3DebugPrintf("\n");
    for(ii=0; ii<pWInfo->nLevel; ii++){
      whereLoopPrint(pWInfo->a[ii].pWLoop, pTabList);
    }
  }
#endif
  /* Attempt to omit tables from the join that do not effect the result */
  if( pWInfo->nLevel>=2
   && pResultSet!=0
   && OptimizationEnabled(db, SQLITE_OmitNoopJoin)
  ){
    Bitmask tabUsed = exprListTableUsage(pMaskSet, pResultSet);
    if( sWLB.pOrderBy ) tabUsed |= exprListTableUsage(pMaskSet, sWLB.pOrderBy);
    while( pWInfo->nLevel>=2 ){
      WhereTerm *pTerm, *pEnd;
      pLoop = pWInfo->a[pWInfo->nLevel-1].pWLoop;
      if( (pWInfo->pTabList->a[pLoop->iTab].jointype & JT_LEFT)==0 ) break;
      if( (wctrlFlags & WHERE_WANT_DISTINCT)==0
       && (pLoop->wsFlags & WHERE_ONEROW)==0
      ){
        break;
      }
      if( (tabUsed & pLoop->maskSelf)!=0 ) break;
      pEnd = sWLB.pWC->a + sWLB.pWC->nTerm;
      for(pTerm=sWLB.pWC->a; pTerm<pEnd; pTerm++){
        if( (pTerm->prereqAll & pLoop->maskSelf)!=0
         && !ExprHasProperty(pTerm->pExpr, EP_FromJoin)
        ){
          break;
        }
      }
      if( pTerm<pEnd ) break;
      WHERETRACE(0xffff, ("-> drop loop %c not used\n", pLoop->cId));
      pWInfo->nLevel--;
      nTabList--;
    }
  }
  WHERETRACE(0xffff,("*** Optimizer Finished ***\n"));
  pWInfo->pParse->nQueryLoop += pWInfo->nRowOut;

  /* If the caller is an UPDATE or DELETE statement that is requesting
  ** to use a one-pass algorithm, determine if this is appropriate.
  ** The one-pass algorithm only works if the WHERE clause constraints
  ** the statement to update a single row.
  */
  assert( (wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || pWInfo->nLevel==1 );
  if( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 
   && (pWInfo->a[0].pWLoop->wsFlags & WHERE_ONEROW)!=0 ){
    pWInfo->okOnePass = 1;
    pWInfo->a[0].pWLoop->wsFlags &= ~WHERE_IDX_ONLY;
  }

  /* Open all tables in the pTabList and any indices selected for
  ** searching those tables.
  */
  notReady = ~(Bitmask)0;
  for(ii=0, pLevel=pWInfo->a; ii<nTabList; ii++, pLevel++){
    Table *pTab;     /* Table to open */
    int iDb;         /* Index of database containing table/index */
    struct SrcList_item *pTabItem;

    pTabItem = &pTabList->a[pLevel->iFrom];
    pTab = pTabItem->pTab;
    iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
    pLoop = pLevel->pWLoop;
    if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){
      /* Do nothing */
    }else
#ifndef SQLITE_OMIT_VIRTUALTABLE
    if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){
      const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
      int iCur = pTabItem->iCursor;
      sqlite3VdbeAddOp4(v, OP_VOpen, iCur, 0, 0, pVTab, P4_VTAB);
    }else if( IsVirtual(pTab) ){
      /* noop */
    }else
#endif
    if( (pLoop->wsFlags & WHERE_IDX_ONLY)==0
         && (wctrlFlags & WHERE_OMIT_OPEN_CLOSE)==0 ){
      int op = pWInfo->okOnePass ? OP_OpenWrite : OP_OpenRead;
      sqlite3OpenTable(pParse, pTabItem->iCursor, iDb, pTab, op);
      testcase( !pWInfo->okOnePass && pTab->nCol==BMS-1 );
      testcase( !pWInfo->okOnePass && pTab->nCol==BMS );
      if( !pWInfo->okOnePass && pTab->nCol<BMS ){
        Bitmask b = pTabItem->colUsed;
        int n = 0;
        for(; b; b=b>>1, n++){}
        sqlite3VdbeChangeP4(v, sqlite3VdbeCurrentAddr(v)-1, 
                            SQLITE_INT_TO_PTR(n), P4_INT32);
        assert( n<=pTab->nCol );
      }
    }else{
      sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
    }
    if( pLoop->wsFlags & WHERE_INDEXED ){
      Index *pIx = pLoop->u.btree.pIndex;
      KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx);
      /* FIXME:  As an optimization use pTabItem->iCursor if WHERE_IDX_ONLY */
      int iIndexCur = pLevel->iIdxCur = iIdxCur ? iIdxCur : pParse->nTab++;
      assert( pIx->pSchema==pTab->pSchema );
      assert( iIndexCur>=0 );
      sqlite3VdbeAddOp4(v, OP_OpenRead, iIndexCur, pIx->tnum, iDb,
                        (char*)pKey, P4_KEYINFO_HANDOFF);
      VdbeComment((v, "%s", pIx->zName));
    }
    sqlite3CodeVerifySchema(pParse, iDb);
    notReady &= ~getMask(&pWInfo->sMaskSet, pTabItem->iCursor);
  }
  pWInfo->iTop = sqlite3VdbeCurrentAddr(v);
  if( db->mallocFailed ) goto whereBeginError;

  /* Generate the code to do the search.  Each iteration of the for
  ** loop below generates code for a single nested loop of the VM
  ** program.
  */
  notReady = ~(Bitmask)0;
  for(ii=0; ii<nTabList; ii++){
    pLevel = &pWInfo->a[ii];
#ifndef SQLITE_OMIT_AUTOMATIC_INDEX
    if( (pLevel->pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 ){
      constructAutomaticIndex(pParse, &pWInfo->sWC,
                &pTabList->a[pLevel->iFrom], notReady, pLevel);
      if( db->mallocFailed ) goto whereBeginError;
    }
#endif
    explainOneScan(pParse, pTabList, pLevel, ii, pLevel->iFrom, wctrlFlags);
    pLevel->addrBody = sqlite3VdbeCurrentAddr(v);
    notReady = codeOneLoopStart(pWInfo, ii, notReady);
    pWInfo->iContinue = pLevel->addrCont;
  }

  /* Done. */
  return pWInfo;

  /* Jump here if malloc fails */
whereBeginError:
  if( pWInfo ){
    pParse->nQueryLoop = pWInfo->savedNQueryLoop;
    whereInfoFree(db, pWInfo);
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movw %r9w, %ax
movl 0x10(%rbp), %r9d
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movw %ax, -0x32(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x8200
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xa8(%rbp), %rax
movzwl 0x4c(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x6dbad
movzwl -0x32(%rbp), %eax
andl $0xfffffbff, %eax       # imm = 0xFFFFFBFF
movw %ax, -0x32(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x40, %eax
jle 0x6dbdd
movq -0x10(%rbp), %rdi
leaq 0x429d2(%rip), %rsi     # 0xb0596
movl $0x40, %edx
movb $0x0, %al
callq 0x136f0
movq $0x0, -0x8(%rbp)
jmp 0x6e74f
movzwl -0x32(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x6dbf6
movl $0x1, %eax
movl %eax, -0x120(%rbp)
jmp 0x6dc03
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x120(%rbp)
movl -0x120(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl $0x1, %eax
cltq
imulq $0x48, %rax, %rax
addq $0x380, %rax            # imm = 0x380
addq $0x7, %rax
andq $-0x8, %rax
movl %eax, -0x38(%rbp)
movq -0xa8(%rbp), %rdi
movslq -0x38(%rbp), %rax
addq $0x60, %rax
movl %eax, %esi
callq 0x11ca0
movq %rax, -0x48(%rbp)
movq -0xa8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x6dc6d
movq -0xa8(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x9cd0
movq $0x0, -0x48(%rbp)
jmp 0x6e71f
movl -0x3c(%rbp), %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, 0x38(%rax)
movq -0x10(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x50(%rbp), %rdi
callq 0x67890
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x44(%rax)
movw -0x32(%rbp), %cx
movq -0x48(%rbp), %rax
movw %cx, 0x32(%rax)
movq -0x10(%rbp), %rax
movl 0x1e8(%rax), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x48(%rbp), %rax
addq $0x4c, %rax
movq %rax, -0x88(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x48(%rbp), %rax
addq $0x150, %rax            # imm = 0x150
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rax
movslq -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x71bd0
movq -0x88(%rbp), %rax
movl $0x0, (%rax)
movq -0x48(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq -0x48(%rbp), %rsi
callq 0x71c10
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x71c60
movq -0x48(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq -0x20(%rbp), %rsi
movl $0x45, %edx
callq 0x71cd0
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5eb40
cmpq $0x0, -0x20(%rbp)
je 0x6dda5
cmpl $0x0, -0x3c(%rbp)
je 0x6dd84
movq -0x20(%rbp), %rdi
callq 0x71d50
cmpl $0x0, %eax
je 0x6dda5
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rax
movl 0x44(%rax), %edx
movl $0x8, %ecx
callq 0x67920
movq $0x0, -0x20(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x6ddd2
cmpq $0x0, -0x28(%rbp)
je 0x6ddba
movq -0x48(%rbp), %rax
movb $0x1, 0x34(%rax)
movzwl -0x32(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x6ddd0
movq -0x48(%rbp), %rax
movb $0x1, 0x37(%rax)
jmp 0x6ddd2
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movq -0x18(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x6de23
movq -0x88(%rbp), %rdi
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x9c(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %esi
callq 0x71d70
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x6dddc
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
callq 0x71da0
movq -0xa8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x6de49
jmp 0x6e71f
cmpq $0x0, -0x28(%rbp)
je 0x6def6
movzwl -0x32(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x6def6
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x6def4
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x9c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x648b0
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x98, %eax
je 0x6deca
movq $0x0, -0x28(%rbp)
movq -0x48(%rbp), %rax
movq $0x0, 0x10(%rax)
jmp 0x6def4
movq -0xb8(%rbp), %rax
movswl 0x30(%rax), %eax
cmpl $0x0, %eax
jge 0x6dedc
jmp 0x6def4
jmp 0x6dede
jmp 0x6dee0
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x6de70
jmp 0x6def6
movzwl -0x32(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x6df58
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq $0x150, %rdx            # imm = 0x150
movq -0x30(%rbp), %rcx
callq 0x71df0
cmpl $0x0, %eax
je 0x6df2f
movq -0x48(%rbp), %rax
movb $0x1, 0x37(%rax)
jmp 0x6df56
cmpq $0x0, -0x28(%rbp)
jne 0x6df54
movq -0x48(%rbp), %rax
movzwl 0x32(%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
movw %cx, 0x32(%rax)
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x6df56
jmp 0x6df58
cmpl $0x1, -0x3c(%rbp)
jne 0x6df6c
leaq -0x80(%rbp), %rdi
callq 0x71fc0
cmpl $0x0, %eax
jne 0x6dfde
leaq -0x80(%rbp), %rdi
callq 0x722c0
movl %eax, -0xac(%rbp)
cmpl $0x0, -0xac(%rbp)
je 0x6df89
jmp 0x6e71f
movq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x72440
movq -0xa8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x6dfa6
jmp 0x6e71f
movq -0x48(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x6dfdc
movq -0x48(%rbp), %rdi
movq -0x48(%rbp), %rax
movzwl 0x30(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0x72440
movq -0xa8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x6dfda
jmp 0x6e71f
jmp 0x6dfdc
jmp 0x6dfde
movq -0x48(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x6e009
movq -0xa8(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
je 0x6e009
movq -0x48(%rbp), %rax
movq $-0x1, 0x28(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x50(%rax)
jne 0x6e023
movq -0xa8(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0x6e028
jmp 0x6e71f
movq -0x48(%rbp), %rax
movzbl 0x38(%rax), %eax
cmpl $0x2, %eax
jl 0x6e1ff
cmpq $0x0, -0x30(%rbp)
je 0x6e1ff
movq -0xa8(%rbp), %rax
movzwl 0x4c(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x6e1ff
movq -0x88(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x72be0
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x6e099
movq -0x88(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x72be0
orq -0xc0(%rbp), %rax
movq %rax, -0xc0(%rbp)
jmp 0x6e09b
movq -0x48(%rbp), %rax
movzbl 0x38(%rax), %eax
cmpl $0x2, %eax
jl 0x6e1fd
movq -0x48(%rbp), %rax
addq $0x338, %rax            # imm = 0x338
movq -0x48(%rbp), %rcx
movzbl 0x38(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x40(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rax
movq -0x98(%rbp), %rcx
movzbl 0x10(%rcx), %ecx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movzbl 0x38(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x6e105
jmp 0x6e1fd
movzwl -0x32(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x6e12c
movq -0x98(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x6e12c
jmp 0x6e1fd
movq -0xc0(%rbp), %rax
movq -0x98(%rbp), %rcx
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
je 0x6e149
jmp 0x6e1fd
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x78(%rbp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jae 0x6e1d0
movq -0xc8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x98(%rbp), %rcx
andq 0x8(%rcx), %rax
cmpq $0x0, %rax
je 0x6e1ba
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movzwl 0x2(%rax), %eax
andl $0x1, %eax
cmpl $0x1, %eax
je 0x6e1ba
jmp 0x6e1d0
jmp 0x6e1bc
movq -0xc8(%rbp), %rax
addq $0x38, %rax
movq %rax, -0xc8(%rbp)
jmp 0x6e176
movq -0xc8(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jae 0x6e1e2
jmp 0x6e1fd
movq -0x48(%rbp), %rax
movb 0x38(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x38(%rax)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x6e09b
jmp 0x6e1ff
movq -0x48(%rbp), %rax
movzwl 0x30(%rax), %ecx
movq -0x48(%rbp), %rax
movq (%rax), %rax
addl 0x1e8(%rax), %ecx
movl %ecx, 0x1e8(%rax)
movzwl -0x32(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x6e25a
movq -0x48(%rbp), %rax
movq 0x378(%rax), %rax
movl 0x28(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x6e25a
movq -0x48(%rbp), %rax
movb $0x1, 0x35(%rax)
movq -0x48(%rbp), %rax
movq 0x378(%rax), %rax
movl 0x28(%rax), %ecx
andl $-0x41, %ecx
movl %ecx, 0x28(%rax)
movq $-0x1, -0x58(%rbp)
movl $0x0, -0x9c(%rbp)
movq -0x48(%rbp), %rax
addq $0x338, %rax            # imm = 0x338
movq %rax, -0x90(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x6e5d0
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq -0x90(%rbp), %rcx
movzbl 0x20(%rcx), %ecx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0xa8(%rbp), %rdi
movq -0xd8(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x13940
movl %eax, -0xdc(%rbp)
movq -0x90(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0xd8(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x6e30f
movq -0xd8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x6e314
jmp 0x6e4c8
movq -0x98(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x6e37f
movq -0xa8(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x49880
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0xf4(%rbp)
movq -0x50(%rbp), %rdi
movl -0xf4(%rbp), %edx
movq -0xf0(%rbp), %r9
movl $0x89, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0xfffffff6, (%rsp)     # imm = 0xFFFFFFF6
callq 0x5e1b0
jmp 0x6e4c6
movq -0xd8(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x6e397
jmp 0x6e4c4
movq -0x98(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x6e49d
movzwl -0x32(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x6e49d
movq -0x48(%rbp), %rax
movzbl 0x35(%rax), %edx
movl $0x30, %eax
movl $0x31, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0xf8(%rbp)
movq -0x10(%rbp), %rdi
movq -0xe8(%rbp), %rax
movl 0x3c(%rax), %esi
movl -0xdc(%rbp), %edx
movq -0xd8(%rbp), %rcx
movl -0xf8(%rbp), %r8d
callq 0x5e480
movq -0x48(%rbp), %rax
cmpb $0x0, 0x35(%rax)
jne 0x6e49b
movq -0xd8(%rbp), %rax
movswl 0x42(%rax), %eax
cmpl $0x40, %eax
jge 0x6e49b
movq -0xe8(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x100(%rbp)
movl $0x0, -0x104(%rbp)
cmpq $0x0, -0x100(%rbp)
je 0x6e46a
jmp 0x6e448
movq -0x100(%rbp), %rax
shrq %rax
movq %rax, -0x100(%rbp)
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x6e43c
movq -0x50(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x50(%rbp), %rdi
callq 0x5e520
movq -0x128(%rbp), %rdi
movl %eax, %esi
subl $0x1, %esi
movslq -0x104(%rbp), %rdx
movl $0xfffffff2, %ecx       # imm = 0xFFFFFFF2
callq 0x13c20
jmp 0x6e4c2
movq -0x10(%rbp), %rdi
movl -0xdc(%rbp), %esi
movq -0xd8(%rbp), %rax
movl 0x3c(%rax), %edx
movq -0xd8(%rbp), %rax
movq (%rax), %r8
xorl %ecx, %ecx
callq 0x5e580
jmp 0x6e4c4
jmp 0x6e4c6
jmp 0x6e4c8
movq -0x98(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x6e578
movq -0x98(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x110(%rbp)
movq -0x10(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x67540
movq %rax, -0x118(%rbp)
cmpl $0x0, 0x10(%rbp)
je 0x6e51a
movl 0x10(%rbp), %eax
movl %eax, -0x12c(%rbp)
jmp 0x6e52f
movq -0x10(%rbp), %rcx
movl 0x54(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x54(%rcx)
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movq -0x90(%rbp), %rcx
movl %eax, 0x8(%rcx)
movl %eax, -0x11c(%rbp)
movq -0x50(%rbp), %rdi
movl -0x11c(%rbp), %edx
movq -0x110(%rbp), %rax
movl 0x50(%rax), %ecx
movl -0xdc(%rbp), %r8d
movq -0x118(%rbp), %r9
movl $0x30, %esi
movl $0xfffffff0, (%rsp)     # imm = 0xFFFFFFF0
callq 0x5e1b0
movq -0x10(%rbp), %rdi
movl -0xdc(%rbp), %esi
callq 0x5eb40
movq -0x48(%rbp), %rdi
addq $0x4c, %rdi
movq -0xe8(%rbp), %rax
movl 0x3c(%rax), %esi
callq 0x72c50
xorq $-0x1, %rax
andq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x90(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x90(%rbp)
jmp 0x6e27d
movq -0x50(%rbp), %rdi
callq 0x5e520
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0xa8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x6e5f4
jmp 0x6e71f
movq $-0x1, -0x58(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x6e715
movq -0x48(%rbp), %rax
addq $0x338, %rax            # imm = 0x338
movslq -0x9c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq 0x40(%rax), %rax
movl 0x28(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x6e699
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
movq -0x90(%rbp), %rax
movzbl 0x20(%rax), %eax
imulq $0x68, %rax, %rax
addq %rax, %rdx
movq -0x58(%rbp), %rcx
movq -0x90(%rbp), %r8
callq 0x72cb0
movq -0xa8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x6e697
jmp 0x6e71f
jmp 0x6e699
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x90(%rbp), %rdx
movl -0x9c(%rbp), %ecx
movq -0x90(%rbp), %rax
movzbl 0x20(%rax), %r8d
movzwl -0x32(%rbp), %r9d
callq 0x733c0
movq -0x50(%rbp), %rdi
callq 0x5e520
movl %eax, %ecx
movq -0x90(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x48(%rbp), %rdi
movl -0x9c(%rbp), %esi
movq -0x58(%rbp), %rdx
callq 0x737a0
movq %rax, -0x58(%rbp)
movq -0x90(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x40(%rax)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x6e606
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6e74f
cmpq $0x0, -0x48(%rbp)
je 0x6e747
movq -0x48(%rbp), %rax
movl 0x48(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1e8(%rax)
movq -0xa8(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x75220
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax)