// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: lookupName
static int lookupName(
  Parse *pParse,       /* The parsing context */
  const char *zDb,     /* Name of the database containing table, or NULL */
  const char *zTab,    /* Name of table containing column, or NULL */
  const char *zCol,    /* Name of the column. */
  NameContext *pNC,    /* The name context used to resolve the name */
  Expr *pExpr          /* Make this EXPR node point to the selected column */
){
  int i, j;                         /* Loop counters */
  int cnt = 0;                      /* Number of matching column names */
  int cntTab = 0;                   /* Number of matching table names */
  int nSubquery = 0;                /* How many levels of subquery */
  sqlite3 *db = pParse->db;         /* The database connection */
  struct SrcList_item *pItem;       /* Use for looping over pSrcList items */
  struct SrcList_item *pMatch = 0;  /* The matching pSrcList item */
  NameContext *pTopNC = pNC;        /* First namecontext in the list */
  Schema *pSchema = 0;              /* Schema of the expression */
  int isTrigger = 0;

  assert( pNC );     /* the name context cannot be NULL. */
  assert( zCol );    /* The Z in X.Y.Z cannot be NULL */
  assert( !ExprHasAnyProperty(pExpr, EP_TokenOnly|EP_Reduced) );

  /* Initialize the node to no-match */
  pExpr->iTable = -1;
  pExpr->pTab = 0;
  ExprSetIrreducible(pExpr);

  /* Translate the schema name in zDb into a pointer to the corresponding
  ** schema.  If not found, pSchema will remain NULL and nothing will match
  ** resulting in an appropriate error message toward the end of this routine
  */
  if( zDb ){
    testcase( pNC->ncFlags & NC_PartIdx );
    testcase( pNC->ncFlags & NC_IsCheck );
    if( (pNC->ncFlags & (NC_PartIdx|NC_IsCheck))!=0 ){
      /* Silently ignore database qualifiers inside CHECK constraints and partial
      ** indices.  Do not raise errors because that might break legacy and
      ** because it does not hurt anything to just ignore the database name. */
      zDb = 0;
    }else{
      for(i=0; i<db->nDb; i++){
        assert( db->aDb[i].zName );
        if( sqlite3StrICmp(db->aDb[i].zName,zDb)==0 ){
          pSchema = db->aDb[i].pSchema;
          break;
        }
      }
    }
  }

  /* Start at the inner-most context and move outward until a match is found */
  while( pNC && cnt==0 ){
    ExprList *pEList;
    SrcList *pSrcList = pNC->pSrcList;

    if( pSrcList ){
      for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
        Table *pTab;
        Column *pCol;
  
        pTab = pItem->pTab;
        assert( pTab!=0 && pTab->zName!=0 );
        assert( pTab->nCol>0 );
        if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){
          int hit = 0;
          pEList = pItem->pSelect->pEList;
          for(j=0; j<pEList->nExpr; j++){
            if( sqlite3MatchSpanName(pEList->a[j].zSpan, zCol, zTab, zDb) ){
              cnt++;
              cntTab = 2;
              pMatch = pItem;
              pExpr->iColumn = j;
              hit = 1;
            }
          }
          if( hit || zTab==0 ) continue;
        }
        if( zDb && pTab->pSchema!=pSchema ){
          continue;
        }
        if( zTab ){
          const char *zTabName = pItem->zAlias ? pItem->zAlias : pTab->zName;
          assert( zTabName!=0 );
          if( sqlite3StrICmp(zTabName, zTab)!=0 ){
            continue;
          }
        }
        if( 0==(cntTab++) ){
          pMatch = pItem;
        }
        for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
          if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
            /* If there has been exactly one prior match and this match
            ** is for the right-hand table of a NATURAL JOIN or is in a 
            ** USING clause, then skip this match.
            */
            if( cnt==1 ){
              if( pItem->jointype & JT_NATURAL ) continue;
              if( nameInUsingClause(pItem->pUsing, zCol) ) continue;
            }
            cnt++;
            pMatch = pItem;
            /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
            pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j;
            break;
          }
        }
      }
      if( pMatch ){
        pExpr->iTable = pMatch->iCursor;
        pExpr->pTab = pMatch->pTab;
        pSchema = pExpr->pTab->pSchema;
      }
    } /* if( pSrcList ) */

#ifndef SQLITE_OMIT_TRIGGER
    /* If we have not already resolved the name, then maybe 
    ** it is a new.* or old.* trigger argument reference
    */
    if( zDb==0 && zTab!=0 && cnt==0 && pParse->pTriggerTab!=0 ){
      int op = pParse->eTriggerOp;
      Table *pTab = 0;
      assert( op==TK_DELETE || op==TK_UPDATE || op==TK_INSERT );
      if( op!=TK_DELETE && sqlite3StrICmp("new",zTab) == 0 ){
        pExpr->iTable = 1;
        pTab = pParse->pTriggerTab;
      }else if( op!=TK_INSERT && sqlite3StrICmp("old",zTab)==0 ){
        pExpr->iTable = 0;
        pTab = pParse->pTriggerTab;
      }

      if( pTab ){ 
        int iCol;
        pSchema = pTab->pSchema;
        cntTab++;
        for(iCol=0; iCol<pTab->nCol; iCol++){
          Column *pCol = &pTab->aCol[iCol];
          if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
            if( iCol==pTab->iPKey ){
              iCol = -1;
            }
            break;
          }
        }
        if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) ){
          iCol = -1;        /* IMP: R-44911-55124 */
        }
        if( iCol<pTab->nCol ){
          cnt++;
          if( iCol<0 ){
            pExpr->affinity = SQLITE_AFF_INTEGER;
          }else if( pExpr->iTable==0 ){
            testcase( iCol==31 );
            testcase( iCol==32 );
            pParse->oldmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol));
          }else{
            testcase( iCol==31 );
            testcase( iCol==32 );
            pParse->newmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol));
          }
          pExpr->iColumn = (i16)iCol;
          pExpr->pTab = pTab;
          isTrigger = 1;
        }
      }
    }
#endif /* !defined(SQLITE_OMIT_TRIGGER) */

    /*
    ** Perhaps the name is a reference to the ROWID
    */
    if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) ){
      cnt = 1;
      pExpr->iColumn = -1;     /* IMP: R-44911-55124 */
      pExpr->affinity = SQLITE_AFF_INTEGER;
    }

    /*
    ** If the input is of the form Z (not Y.Z or X.Y.Z) then the name Z
    ** might refer to an result-set alias.  This happens, for example, when
    ** we are resolving names in the WHERE clause of the following command:
    **
    **     SELECT a+b AS x FROM table WHERE x<10;
    **
    ** In cases like this, replace pExpr with a copy of the expression that
    ** forms the result set entry ("a+b" in the example) and return immediately.
    ** Note that the expression in the result set should have already been
    ** resolved by the time the WHERE clause is resolved.
    **
    ** The ability to use an output result-set column in the WHERE, GROUP BY,
    ** or HAVING clauses, or as part of a larger expression in the ORDRE BY
    ** clause is not standard SQL.  This is a (goofy) SQLite extension, that
    ** is supported for backwards compatibility only.  TO DO: Issue a warning
    ** on sqlite3_log() whenever the capability is used.
    */
    if( (pEList = pNC->pEList)!=0
     && zTab==0
     && cnt==0
    ){
      for(j=0; j<pEList->nExpr; j++){
        char *zAs = pEList->a[j].zName;
        if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){
          Expr *pOrig;
          assert( pExpr->pLeft==0 && pExpr->pRight==0 );
          assert( pExpr->x.pList==0 );
          assert( pExpr->x.pSelect==0 );
          pOrig = pEList->a[j].pExpr;
          if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){
            sqlite3ErrorMsg(pParse, "misuse of aliased aggregate %s", zAs);
            return WRC_Abort;
          }
          resolveAlias(pParse, pEList, j, pExpr, "", nSubquery);
          cnt = 1;
          pMatch = 0;
          assert( zTab==0 && zDb==0 );
          goto lookupname_end;
        }
      } 
    }

    /* Advance to the next name context.  The loop will exit when either
    ** we have a match (cnt>0) or when we run out of name contexts.
    */
    if( cnt==0 ){
      pNC = pNC->pNext;
      nSubquery++;
    }
  }

  /*
  ** If X and Y are NULL (in other words if only the column name Z is
  ** supplied) and the value of Z is enclosed in double-quotes, then
  ** Z is a string literal if it doesn't match any column names.  In that
  ** case, we need to return right away and not make any changes to
  ** pExpr.
  **
  ** Because no reference was made to outer contexts, the pNC->nRef
  ** fields are not changed in any context.
  */
  if( cnt==0 && zTab==0 && ExprHasProperty(pExpr,EP_DblQuoted) ){
    pExpr->op = TK_STRING;
    pExpr->pTab = 0;
    return WRC_Prune;
  }

  /*
  ** cnt==0 means there was not match.  cnt>1 means there were two or
  ** more matches.  Either way, we have an error.
  */
  if( cnt!=1 ){
    const char *zErr;
    zErr = cnt==0 ? "no such column" : "ambiguous column name";
    if( zDb ){
      sqlite3ErrorMsg(pParse, "%s: %s.%s.%s", zErr, zDb, zTab, zCol);
    }else if( zTab ){
      sqlite3ErrorMsg(pParse, "%s: %s.%s", zErr, zTab, zCol);
    }else{
      sqlite3ErrorMsg(pParse, "%s: %s", zErr, zCol);
    }
    pParse->checkSchema = 1;
    pTopNC->nErr++;
  }

  /* If a column from a table in pSrcList is referenced, then record
  ** this fact in the pSrcList.a[].colUsed bitmask.  Column 0 causes
  ** bit 0 to be set.  Column 1 sets bit 1.  And so forth.  If the
  ** column number is greater than the number of bits in the bitmask
  ** then set the high-order bit of the bitmask.
  */
  if( pExpr->iColumn>=0 && pMatch!=0 ){
    int n = pExpr->iColumn;
    testcase( n==BMS-1 );
    if( n>=BMS ){
      n = BMS-1;
    }
    assert( pMatch->iCursor==pExpr->iTable );
    pMatch->colUsed |= ((Bitmask)1)<<n;
  }

  /* Clean up and return
  */
  sqlite3ExprDelete(db, pExpr->pLeft);
  pExpr->pLeft = 0;
  sqlite3ExprDelete(db, pExpr->pRight);
  pExpr->pRight = 0;
  pExpr->op = (isTrigger ? TK_TRIGGER : TK_COLUMN);
lookupname_end:
  if( cnt==1 ){
    assert( pNC!=0 );
    if( pExpr->op!=TK_AS ){
      sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
    }
    /* Increment the nRef value on all name contexts from TopNC up to
    ** the point where the name matched. */
    for(;;){
      assert( pTopNC!=0 );
      pTopNC->nRef++;
      if( pTopNC==pNC ) break;
      pTopNC = pTopNC->pNext;
    }
    return WRC_Prune;
  } else {
    return WRC_Abort;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r13
movq (%rdi), %rax
movq %rax, -0xb8(%rbp)
orl $-0x1, 0x2c(%r9)
movq %rcx, -0x68(%rbp)
andq $0x0, 0x40(%r9)
movq %rdx, %r9
testq %rsi, %rsi
movq %rdx, -0x58(%rbp)
movq %rdi, -0x40(%rbp)
je 0x43492
xorl %r12d, %r12d
testb $0x14, 0x30(%r8)
jne 0x43495
movq %rsi, -0x60(%rbp)
xorl %eax, %eax
movq %r8, %r12
movq -0xb8(%rbp), %rcx
movl 0x28(%rcx), %ebx
testl %ebx, %ebx
cmovlel %eax, %ebx
shlq $0x5, %rbx
addq $0x20, %rbx
xorl %ecx, %ecx
leaq 0x20(%rcx), %r14
cmpq %r14, %rbx
je 0x43499
movq -0xb8(%rbp), %rax
movq 0x20(%rax), %r15
movq (%r15,%rcx), %rdi
movq -0x60(%rbp), %rsi
callq 0xb1bf
movq %r14, %rcx
testl %eax, %eax
jne 0x43459
movq -0x8(%r15,%r14), %rax
movq %r12, %r8
movq %rax, %r12
movq -0x40(%rbp), %rdi
jmp 0x434a3
xorl %r12d, %r12d
xorl %ecx, %ecx
jmp 0x434ab
movq %r12, %r8
movq -0x40(%rbp), %rdi
xorl %r12d, %r12d
movq -0x58(%rbp), %r9
movq -0x60(%rbp), %rcx
testq %r9, %r9
setne %al
movq %rcx, -0x60(%rbp)
testq %rcx, %rcx
sete %cl
andb %al, %cl
movb %cl, -0x31(%rbp)
leaq 0x1e0(%rdi), %rax
movq %rax, -0xc8(%rbp)
movq $0x0, -0x80(%rbp)
movl $0x0, -0xa0(%rbp)
movl $0x0, -0x9c(%rbp)
movq $0x0, -0x30(%rbp)
movq %r8, -0xb0(%rbp)
movq %r8, -0x78(%rbp)
movq %r13, -0x98(%rbp)
xorl %edx, %edx
testl %edx, %edx
movq -0x78(%rbp), %rax
jne 0x43a57
testq %rax, %rax
je 0x43a57
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x437d0
movzbl (%rcx), %eax
movl %eax, -0xbc(%rbp)
addq $0x8, %rcx
movl $0x0, -0x50(%rbp)
xorl %edx, %edx
movq %r12, -0x88(%rbp)
movq -0x60(%rbp), %r14
movq -0x30(%rbp), %rdi
cmpl -0xbc(%rbp), %edx
je 0x437b2
movq 0x20(%rcx), %rax
movq %rax, -0x90(%rbp)
movq %rcx, -0x48(%rbp)
movq 0x28(%rcx), %rax
testq %rax, %rax
je 0x4357b
testb $0x2, 0xb(%rax)
jne 0x436a2
movq -0x48(%rbp), %rcx
testq %r14, %r14
je 0x43591
movq -0x90(%rbp), %rax
cmpq %r12, 0x68(%rax)
jne 0x435d9
testq %r9, %r9
je 0x435e0
movq %rdi, -0x30(%rbp)
movq %r12, %r15
movq %r13, %r12
movl %edx, %r13d
movq 0x18(%rcx), %rdi
testq %rdi, %rdi
jne 0x435b6
movq -0x90(%rbp), %rax
movq (%rax), %rdi
movq %r9, %rsi
movq %r9, %rbx
callq 0xb1bf
testl %eax, %eax
movq -0x48(%rbp), %rcx
movl %r13d, %edx
movq -0x30(%rbp), %rdi
je 0x435e0
movq %rbx, %r9
movq %r12, %r13
movq %r15, %r12
movl %edi, %eax
jmp 0x437a5
movl %edx, -0x6c(%rbp)
testl %edi, %edi
movq -0x80(%rbp), %rax
cmoveq %rcx, %rax
movq %rax, -0x80(%rbp)
leal 0x1(%rdi), %eax
movl %eax, -0xa4(%rbp)
movq -0x90(%rbp), %rax
movq 0x8(%rax), %r15
movzwl 0x42(%rax), %eax
xorl %r12d, %r12d
testw %ax, %ax
cmovlel %r12d, %eax
movzwl %ax, %eax
movl %eax, -0x30(%rbp)
cmpl -0x30(%rbp), %r12d
je 0x43782
movq (%r15), %rdi
movq -0x68(%rbp), %rsi
callq 0xb1bf
testl %eax, %eax
jne 0x43696
cmpl $0x1, -0x50(%rbp)
jne 0x43743
movq -0x48(%rbp), %rax
testb $0x4, 0x38(%rax)
jne 0x43696
movq -0x48(%rbp), %rax
movq 0x48(%rax), %rbx
testq %rbx, %rbx
je 0x43743
movl 0x8(%rbx), %r13d
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
shlq $0x4, %r13
addq $0x10, %r13
xorl %ecx, %ecx
leaq 0x10(%rcx), %r14
cmpq %r14, %r13
je 0x43743
movq (%rbx), %rax
movq (%rax,%rcx), %rdi
movq -0x68(%rbp), %rsi
callq 0xb1bf
movq %r14, %rcx
testl %eax, %eax
jne 0x43672
incl %r12d
addq $0x30, %r15
jmp 0x43619
movl %edx, -0x6c(%rbp)
movq %rdi, -0x30(%rbp)
movq (%rax), %r14
movl (%r14), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
pushq $0x10
popq %r13
xorl %ebx, %ebx
cmpq %r12, %r15
je 0x4370b
movq 0x8(%r14), %rax
movq (%rax,%r13), %rdi
movq -0x68(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0x43e73
testl %eax, %eax
je 0x43702
incl -0x50(%rbp)
movq -0x98(%rbp), %rax
movw %r12w, 0x30(%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x80(%rbp)
pushq $0x1
popq %rbx
pushq $0x2
popq %rax
movq %rax, -0x30(%rbp)
incq %r12
addq $0x20, %r13
jmp 0x436bf
movq -0x58(%rbp), %r9
testq %r9, %r9
sete %al
testl %ebx, %ebx
setne %cl
orb %al, %cl
movq -0x30(%rbp), %rdi
movl %edi, %eax
movq -0x98(%rbp), %r13
movq -0x88(%rbp), %r12
movq -0x60(%rbp), %r14
movq -0x48(%rbp), %rcx
movl -0x6c(%rbp), %edx
je 0x4357f
jmp 0x437a5
incl -0x50(%rbp)
movq -0x90(%rbp), %rax
movswl 0x40(%rax), %eax
cmpl %eax, %r12d
movl $0xffff, %eax           # imm = 0xFFFF
cmovel %eax, %r12d
movq -0x98(%rbp), %r13
movw %r12w, 0x30(%r13)
movq -0x48(%rbp), %rcx
movq %rcx, -0x80(%rbp)
movq -0x88(%rbp), %r12
movq -0x58(%rbp), %r9
movq -0x60(%rbp), %r14
jmp 0x4379c
movq -0x98(%rbp), %r13
movq -0x88(%rbp), %r12
movq -0x58(%rbp), %r9
movq -0x60(%rbp), %r14
movq -0x48(%rbp), %rcx
movl -0x6c(%rbp), %edx
movl -0xa4(%rbp), %eax
incl %edx
addq $0x68, %rcx
movl %eax, %edi
jmp 0x4354d
movq -0x80(%rbp), %rcx
testq %rcx, %rcx
je 0x437d8
movl 0x3c(%rcx), %eax
movl %eax, 0x2c(%r13)
movq 0x20(%rcx), %rax
movq %rax, 0x40(%r13)
movq 0x68(%rax), %r12
jmp 0x437e0
xorl %edx, %edx
movq -0x30(%rbp), %rdi
jmp 0x437e3
movq $0x0, -0x80(%rbp)
movl -0x50(%rbp), %edx
testl %edx, %edx
sete %al
andb -0x31(%rbp), %al
cmpb $0x1, %al
jne 0x4395a
movq -0xc8(%rbp), %rax
movq (%rax), %rbx
testq %rbx, %rbx
je 0x43860
movq %rdi, -0x30(%rbp)
movq -0x40(%rbp), %rax
movb 0x1f4(%rax), %r14b
cmpb $0x6a, %r14b
je 0x4383a
leaq 0x297a4(%rip), %rdi     # 0x6cfc2
movq %r9, %r15
movq %r9, %rsi
callq 0xb1bf
testl %eax, %eax
je 0x4386e
cmpb $0x69, %r14b
movq %r15, %r9
je 0x43954
leaq 0x29785(%rip), %rdi     # 0x6cfc6
movq %r9, %r15
movq %r9, %rsi
callq 0xb1bf
xorl %ecx, %ecx
testl %eax, %eax
movq -0x30(%rbp), %rdi
je 0x43867
xorl %edx, %edx
movq %r15, %r9
jmp 0x4395a
xorl %edx, %edx
jmp 0x4395a
movb $0x1, %al
movl %eax, -0x48(%rbp)
jmp 0x4387c
movl $0x0, -0x48(%rbp)
pushq $0x1
popq %rcx
movq -0x30(%rbp), %rdi
movl %ecx, 0x2c(%r13)
movq 0x68(%rbx), %rax
movq %rax, -0x88(%rbp)
incl %edi
movq %rdi, -0x30(%rbp)
movswl 0x42(%rbx), %r14d
testl %r14d, %r14d
movl $0x0, %r12d
cmovgl %r14d, %r12d
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x438e3
movq 0x8(%rbx), %rax
movq (%rax,%r13), %rdi
movq -0x68(%rbp), %rsi
callq 0xb1bf
testl %eax, %eax
je 0x438cc
incq %r15
addq $0x30, %r13
jmp 0x438a9
movswq 0x40(%rbx), %rax
cmpq %r15, %rax
pushq $-0x1
popq %rax
cmovel %eax, %r15d
movl %r15d, %r12d
cmpl %r14d, %r15d
jl 0x438fa
movq -0x68(%rbp), %rdi
callq 0x43f30
negl %eax
movl $0x0, %r15d
sbbl %r15d, %r15d
orl %r12d, %r15d
cmpl %r14d, %r15d
movq -0x98(%rbp), %r13
jge 0x43949
testl %r15d, %r15d
movq -0x88(%rbp), %r12
movq -0x30(%rbp), %rdi
js 0x439b8
pushq $0x1
popq %rax
movl %r15d, %ecx
shll %cl, %eax
cmpl $0x20, %r15d
pushq $-0x1
popq %rcx
cmovael %ecx, %eax
cmpb $0x0, -0x48(%rbp)
movq -0x58(%rbp), %r9
je 0x439c3
movq -0x40(%rbp), %rcx
orl %eax, 0x1ec(%rcx)
jmp 0x439cd
movq -0x88(%rbp), %r12
movq -0x58(%rbp), %r9
xorl %edx, %edx
movq -0x30(%rbp), %rdi
testl %edx, %edx
jne 0x43991
cmpl $0x1, %edi
jne 0x43991
movq %r9, %rbx
movq -0x68(%rbp), %rdi
callq 0x43f30
testl %eax, %eax
je 0x43987
orw $-0x1, 0x30(%r13)
movb $0x64, 0x1(%r13)
pushq $0x1
popq %rax
movl %eax, %edi
movl %eax, %edx
jmp 0x4398e
xorl %edx, %edx
pushq $0x1
popq %rax
movl %eax, %edi
movq %rbx, %r9
movq %rdi, -0x30(%rbp)
testl %edx, %edx
jne 0x439ab
testq %r9, %r9
jne 0x439ab
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rsi
testq %rsi, %rsi
jne 0x439e3
testl %edx, %edx
jne 0x43506
jmp 0x43a40
movb $0x64, 0x1(%r13)
movq -0x58(%rbp), %r9
jmp 0x439cd
movq -0x40(%rbp), %rcx
orl %eax, 0x1f0(%rcx)
movw %r15w, 0x30(%r13)
movq %rbx, 0x40(%r13)
pushq $0x1
popq %rax
movl %eax, -0xa0(%rbp)
movl %eax, %edx
jmp 0x43991
movl (%rsi), %ecx
testl %ecx, %ecx
movl $0x0, %eax
cmovlel %eax, %ecx
movq %rcx, -0x48(%rbp)
pushq $0x8
popq %r14
xorl %r15d, %r15d
movq %rsi, -0x90(%rbp)
cmpq %r15, -0x48(%rbp)
je 0x43a40
movq 0x8(%rsi), %rax
movq %rax, -0x50(%rbp)
movq (%rax,%r14), %rbx
testq %rbx, %rbx
je 0x43a33
movq %rbx, %rdi
movq -0x68(%rbp), %rsi
callq 0xb1bf
movq -0x90(%rbp), %rsi
testl %eax, %eax
je 0x43ad2
incq %r15
addq $0x20, %r14
movq -0x58(%rbp), %r9
jmp 0x43a01
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x78(%rbp)
incl -0x9c(%rbp)
jmp 0x43504
testq %r9, %r9
movq -0x60(%rbp), %rcx
movl %edx, -0x50(%rbp)
jne 0x43a86
testl %edx, %edx
jne 0x43a86
testb $0x40, 0x2(%r13)
movq -0xb0(%rbp), %rbx
je 0x43a96
movb $0x5e, (%r13)
andq $0x0, 0x40(%r13)
pushq $0x1
jmp 0x43ca0
cmpl $0x1, %edx
movq -0xb0(%rbp), %rbx
je 0x43b79
cmpl $0x0, -0x50(%rbp)
leaq 0x29548(%rip), %rax     # 0x6cfe9
leaq 0x29550(%rip), %rdx     # 0x6cff8
cmoveq %rax, %rdx
testq %rcx, %rcx
je 0x43b1b
leaq 0x29556(%rip), %rsi     # 0x6d00e
movq -0x40(%rbp), %r14
movq %r14, %rdi
movq %r9, %r8
movq -0x68(%rbp), %r9
xorl %eax, %eax
callq 0x104d6
jmp 0x43b71
movq -0x78(%rbp), %rax
testb $0x1, 0x30(%rax)
jne 0x43aeb
movq -0x50(%rbp), %rax
movq -0x8(%rax,%r14), %rax
testb $0x2, 0x2(%rax)
jne 0x43b3e
leaq 0x2c853(%rip), %r8      # 0x70345
movq -0x40(%rbp), %rdi
movl %r15d, %edx
movq %r13, %rcx
movl -0x9c(%rbp), %r9d
callq 0x43f81
movb (%r13), %r14b
cmpb $0x18, %r14b
jne 0x43beb
jmp 0x43c82
testq %r9, %r9
je 0x43b58
leaq 0x28f03(%rip), %rsi     # 0x6ca2a
movq -0x40(%rbp), %r14
movq %r14, %rdi
movq %r9, %rcx
movq -0x68(%rbp), %r8
xorl %eax, %eax
callq 0x104d6
jmp 0x43b71
leaq 0x29485(%rip), %rsi     # 0x6cfca
movq -0x40(%rbp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x104d6
jmp 0x43c9e
leaq 0x28ed5(%rip), %rsi     # 0x6ca34
movq -0x40(%rbp), %r14
movq %r14, %rdi
movq -0x68(%rbp), %rcx
xorl %eax, %eax
callq 0x104d6
movb $0x1, 0x1d(%r14)
incl 0x2c(%rbx)
movzwl 0x30(%r13), %eax
testw %ax, %ax
movq -0x80(%rbp), %rdx
js 0x43ba0
testq %rdx, %rdx
je 0x43ba0
cmpw $0x3f, %ax
pushq $0x3f
popq %rcx
cmovbl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, 0x50(%rdx)
movq 0x10(%r13), %rsi
movq -0xb8(%rbp), %rbx
movq %rbx, %rdi
callq 0x2f476
andq $0x0, 0x10(%r13)
movq 0x18(%r13), %rsi
movq %rbx, %rdi
callq 0x2f476
andq $0x0, 0x18(%r13)
cmpl $0x0, -0xa0(%rbp)
movl $0x98, %eax
pushq $0x3c
popq %r14
cmovel %eax, %r14d
movb %r14b, (%r13)
cmpl $0x1, -0x50(%rbp)
jne 0x43c9e
movq -0x40(%rbp), %rax
movq (%rax), %rdi
cmpq $0x0, 0x180(%rdi)
je 0x43c82
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rbx
movq %r12, %rsi
callq 0x1064e
testl %eax, %eax
js 0x43c82
cmpb $0x3c, %r14b
movq -0xc8(%rbp), %rsi
je 0x43c43
movzbl (%rbx), %ecx
addq $-0x40, %rbx
incq %rcx
decq %rcx
je 0x43c82
leaq 0x68(%rbx), %rsi
movl 0x2c(%r13), %edx
cmpl 0x84(%rbx), %edx
movq %rsi, %rbx
jne 0x43c2b
movq (%rsi), %rcx
testq %rcx, %rcx
je 0x43c82
movswq 0x30(%r13), %rdx
testw %dx, %dx
jns 0x43c5f
movswq 0x40(%rcx), %rdx
testq %rdx, %rdx
js 0x43cb3
imulq $0x30, %rdx, %rdx
addq 0x8(%rcx), %rdx
movq -0x40(%rbp), %rdi
movq (%rdx), %rdx
movq (%rcx), %rsi
movl %eax, %ecx
callq 0x448e5
cmpl $0x2, %eax
jne 0x43c82
movb $0x62, (%r13)
pushq $0x1
popq %rax
movq -0xb0(%rbp), %rcx
movq -0x78(%rbp), %rdx
incl 0x28(%rcx)
cmpq %rdx, %rcx
je 0x43ca1
movq 0x20(%rcx), %rcx
jmp 0x43c90
pushq $0x2
popq %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29369(%rip), %rdx     # 0x6d023
movq -0x40(%rbp), %rdi
jmp 0x43c6e