// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3FindInIndex
SQLITE_PRIVATE int sqlite3FindInIndex(
  Parse *pParse,             /* Parsing context */
  Expr *pX,                  /* The IN expression */
  u32 inFlags,               /* IN_INDEX_LOOP, _MEMBERSHIP, and/or _NOOP_OK */
  int *prRhsHasNull,         /* Register holding NULL status.  See notes */
  int *aiMap,                /* Mapping from Index fields to RHS fields */
  int *piTab                 /* OUT: index to use */
){
  Select *p;                            /* SELECT to the right of IN operator */
  int eType = 0;                        /* Type of RHS table. IN_INDEX_* */
  int iTab = pParse->nTab++;            /* Cursor of the RHS table */
  int mustBeUnique;                     /* True if RHS must be unique */
  Vdbe *v = sqlite3GetVdbe(pParse);     /* Virtual machine being coded */

  assert( pX->op==TK_IN );
  mustBeUnique = (inFlags & IN_INDEX_LOOP)!=0;

  /* If the RHS of this IN(...) operator is a SELECT, and if it matters
  ** whether or not the SELECT result contains NULL values, check whether
  ** or not NULL is actually possible (it may not be, for example, due
  ** to NOT NULL constraints in the schema). If no NULL values are possible,
  ** set prRhsHasNull to 0 before continuing.  */
  if( prRhsHasNull && (pX->flags & EP_xIsSelect) ){
    int i;
    ExprList *pEList = pX->x.pSelect->pEList;
    for(i=0; i<pEList->nExpr; i++){
      if( sqlite3ExprCanBeNull(pEList->a[i].pExpr) ) break;
    }
    if( i==pEList->nExpr ){
      prRhsHasNull = 0;
    }
  }

  /* Check to see if an existing table or index can be used to
  ** satisfy the query.  This is preferable to generating a new
  ** ephemeral table.  */
  if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){
    sqlite3 *db = pParse->db;              /* Database connection */
    Table *pTab;                           /* Table <table>. */
    int iDb;                               /* Database idx for pTab */
    ExprList *pEList = p->pEList;
    int nExpr = pEList->nExpr;

    assert( p->pEList!=0 );             /* Because of isCandidateForInOpt(p) */
    assert( p->pEList->a[0].pExpr!=0 ); /* Because of isCandidateForInOpt(p) */
    assert( p->pSrc!=0 );               /* Because of isCandidateForInOpt(p) */
    pTab = p->pSrc->a[0].pTab;

    /* Code an OP_Transaction and OP_TableLock for <table>. */
    iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
    assert( iDb>=0 && iDb<SQLITE_MAX_ATTACHED );
    sqlite3CodeVerifySchema(pParse, iDb);
    sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);

    assert(v);  /* sqlite3GetVdbe() has always been previously called */
    if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){
      /* The "x IN (SELECT rowid FROM table)" case */
      int iAddr = sqlite3VdbeAddOp0(v, OP_Once);
      VdbeCoverage(v);

      sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
      eType = IN_INDEX_ROWID;
      ExplainQueryPlan((pParse, 0,
            "USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR",pTab->zName));
      sqlite3VdbeJumpHere(v, iAddr);
    }else{
      Index *pIdx;                         /* Iterator variable */
      int affinity_ok = 1;
      int i;

      /* Check that the affinity that will be used to perform each
      ** comparison is the same as the affinity of each column in table
      ** on the RHS of the IN operator.  If it not, it is not possible to
      ** use any index of the RHS table.  */
      for(i=0; i<nExpr && affinity_ok; i++){
        Expr *pLhs = sqlite3VectorFieldSubexpr(pX->pLeft, i);
        int iCol = pEList->a[i].pExpr->iColumn;
        char idxaff = sqlite3TableColumnAffinity(pTab,iCol); /* RHS table */
        char cmpaff = sqlite3CompareAffinity(pLhs, idxaff);
        testcase( cmpaff==SQLITE_AFF_BLOB );
        testcase( cmpaff==SQLITE_AFF_TEXT );
        switch( cmpaff ){
          case SQLITE_AFF_BLOB:
            break;
          case SQLITE_AFF_TEXT:
            /* sqlite3CompareAffinity() only returns TEXT if one side or the
            ** other has no affinity and the other side is TEXT.  Hence,
            ** the only way for cmpaff to be TEXT is for idxaff to be TEXT
            ** and for the term on the LHS of the IN to have no affinity. */
            assert( idxaff==SQLITE_AFF_TEXT );
            break;
          default:
            affinity_ok = sqlite3IsNumericAffinity(idxaff);
        }
      }

      if( affinity_ok ){
        /* Search for an existing index that will work for this IN operator */
        for(pIdx=pTab->pIndex; pIdx && eType==0; pIdx=pIdx->pNext){
          Bitmask colUsed;      /* Columns of the index used */
          Bitmask mCol;         /* Mask for the current column */
          if( pIdx->nColumn<nExpr ) continue;
          if( pIdx->pPartIdxWhere!=0 ) continue;
          /* Maximum nColumn is BMS-2, not BMS-1, so that we can compute
          ** BITMASK(nExpr) without overflowing */
          testcase( pIdx->nColumn==BMS-2 );
          testcase( pIdx->nColumn==BMS-1 );
          if( pIdx->nColumn>=BMS-1 ) continue;
          if( mustBeUnique ){
            if( pIdx->nKeyCol>nExpr
             ||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx))
            ){
              continue;  /* This index is not unique over the IN RHS columns */
            }
          }

          colUsed = 0;   /* Columns of index used so far */
          for(i=0; i<nExpr; i++){
            Expr *pLhs = sqlite3VectorFieldSubexpr(pX->pLeft, i);
            Expr *pRhs = pEList->a[i].pExpr;
            CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs);
            int j;

            assert( pReq!=0 || pRhs->iColumn==XN_ROWID || pParse->nErr );
            for(j=0; j<nExpr; j++){
              if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue;
              assert( pIdx->azColl[j] );
              if( pReq!=0 && sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ){
                continue;
              }
              break;
            }
            if( j==nExpr ) break;
            mCol = MASKBIT(j);
            if( mCol & colUsed ) break; /* Each column used only once */
            colUsed |= mCol;
            if( aiMap ) aiMap[i] = j;
          }

          assert( i==nExpr || colUsed!=(MASKBIT(nExpr)-1) );
          if( colUsed==(MASKBIT(nExpr)-1) ){
            /* If we reach this point, that means the index pIdx is usable */
            int iAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
            ExplainQueryPlan((pParse, 0,
                              "USING INDEX %s FOR IN-OPERATOR",pIdx->zName));
            sqlite3VdbeAddOp3(v, OP_OpenRead, iTab, pIdx->tnum, iDb);
            sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
            VdbeComment((v, "%s", pIdx->zName));
            assert( IN_INDEX_INDEX_DESC == IN_INDEX_INDEX_ASC+1 );
            eType = IN_INDEX_INDEX_ASC + pIdx->aSortOrder[0];

            if( prRhsHasNull ){
#ifdef SQLITE_ENABLE_COLUMN_USED_MASK
              i64 mask = (1<<nExpr)-1;
              sqlite3VdbeAddOp4Dup8(v, OP_ColumnsUsed,
                  iTab, 0, 0, (u8*)&mask, P4_INT64);
#endif
              *prRhsHasNull = ++pParse->nMem;
              if( nExpr==1 ){
                sqlite3SetHasNullFlag(v, iTab, *prRhsHasNull);
              }
            }
            sqlite3VdbeJumpHere(v, iAddr);
          }
        } /* End loop over indexes */
      } /* End if( affinity_ok ) */
    } /* End if not an rowid index */
  } /* End attempt to optimize using an index */

  /* If no preexisting index is available for the IN clause
  ** and IN_INDEX_NOOP is an allowed reply
  ** and the RHS of the IN operator is a list, not a subquery
  ** and the RHS is not constant or has two or fewer terms,
  ** then it is not worth creating an ephemeral table to evaluate
  ** the IN operator so return IN_INDEX_NOOP.
  */
  if( eType==0
   && (inFlags & IN_INDEX_NOOP_OK)
   && !ExprHasProperty(pX, EP_xIsSelect)
   && (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2)
  ){
    eType = IN_INDEX_NOOP;
  }

  if( eType==0 ){
    /* Could not find an existing table or index to use as the RHS b-tree.
    ** We will have to generate an ephemeral table to do the job.
    */
    u32 savedNQueryLoop = pParse->nQueryLoop;
    int rMayHaveNull = 0;
    eType = IN_INDEX_EPH;
    if( inFlags & IN_INDEX_LOOP ){
      pParse->nQueryLoop = 0;
    }else if( prRhsHasNull ){
      *prRhsHasNull = rMayHaveNull = ++pParse->nMem;
    }
    assert( pX->op==TK_IN );
    sqlite3CodeRhsOfIN(pParse, pX, iTab);
    if( rMayHaveNull ){
      sqlite3SetHasNullFlag(v, iTab, rMayHaveNull);
    }
    pParse->nQueryLoop = savedNQueryLoop;
  }

  if( aiMap && eType!=IN_INDEX_INDEX_ASC && eType!=IN_INDEX_INDEX_DESC ){
    int i, n;
    n = sqlite3ExprVectorSize(pX->pLeft);
    for(i=0; i<n; i++) aiMap[i] = i;
  }
  *piTab = iTab;
  return eType;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r14
movq %r8, 0x68(%rsp)
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %r15
movl 0x34(%rdi), %eax
movq %rax, 0x30(%rsp)
incl %eax
movl %eax, 0x34(%rdi)
callq 0x2bc630
movq %rax, 0x40(%rsp)
testq %rbx, %rbx
movq %r15, 0x18(%rsp)
movq %r14, 0x70(%rsp)
je 0x2c1a0f
testb $0x8, 0x5(%r13)
je 0x2c1a24
movq 0x20(%r13), %rax
movq 0x20(%rax), %r12
movl (%r12), %r14d
testl %r14d, %r14d
jle 0x2c1a13
addq $0x8, %r12
xorl %r15d, %r15d
movq (%r12), %rdi
callq 0x2c262e
testl %eax, %eax
jne 0x2c1a16
incq %r15
addq $0x18, %r12
cmpq %r15, %r14
jne 0x2c19f1
movl %r14d, %r15d
jmp 0x2c1a16
xorl %ebx, %ebx
jmp 0x2c1a24
xorl %r15d, %r15d
xorl %eax, %eax
cmpl %r14d, %r15d
cmoveq %rax, %rbx
movq 0x18(%rsp), %r15
cmpl $0x0, 0x30(%r15)
movq %r13, 0x20(%rsp)
jne 0x2c1a7f
movl $0x820, %eax            # imm = 0x820
andl 0x4(%r13), %eax
cmpl $0x800, %eax            # imm = 0x800
jne 0x2c1a7f
movq 0x20(%r13), %rax
cmpq $0x0, 0x50(%rax)
jne 0x2c1a7f
testb $0x9, 0x4(%rax)
jne 0x2c1a7f
cmpq $0x0, 0x60(%rax)
jne 0x2c1a7f
cmpq $0x0, 0x30(%rax)
jne 0x2c1a7f
movq 0x28(%rax), %rcx
cmpl $0x1, (%rcx)
jne 0x2c1a7f
cmpq $0x0, 0x30(%rcx)
jne 0x2c1a7f
movq 0x28(%rcx), %r12
cmpl $0x0, 0x54(%r12)
je 0x2c21fd
testb $0x1, %bpl
movq 0x18(%rsp), %r12
je 0x2c1af5
testb $0x8, 0x5(%r13)
jne 0x2c1af5
movq 0x10(%r13), %r15
movq $0x0, 0x10(%r13)
leaq 0x78(%rsp), %r14
movw $0x1, 0x24(%r14)
leaq -0x1129(%rip), %rax     # 0x2c0987
movq %rax, 0x8(%r14)
leaq -0x103b(%rip), %rax     # 0x2c0a80
movq %rax, 0x10(%r14)
movl $0x0, 0x28(%r14)
movq %r14, %rdi
movq %r13, %rsi
callq 0x2c0a8c
cmpw $0x0, 0x24(%r14)
movq %r15, 0x10(%r13)
movl $0x5, %r15d
je 0x2c20db
movq 0x20(%r13), %rax
cmpl $0x3, (%rax)
jl 0x2c20db
movl 0xc4(%r12), %eax
testb $0x4, %bpl
movl %eax, 0x50(%rsp)
jne 0x2c1b20
testq %rbx, %rbx
je 0x2c1b2c
movl 0x38(%r12), %eax
incl %eax
movl %eax, 0x38(%r12)
movl %eax, 0x48(%rsp)
movl %eax, (%rbx)
jmp 0x2c1b34
movl $0x0, 0xc4(%r12)
movl $0x0, 0x48(%rsp)
movq 0x10(%r12), %rbx
movl 0x4(%r13), %eax
movl $0x0, 0x10(%rsp)
testb $0x20, %al
jne 0x2c1ba4
cmpl $0x0, 0x40(%r12)
jne 0x2c1ba4
btl $0x19, %eax
jb 0x2c1f0e
orl $0x2000000, %eax        # imm = 0x2000000
movl %eax, 0x4(%r13)
movl 0x38(%r12), %ecx
incl %ecx
movl %ecx, 0x38(%r12)
movl %ecx, 0x44(%r13)
movq %rbx, %rdi
movl $0x45, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x2a83e1
incl %eax
movl %eax, 0x40(%r13)
movq %rbx, %rdi
movl $0x11, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, 0x10(%rsp)
movq 0x10(%r13), %rdx
movb (%rdx), %al
cmpb $-0x53, %al
jne 0x2c1bb1
movb 0x2(%rdx), %al
movq %rdx, %rcx
cmpb $-0x52, %al
je 0x2c1bcb
movzbl %al, %eax
movl $0x1, %ebp
cmpl $0x88, %eax
jne 0x2c1bd1
movq 0x20(%rdx), %rcx
movq 0x20(%rcx), %rax
movl (%rax), %ebp
movq %rdx, 0x60(%rsp)
movq 0x30(%rsp), %rdx
movq 0x20(%rsp), %r15
movl %edx, 0x2c(%r15)
movq %rbx, %rdi
movl $0x64, %esi
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, %r13d
movq (%r12), %rdi
movl %ebp, %esi
movl $0x1, %edx
callq 0x2bcb86
movq %rax, 0x28(%rsp)
testb $0x8, 0x5(%r15)
movq %r12, %r14
movq 0x20(%r15), %r12
movl %r13d, 0x3c(%rsp)
jne 0x2c1c54
testq %r12, %r12
je 0x2c1ff0
movq 0x60(%rsp), %rdi
callq 0x2c08a4
movb %al, 0xf(%rsp)
cmpb $0x40, %al
movq 0x20(%rsp), %rcx
jg 0x2c1d32
movb $0x41, 0xf(%rsp)
movq 0x28(%rsp), %r14
jmp 0x2c1d40
movq 0x20(%r12), %r13
cmpl $0x0, 0x10(%rsp)
leaq 0x115a2b(%rip), %rax    # 0x3d7690
leaq 0x108504(%rip), %rcx    # 0x3ca170
cmoveq %rax, %rcx
movl 0x10(%r12), %r8d
leaq 0x115a85(%rip), %rdx    # 0x3d7701
movq %r14, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x2c1741
movl %ebp, 0x5c(%rsp)
cmpl %ebp, (%r13)
jne 0x2c1d25
xorl %ebp, %ebp
leaq 0x78(%rsp), %r15
movb $0xb, (%r15)
movq 0x30(%rsp), %rax
movl %eax, 0x4(%r15)
movl %ebp, 0x8(%r15)
movq %rbp, 0x18(%r15)
movq %rbp, 0xc(%r15)
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0x2c18b1
movq %rax, 0x18(%r15)
movl %ebp, 0x8(%r12)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2af648
movq 0x18(%r15), %rsi
testl %eax, %eax
je 0x2c1f95
testq %rsi, %rsi
movq 0x18(%rsp), %r12
je 0x2c1cfc
movq (%r12), %rdi
callq 0x282904
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
movq 0x20(%rsp), %r13
je 0x2c20b2
decl (%rsi)
jne 0x2c20b2
movq 0x10(%rsi), %rdi
callq 0x282904
jmp 0x2c20b2
movq 0x20(%rsp), %r13
movq %r14, %r12
jmp 0x2c1ffa
cmpb $0x45, %al
movq 0x28(%rsp), %r14
jne 0x2c1d40
movb $0x43, 0xf(%rsp)
testq %r14, %r14
movq 0x18(%rsp), %r13
je 0x2c1d5a
movq 0x10(%rcx), %rsi
movq %r13, %rdi
callq 0x2a9678
movq %rax, 0x20(%r14)
movb 0x1f(%r13), %al
testb %al, %al
je 0x2c1d8b
leal -0x1(%rax), %ecx
movb %cl, 0x1f(%r13)
movzbl %cl, %ecx
movl 0xd4(%r13,%rcx,4), %r15d
testb %cl, %cl
je 0x2c1d96
addb $-0x2, %al
movb %al, 0x1f(%r13)
movzbl %al, %eax
movl 0xd4(%r13,%rax,4), %r14d
jmp 0x2c1da1
movl 0x38(%r13), %r15d
incl %r15d
movl %r15d, 0x38(%r13)
movl 0x38(%r13), %r14d
incl %r14d
movl %r14d, 0x38(%r13)
movl (%r12), %r13d
testl %r13d, %r13d
jle 0x2c1eb5
addq $0x8, %r12
incl %r13d
movq (%r12), %rbp
cmpl $0x0, 0x10(%rsp)
je 0x2c1e25
movw $0x1, 0x9c(%rsp)
leaq -0x144a(%rip), %rax     # 0x2c0987
movq %rax, 0x80(%rsp)
leaq -0x1360(%rip), %rax     # 0x2c0a80
movq %rax, 0x88(%rsp)
movl $0x0, 0xa0(%rsp)
testq %rbp, %rbp
je 0x2c1e2d
leaq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x2c0a8c
cmpw $0x0, 0x9c(%rsp)
jne 0x2c1e2d
movq %rbx, %rdi
movl 0x10(%rsp), %esi
callq 0x2c27bc
movq 0x20(%rsp), %rax
andb $-0x3, 0x7(%rax)
movl $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
movl %r15d, %edx
callq 0x2bc7e9
movq %rbx, %rdi
movl $0x5b, %esi
movl %r15d, %edx
movl $0x1, %ecx
movl %r14d, %r8d
callq 0x2a83e1
movq %rbx, %rdi
movl %eax, %esi
leaq 0xf(%rsp), %rdx
movl $0x1, %ecx
callq 0x27b778
movq %rbx, %rdi
movl $0x82, %esi
movq 0x30(%rsp), %rdx
movl %r14d, %ecx
movl %r15d, %r8d
callq 0x2a83e1
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
jne 0x2c1ea4
movq 0x88(%rbx), %rcx
cltq
leaq (%rax,%rax,2), %rax
movb $-0x3, 0x1(%rcx,%rax,8)
movl $0x1, 0x10(%rcx,%rax,8)
addq $0x18, %r12
decl %r13d
cmpl $0x1, %r13d
jg 0x2c1db5
testl %r15d, %r15d
movq 0x18(%rsp), %r12
je 0x2c1edb
movzbl 0x1f(%r12), %eax
cmpq $0x7, %rax
ja 0x2c1edb
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%r12)
movl %r15d, 0xd4(%r12,%rax,4)
testl %r14d, %r14d
movq 0x20(%rsp), %r13
je 0x2c1ffa
movzbl 0x1f(%r12), %eax
cmpq $0x7, %rax
ja 0x2c1ffa
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%r12)
movl %r14d, 0xd4(%r12,%rax,4)
jmp 0x2c1ffa
movq %rbx, %rdi
movl $0x11, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, %ebp
testb $0x8, 0x5(%r13)
je 0x2c1f45
movq 0x20(%r13), %rax
movl 0x10(%rax), %ecx
leaq 0x1157b1(%rip), %rdx    # 0x3d76ea
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2c1741
movl 0x40(%r13), %ecx
movl 0x44(%r13), %edx
movq %rbx, %rdi
movl $0xc, %esi
xorl %r8d, %r8d
callq 0x2a83e1
movl 0x2c(%r13), %ecx
movq %rbx, %rdi
movl $0x62, %esi
movq 0x30(%rsp), %rdx
xorl %r8d, %r8d
callq 0x2a83e1
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2c21d6
leaq 0x1fcef8(%rip), %rcx    # 0x4bee88
jmp 0x2c21f0
testq %rsi, %rsi
je 0x2c1fa7
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x282904
movl 0x5c(%rsp), %eax
testl %eax, %eax
movq 0x28(%rsp), %r14
movq 0x60(%rsp), %rbp
jle 0x2c1ff0
addq $0x8, %r13
movl %eax, %r12d
xorl %r15d, %r15d
movq %rbp, %rdi
movl %r15d, %esi
callq 0x2c0855
movq (%r13), %rdx
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x2a9634
movq %rax, 0x20(%r14,%r15,8)
incq %r15
addq $0x18, %r13
cmpq %r15, %r12
jne 0x2c1fc3
movq 0x20(%rsp), %r13
movq 0x18(%rsp), %r12
movq 0x28(%rsp), %rdx
testq %rdx, %rdx
je 0x2c2015
movq %rbx, %rdi
movl 0x3c(%rsp), %esi
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
callq 0x27b778
cmpl $0x0, 0x10(%rsp)
je 0x2c20b2
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
leaq 0x1fce58(%rip), %r14    # 0x4bee88
cmpb $0x0, 0x61(%rcx)
movq %r14, %rcx
jne 0x2c2057
leal -0x1(%rax), %ecx
movl 0x10(%rsp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%rbx), %rcx
movl %eax, 0x8(%rcx)
movl 0x44(%r13), %edx
movq %rbx, %rdi
movl $0x41, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl 0x90(%rbx), %eax
decl %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
jne 0x2c209f
movl 0x40(%r13), %ecx
leal -0x1(%rcx), %edx
testl %ecx, %ecx
cmovlel %eax, %edx
movslq %edx, %rcx
leaq (%rcx,%rcx,2), %r14
shlq $0x3, %r14
addq 0x88(%rbx), %r14
movl %eax, 0x4(%r14)
movb $0x0, 0x1f(%r12)
movl $0x0, 0x28(%r12)
movl 0x48(%rsp), %edx
testl %edx, %edx
je 0x2c20c9
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x2c2716
movl 0x50(%rsp), %eax
movl %eax, 0xc4(%r12)
movl $0x2, %r15d
movq 0x68(%rsp), %rsi
testq %rsi, %rsi
je 0x2c21b5
leal -0x5(%r15), %eax
cmpl $-0x3, %eax
ja 0x2c21b5
movq 0x10(%r13), %rcx
movb (%rcx), %al
cmpb $-0x53, %al
jne 0x2c2103
movb 0x2(%rcx), %al
cmpb $-0x52, %al
je 0x2c211b
movzbl %al, %edx
movl $0x1, %eax
cmpl $0x88, %edx
jne 0x2c2129
movq 0x20(%rcx), %rcx
movq 0x20(%rcx), %rax
movl (%rax), %eax
testl %eax, %eax
jle 0x2c21b5
movl %eax, %ecx
incl %eax
andl $-0x2, %eax
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x968db(%rip), %xmm1    # 0x358a20
xorl %ecx, %ecx
movdqa 0x968e1(%rip), %xmm2    # 0x358a30
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x968e1(%rip), %xmm4    # 0x358a40
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %edx
notl %edx
testb $0x1, %dl
je 0x2c2193
movl %ecx, (%rsi,%rcx,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x2c21a8
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rsi,%rcx,4)
addq $0x2, %rcx
paddq %xmm4, %xmm1
cmpq %rcx, %rax
jne 0x2c215f
movq 0x70(%rsp), %rax
movq 0x30(%rsp), %rcx
movl %ecx, (%rax)
movl %r15d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal -0x1(%rax), %ecx
testl %ebp, %ebp
cmovnsl %ebp, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%rbx), %rcx
movl %eax, 0x8(%rcx)
movq 0x20(%rsp), %r13
jmp 0x2c20b2
movq 0x20(%rax), %rdi
movl (%rdi), %edx
addq $0x8, %rdi
movq %rdx, 0x10(%rsp)
testl %edx, %edx
jle 0x2c2242
movq 0x10(%rsp), %rcx
leaq (,%rcx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
movq (%rdi,%rdx), %rsi
cmpb $-0x5c, (%rsi)
jne 0x2c1a7f
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x2c2223
testq %rax, %rax
je 0x2c1a7f
movq 0x70(%r12), %rax
testq %rax, %rax
movq %rdi, 0x50(%rsp)
je 0x2c2278
movq 0x18(%rsp), %rcx
movq (%rcx), %rcx
movq 0x20(%rcx), %rcx
addq $0x18, %rcx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
incl %r15d
leaq 0x20(%rcx), %rdx
cmpq %rax, (%rcx)
movq %rdx, %rcx
jne 0x2c2267
jmp 0x2c227e
movl $0xffff8000, %r15d      # imm = 0xFFFF8000
movq 0x18(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
callq 0x2c26e5
movl 0x38(%r12), %edx
movq (%r12), %r8
movq %r14, %rdi
movl %r15d, 0x3c(%rsp)
movl %r15d, %esi
xorl %ecx, %ecx
callq 0x2bc937
cmpl $0x1, 0x10(%rsp)
jne 0x2c2334
movq 0x50(%rsp), %r15
movq (%r15), %rax
cmpw $0x0, 0x30(%rax)
jns 0x2c2340
movq 0x40(%rsp), %r14
movq %r14, %rdi
movl $0x11, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, %ebx
movq 0x18(%rsp), %r15
movq %r15, %rdi
movq 0x30(%rsp), %rsi
movl 0x3c(%rsp), %edx
movq %r12, %rcx
movl $0x60, %r8d
callq 0x2bc82f
movq (%r12), %rcx
leaq 0x115394(%rip), %rdx    # 0x3d769c
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2c1741
movl 0x90(%r14), %eax
movq (%r14), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2c2523
leaq 0x1fcb59(%rip), %rcx    # 0x4bee88
jmp 0x2c2542
cmpl $0x0, 0x10(%rsp)
movq 0x50(%rsp), %r15
jle 0x2c23ab
xorl %r14d, %r14d
movq 0x10(%r13), %rdi
movl %r14d, %esi
callq 0x2c0855
movq (%r15), %rcx
movswq 0x30(%rcx), %rcx
testq %rcx, %rcx
js 0x2c236b
movq 0x8(%r12), %rdx
shlq $0x5, %rcx
movb 0x19(%rdx,%rcx), %cl
jmp 0x2c236d
movb $0x44, %cl
movsbl %cl, %r13d
movq %rax, %rdi
movl %r13d, %esi
callq 0x2c0948
addb $-0x41, %al
cmpb $0x2, %al
setb %cl
cmpb $0x43, %r13b
setge %al
orb %cl, %al
incq %r14
cmpq 0x10(%rsp), %r14
movq 0x20(%rsp), %r13
jae 0x2c23a3
addq $0x18, %r15
testb %al, %al
jne 0x2c2343
testb %al, %al
je 0x2c1a7f
movq 0x10(%r12), %r12
testq %r12, %r12
je 0x2c1a7f
movq $-0x1, %rax
movq 0x10(%rsp), %rcx
shlq %cl, %rax
movq %rax, 0x48(%rsp)
leaq 0x10ef0c(%rip), %r15    # 0x3d12e0
movzwl 0x60(%r12), %eax
cmpl %eax, 0x10(%rsp)
jg 0x2c2510
cmpw $0x3e, %ax
ja 0x2c2510
cmpq $0x0, 0x48(%r12)
jne 0x2c2510
testb $0x4, %bpl
jne 0x2c24d8
cmpl $0x0, 0x10(%rsp)
jle 0x2c2503
xorl %r14d, %r14d
xorl %esi, %esi
movq %rsi, 0x28(%rsp)
movq 0x10(%r13), %rdi
movl %r14d, %esi
callq 0x2c0855
leaq (%r14,%r14,2), %rcx
movq 0x50(%rsp), %rdx
movq (%rdx,%rcx,8), %r13
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x2a9634
movq 0x8(%r12), %rdx
movzwl 0x30(%r13), %esi
movq 0x20(%rsp), %r13
xorl %ecx, %ecx
cmpw %si, (%rdx,%rcx,2)
jne 0x2c2492
testq %rax, %rax
je 0x2c249e
movq (%rax), %rdi
movq 0x40(%r12), %r8
movq (%r8,%rcx,8), %r8
xorl %r9d, %r9d
movzbl (%rdi,%r9), %r10d
movzbl (%r8,%r9), %r11d
cmpb %r11b, %r10b
jne 0x2c2483
testq %r10, %r10
jne 0x2c248d
jmp 0x2c249e
movb (%r10,%r15), %r10b
cmpb (%r11,%r15), %r10b
jne 0x2c2492
incq %r9
jmp 0x2c246d
incq %rcx
cmpq 0x10(%rsp), %rcx
jne 0x2c2453
jmp 0x2c24fc
cmpl %ecx, 0x10(%rsp)
je 0x2c24fc
movl $0x1, %eax
shlq %cl, %rax
movq 0x28(%rsp), %rsi
btq %rcx, %rsi
jb 0x2c2505
movq 0x68(%rsp), %rdx
testq %rdx, %rdx
je 0x2c24c5
movl %ecx, (%rdx,%r14,4)
orq %rax, %rsi
incq %r14
cmpq 0x10(%rsp), %r14
jne 0x2c2414
jmp 0x2c2505
movzwl 0x5e(%r12), %ecx
cmpl %ecx, 0x10(%rsp)
jl 0x2c2510
cmpl %eax, 0x10(%rsp)
jae 0x2c2404
cmpb $0x0, 0x62(%r12)
jne 0x2c2404
jmp 0x2c2510
movq 0x28(%rsp), %rsi
jmp 0x2c2505
xorl %esi, %esi
xorq 0x48(%rsp), %rsi
cmpq $-0x1, %rsi
je 0x2c2550
movq 0x28(%r12), %r12
testq %r12, %r12
jne 0x2c23d4
jmp 0x2c1a7f
leal -0x1(%rax), %ecx
testl %ebx, %ebx
cmovnsl %ebx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq 0x40(%rsp), %rdx
addq 0x88(%rdx), %rcx
movl %eax, 0x8(%rcx)
movl $0x1, %r15d
jmp 0x2c2624
movq 0x40(%rsp), %r14
movq %r14, %rdi
movl $0x11, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, %ebp
movq (%r12), %rcx
leaq 0x115155(%rip), %rdx    # 0x3d76cb
movq 0x18(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2c1741
movl 0x58(%r12), %ecx
movq %r14, %rdi
movl $0x60, %esi
movq 0x30(%rsp), %rdx
movl 0x3c(%rsp), %r8d
callq 0x2a83e1
movq %r15, %rdi
movq %r12, %rsi
callq 0x2bca31
movq 0x38(%r12), %rax
movzbl (%rax), %r15d
testq %rbx, %rbx
je 0x2c25e1
movq 0x18(%rsp), %rax
movl 0x38(%rax), %edx
incl %edx
movl %edx, 0x38(%rax)
movl %edx, (%rbx)
cmpl $0x1, 0x10(%rsp)
jne 0x2c25e1
movq 0x40(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x2c2716
movq 0x40(%rsp), %rcx
movl 0x90(%rcx), %eax
movq (%rcx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2c25fe
leaq 0x1fc88c(%rip), %rcx    # 0x4bee88
jmp 0x2c261d
leal -0x1(%rax), %ecx
testl %ebp, %ebp
cmovnsl %ebp, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq 0x40(%rsp), %rdx
addq 0x88(%rdx), %rcx
addl $0x3, %r15d
movl %eax, 0x8(%rcx)
movq 0x20(%rsp), %r13
jmp 0x2c20db