// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: exprAnalyze
static void exprAnalyze(
  SrcList *pSrc,            /* the FROM clause */
  WhereClause *pWC,         /* the WHERE clause */
  int idxTerm               /* Index of the term to be analyzed */
){
  WhereInfo *pWInfo = pWC->pWInfo; /* WHERE clause processing context */
  WhereTerm *pTerm;                /* The term to be analyzed */
  WhereMaskSet *pMaskSet;          /* Set of table index masks */
  Expr *pExpr;                     /* The expression to be analyzed */
  Bitmask prereqLeft;              /* Prerequesites of the pExpr->pLeft */
  Bitmask prereqAll;               /* Prerequesites of pExpr */
  Bitmask extraRight = 0;          /* Extra dependencies on LEFT JOIN */
  Expr *pStr1 = 0;                 /* RHS of LIKE/GLOB operator */
  int isComplete = 0;              /* RHS of LIKE/GLOB ends with wildcard */
  int noCase = 0;                  /* LIKE/GLOB distinguishes case */
  int op;                          /* Top-level operator.  pExpr->op */
  Parse *pParse = pWInfo->pParse;  /* Parsing context */
  sqlite3 *db = pParse->db;        /* Database connection */

  if( db->mallocFailed ){
    return;
  }
  pTerm = &pWC->a[idxTerm];
  pMaskSet = &pWInfo->sMaskSet;
  pExpr = pTerm->pExpr;
  assert( pExpr->op!=TK_AS && pExpr->op!=TK_COLLATE );
  prereqLeft = exprTableUsage(pMaskSet, pExpr->pLeft);
  op = pExpr->op;
  if( op==TK_IN ){
    assert( pExpr->pRight==0 );
    if( ExprHasProperty(pExpr, EP_xIsSelect) ){
      pTerm->prereqRight = exprSelectTableUsage(pMaskSet, pExpr->x.pSelect);
    }else{
      pTerm->prereqRight = exprListTableUsage(pMaskSet, pExpr->x.pList);
    }
  }else if( op==TK_ISNULL ){
    pTerm->prereqRight = 0;
  }else{
    pTerm->prereqRight = exprTableUsage(pMaskSet, pExpr->pRight);
  }
  prereqAll = exprTableUsage(pMaskSet, pExpr);
  if( ExprHasProperty(pExpr, EP_FromJoin) ){
    Bitmask x = getMask(pMaskSet, pExpr->iRightJoinTable);
    prereqAll |= x;
    extraRight = x-1;  /* ON clause terms may not be used with an index
                       ** on left table of a LEFT JOIN.  Ticket #3015 */
  }
  pTerm->prereqAll = prereqAll;
  pTerm->leftCursor = -1;
  pTerm->iParent = -1;
  pTerm->eOperator = 0;
  if( allowedOp(op) ){
    Expr *pLeft = sqlite3ExprSkipCollate(pExpr->pLeft);
    Expr *pRight = sqlite3ExprSkipCollate(pExpr->pRight);
    u16 opMask = (pTerm->prereqRight & prereqLeft)==0 ? WO_ALL : WO_EQUIV;
    if( pLeft->op==TK_COLUMN ){
      pTerm->leftCursor = pLeft->iTable;
      pTerm->u.leftColumn = pLeft->iColumn;
      pTerm->eOperator = operatorMask(op) & opMask;
    }
    if( pRight && pRight->op==TK_COLUMN ){
      WhereTerm *pNew;
      Expr *pDup;
      u16 eExtraOp = 0;        /* Extra bits for pNew->eOperator */
      if( pTerm->leftCursor>=0 ){
        int idxNew;
        pDup = sqlite3ExprDup(db, pExpr, 0);
        if( db->mallocFailed ){
          sqlite3ExprDelete(db, pDup);
          return;
        }
        idxNew = whereClauseInsert(pWC, pDup, TERM_VIRTUAL|TERM_DYNAMIC);
        if( idxNew==0 ) return;
        pNew = &pWC->a[idxNew];
        pNew->iParent = idxTerm;
        pTerm = &pWC->a[idxTerm];
        pTerm->nChild = 1;
        pTerm->wtFlags |= TERM_COPIED;
        if( pExpr->op==TK_EQ
         && !ExprHasProperty(pExpr, EP_FromJoin)
         && OptimizationEnabled(db, SQLITE_Transitive)
        ){
          pTerm->eOperator |= WO_EQUIV;
          eExtraOp = WO_EQUIV;
        }
      }else{
        pDup = pExpr;
        pNew = pTerm;
      }
      exprCommute(pParse, pDup);
      pLeft = sqlite3ExprSkipCollate(pDup->pLeft);
      pNew->leftCursor = pLeft->iTable;
      pNew->u.leftColumn = pLeft->iColumn;
      testcase( (prereqLeft | extraRight) != prereqLeft );
      pNew->prereqRight = prereqLeft | extraRight;
      pNew->prereqAll = prereqAll;
      pNew->eOperator = (operatorMask(pDup->op) + eExtraOp) & opMask;
    }
  }

#ifndef SQLITE_OMIT_BETWEEN_OPTIMIZATION
  /* If a term is the BETWEEN operator, create two new virtual terms
  ** that define the range that the BETWEEN implements.  For example:
  **
  **      a BETWEEN b AND c
  **
  ** is converted into:
  **
  **      (a BETWEEN b AND c) AND (a>=b) AND (a<=c)
  **
  ** The two new terms are added onto the end of the WhereClause object.
  ** The new terms are "dynamic" and are children of the original BETWEEN
  ** term.  That means that if the BETWEEN term is coded, the children are
  ** skipped.  Or, if the children are satisfied by an index, the original
  ** BETWEEN term is skipped.
  */
  else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){
    ExprList *pList = pExpr->x.pList;
    int i;
    static const u8 ops[] = {TK_GE, TK_LE};
    assert( pList!=0 );
    assert( pList->nExpr==2 );
    for(i=0; i<2; i++){
      Expr *pNewExpr;
      int idxNew;
      pNewExpr = sqlite3PExpr(pParse, ops[i], 
                             sqlite3ExprDup(db, pExpr->pLeft, 0),
                             sqlite3ExprDup(db, pList->a[i].pExpr, 0), 0);
      transferJoinMarkings(pNewExpr, pExpr);
      idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC);
      testcase( idxNew==0 );
      exprAnalyze(pSrc, pWC, idxNew);
      pTerm = &pWC->a[idxTerm];
      pWC->a[idxNew].iParent = idxTerm;
    }
    pTerm->nChild = 2;
  }
#endif /* SQLITE_OMIT_BETWEEN_OPTIMIZATION */

#if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBQUERY)
  /* Analyze a term that is composed of two or more subterms connected by
  ** an OR operator.
  */
  else if( pExpr->op==TK_OR ){
    assert( pWC->op==TK_AND );
    exprAnalyzeOrTerm(pSrc, pWC, idxTerm);
    pTerm = &pWC->a[idxTerm];
  }
#endif /* SQLITE_OMIT_OR_OPTIMIZATION */

#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION
  /* Add constraints to reduce the search space on a LIKE or GLOB
  ** operator.
  **
  ** A like pattern of the form "x LIKE 'abc%'" is changed into constraints
  **
  **          x>='abc' AND x<'abd' AND x LIKE 'abc%'
  **
  ** The last character of the prefix "abc" is incremented to form the
  ** termination condition "abd".
  */
  if( pWC->op==TK_AND 
   && isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase)
  ){
    Expr *pLeft;       /* LHS of LIKE/GLOB operator */
    Expr *pStr2;       /* Copy of pStr1 - RHS of LIKE/GLOB operator */
    Expr *pNewExpr1;
    Expr *pNewExpr2;
    int idxNew1;
    int idxNew2;
    Token sCollSeqName;  /* Name of collating sequence */

    pLeft = pExpr->x.pList->a[1].pExpr;
    pStr2 = sqlite3ExprDup(db, pStr1, 0);
    if( !db->mallocFailed ){
      u8 c, *pC;       /* Last character before the first wildcard */
      pC = (u8*)&pStr2->u.zToken[sqlite3Strlen30(pStr2->u.zToken)-1];
      c = *pC;
      if( noCase ){
        /* The point is to increment the last character before the first
        ** wildcard.  But if we increment '@', that will push it into the
        ** alphabetic range where case conversions will mess up the 
        ** inequality.  To avoid this, make sure to also run the full
        ** LIKE on all candidate expressions by clearing the isComplete flag
        */
        if( c=='A'-1 ) isComplete = 0;
        c = sqlite3UpperToLower[c];
      }
      *pC = c + 1;
    }
    sCollSeqName.z = noCase ? "NOCASE" : "BINARY";
    sCollSeqName.n = 6;
    pNewExpr1 = sqlite3ExprDup(db, pLeft, 0);
    pNewExpr1 = sqlite3PExpr(pParse, TK_GE, 
           sqlite3ExprAddCollateToken(pParse,pNewExpr1,&sCollSeqName),
           pStr1, 0);
    transferJoinMarkings(pNewExpr1, pExpr);
    idxNew1 = whereClauseInsert(pWC, pNewExpr1, TERM_VIRTUAL|TERM_DYNAMIC);
    testcase( idxNew1==0 );
    exprAnalyze(pSrc, pWC, idxNew1);
    pNewExpr2 = sqlite3ExprDup(db, pLeft, 0);
    pNewExpr2 = sqlite3PExpr(pParse, TK_LT,
           sqlite3ExprAddCollateToken(pParse,pNewExpr2,&sCollSeqName),
           pStr2, 0);
    transferJoinMarkings(pNewExpr2, pExpr);
    idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC);
    testcase( idxNew2==0 );
    exprAnalyze(pSrc, pWC, idxNew2);
    pTerm = &pWC->a[idxTerm];
    if( isComplete ){
      pWC->a[idxNew1].iParent = idxTerm;
      pWC->a[idxNew2].iParent = idxTerm;
      pTerm->nChild = 2;
    }
  }
#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */

#ifndef SQLITE_OMIT_VIRTUALTABLE
  /* Add a WO_MATCH auxiliary term to the constraint set if the
  ** current expression is of the form:  column MATCH expr.
  ** This information is used by the xBestIndex methods of
  ** virtual tables.  The native query optimizer does not attempt
  ** to do anything with MATCH functions.
  */
  if( isMatchOfColumn(pExpr) ){
    int idxNew;
    Expr *pRight, *pLeft;
    WhereTerm *pNewTerm;
    Bitmask prereqColumn, prereqExpr;

    pRight = pExpr->x.pList->a[0].pExpr;
    pLeft = pExpr->x.pList->a[1].pExpr;
    prereqExpr = exprTableUsage(pMaskSet, pRight);
    prereqColumn = exprTableUsage(pMaskSet, pLeft);
    if( (prereqExpr & prereqColumn)==0 ){
      Expr *pNewExpr;
      pNewExpr = sqlite3PExpr(pParse, TK_MATCH, 
                              0, sqlite3ExprDup(db, pRight, 0), 0);
      idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC);
      testcase( idxNew==0 );
      pNewTerm = &pWC->a[idxNew];
      pNewTerm->prereqRight = prereqExpr;
      pNewTerm->leftCursor = pLeft->iTable;
      pNewTerm->u.leftColumn = pLeft->iColumn;
      pNewTerm->eOperator = WO_MATCH;
      pNewTerm->iParent = idxTerm;
      pTerm = &pWC->a[idxTerm];
      pTerm->nChild = 1;
      pTerm->wtFlags |= TERM_COPIED;
      pNewTerm->prereqAll = pTerm->prereqAll;
    }
  }
#endif /* SQLITE_OMIT_VIRTUALTABLE */

#ifdef SQLITE_ENABLE_STAT3
  /* When sqlite_stat3 histogram data is available an operator of the
  ** form "x IS NOT NULL" can sometimes be evaluated more efficiently
  ** as "x>NULL" if x is not an INTEGER PRIMARY KEY.  So construct a
  ** virtual term of that form.
  **
  ** Note that the virtual term must be tagged with TERM_VNULL.  This
  ** TERM_VNULL tag will suppress the not-null check at the beginning
  ** of the loop.  Without the TERM_VNULL flag, the not-null check at
  ** the start of the loop will prevent any results from being returned.
  */
  if( pExpr->op==TK_NOTNULL
   && pExpr->pLeft->op==TK_COLUMN
   && pExpr->pLeft->iColumn>=0
   && OptimizationEnabled(db, SQLITE_Stat3)
  ){
    Expr *pNewExpr;
    Expr *pLeft = pExpr->pLeft;
    int idxNew;
    WhereTerm *pNewTerm;

    pNewExpr = sqlite3PExpr(pParse, TK_GT,
                            sqlite3ExprDup(db, pLeft, 0),
                            sqlite3PExpr(pParse, TK_NULL, 0, 0, 0), 0);

    idxNew = whereClauseInsert(pWC, pNewExpr,
                              TERM_VIRTUAL|TERM_DYNAMIC|TERM_VNULL);
    if( idxNew ){
      pNewTerm = &pWC->a[idxNew];
      pNewTerm->prereqRight = 0;
      pNewTerm->leftCursor = pLeft->iTable;
      pNewTerm->u.leftColumn = pLeft->iColumn;
      pNewTerm->eOperator = WO_GT;
      pNewTerm->iParent = idxTerm;
      pTerm = &pWC->a[idxTerm];
      pTerm->nChild = 1;
      pTerm->wtFlags |= TERM_COPIED;
      pNewTerm->prereqAll = pTerm->prereqAll;
    }
  }
#endif /* SQLITE_ENABLE_STAT */

  /* Prevent ON clause terms of a LEFT JOIN from being used to drive
  ** an index for tables to the left of the join.
  */
  pTerm->prereqRight |= extraRight;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq (%rdi), %rdx
movq (%rdx), %rax
movq (%rax), %rcx
cmpb $0x0, 0x50(%rcx)
jne 0x4feaf
movq %rcx, -0x68(%rbp)
movq %rax, -0x58(%rbp)
movq %rdi, -0x38(%rbp)
movq 0x20(%rdi), %r13
movl %esi, -0x5c(%rbp)
movslq %esi, %rax
imulq $0x38, %rax, %rax
leaq (%rax,%r13), %r12
movq %rdx, -0x50(%rbp)
leaq 0x4c(%rdx), %r14
movq %rax, -0x88(%rbp)
movq (%r13,%rax), %rbx
movq 0x10(%rbx), %rsi
movq %r14, %rdi
movq %rsi, -0x40(%rbp)
callq 0x5034c
movq %rax, -0x48(%rbp)
movzbl (%rbx), %r15d
cmpl $0x49, %r15d
movq %rbx, -0x30(%rbp)
movq %r13, -0x90(%rbp)
je 0x4f546
cmpl $0x48, %r15d
jne 0x4f550
testb $0x8, 0x3(%rbx)
movq 0x20(%rbx), %rsi
movq %r14, %rdi
jne 0x4f55e
callq 0x4edb9
jmp 0x4f563
andq $0x0, 0x28(%r12)
xorl %ebx, %ebx
jmp 0x4f56b
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x5034c
jmp 0x4f563
callq 0x503c9
movq %rax, %rbx
movq %rax, 0x28(%r12)
movq %r14, %rdi
movq -0x30(%rbp), %r13
movq %r13, %rsi
callq 0x5034c
movq %rax, %rdx
testb $0x1, 0x2(%r13)
movq %r14, -0x80(%rbp)
jne 0x4f595
movq $0x0, -0x98(%rbp)
jmp 0x4f5b5
movswl 0x34(%r13), %esi
movq %r14, %rdi
movq %rdx, %r14
callq 0x4ee15
movq %r14, %rdx
orq %rax, %rdx
decq %rax
movq %rax, -0x98(%rbp)
movq %rdx, 0x30(%r12)
orq $-0x1, 0x8(%r12)
andw $0x0, 0x18(%r12)
leal -0x4c(%r15), %r14d
cmpl $0x5, %r14d
setae %al
movl %r15d, %ecx
andl $-0x2, %ecx
cmpl $0x48, %ecx
setne %cl
testb %al, %cl
je 0x4f6c5
cmpl $0x44, %r15d
je 0x4f737
cmpl $0x47, %r15d
jne 0x4f82e
movq -0x38(%rbp), %rax
cmpb $0x45, 0x10(%rax)
movq -0x30(%rbp), %rbx
jne 0x4f7bf
movq 0x20(%rbx), %rax
movq %rax, -0x48(%rbp)
leaq 0x1b289(%rip), %r13     # 0x6a8a4
xorl %r15d, %r15d
cmpq $0x40, %r15
je 0x4f7b9
movzbl (%r13), %r14d
movq 0x10(%rbx), %rsi
movq -0x68(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x440d6
movq %rax, %r12
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15), %rsi
movq %rbx, %rdi
movq -0x30(%rbp), %rbx
xorl %edx, %edx
callq 0x440d6
movq -0x58(%rbp), %rdi
movl %r14d, %esi
movq %r12, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x36a09
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x504bf
movq -0x38(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
pushq $0x3
popq %rdx
callq 0x4f3bf
movl %eax, %r14d
movq %r12, %rdi
movl %eax, %esi
callq 0x4f4aa
movq 0x20(%r12), %r12
movslq %r14d, %rax
imulq $0x38, %rax, %rax
movl -0x5c(%rbp), %ecx
movl %ecx, 0x8(%r12,%rax)
addq -0x88(%rbp), %r12
addq $0x20, %r15
incq %r13
jmp 0x4f61e
movq %rdx, -0x78(%rbp)
movq -0x40(%rbp), %rdi
callq 0x45e0b
movq %rax, %r13
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x45e0b
testq %rbx, -0x48(%rbp)
movl $0xfff, %ecx            # imm = 0xFFF
movl $0x400, %edx            # imm = 0x400
cmovel %ecx, %edx
cmpb $-0x68, (%r13)
pushq $0x2
popq %rsi
movzwl %dx, %ebx
jne 0x4f730
movl 0x2c(%r13), %edx
movl %edx, 0xc(%r12)
movswl 0x30(%r13), %ecx
movl %ecx, 0x10(%r12)
cmpl $0x48, %r15d
je 0x4f7c8
cmpl $0x49, %r15d
jne 0x4f7ce
movw $0x80, %si
jmp 0x4f7d3
xorl %ecx, %ecx
jmp 0x4f7e0
movq -0x68(%rbp), %rdi
movl $0x1f0, %esi            # imm = 0x1F0
callq 0xf4ae
movq %rax, 0x10(%r12)
movq %rax, -0x70(%rbp)
testq %rax, %rax
je 0x4f7a7
orb $0x10, 0x1a(%r12)
movq -0x50(%rbp), %rax
movq -0x70(%rbp), %rbx
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, 0x14(%rbx)
movq %rbx, %rax
addq $0x28, %rax
movq %rax, 0x20(%rbx)
pushq $0x44
popq %rdx
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x4e828
movq %rbx, %rdi
callq 0x4e890
movq -0x68(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x4f9fb
movq -0x38(%rbp), %r12
movq 0x20(%r12), %rdi
addq -0x88(%rbp), %rdi
jmp 0x4f835
movb $0x2, 0x1b(%r12)
movq %r12, %rdi
movq -0x38(%rbp), %r12
jmp 0x4f839
movw $0x1, %si
jmp 0x4f7d3
movl %r14d, %ecx
shll %cl, %esi
andl %ebx, %esi
movw %si, 0x18(%r12)
testl %edx, %edx
setns %cl
testq %rax, %rax
je 0x4f82e
cmpb $-0x68, (%rax)
jne 0x4f82e
testb %cl, %cl
je 0x4f9a2
movq -0x68(%rbp), %r14
movq %r14, %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x440d6
movq %rax, %r13
cmpb $0x0, 0x50(%r14)
je 0x4fc88
movq %r14, %rdi
movq %r13, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f476
movq %r12, %rdi
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rbx
cmpb $0x45, 0x10(%r12)
jne 0x4fdab
cmpb $-0x69, (%rbx)
jne 0x4fea4
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x4fdab
cmpl $0x2, (%rax)
jne 0x4fdab
movq %rdi, -0x48(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %r15
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x8f8e
pushq $0x2
popq %rcx
pushq $0x1
popq %r8
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
xorl %r9d, %r9d
callq 0x13a4e
testq %rax, %rax
je 0x4fda7
movb 0x3(%rax), %dl
testb $0x1, %dl
movq -0x48(%rbp), %rdi
je 0x4fdab
movq 0x20(%rbx), %rcx
movq 0x8(%rcx), %r13
movq 0x20(%r13), %r14
cmpb $-0x68, (%r14)
jne 0x4fdab
movb %dl, -0x78(%rbp)
movq 0x8(%rax), %rax
movb (%rax), %cl
movb %cl, -0x40(%rbp)
movb 0x1(%rax), %r12b
movb 0x2(%rax), %bl
movq %r14, %rdi
callq 0x4667c
cmpb $0x61, %al
jne 0x4fd9f
movq 0x40(%r14), %rax
testb $0x10, 0x46(%rax)
movq -0x48(%rbp), %rdi
jne 0x4fec1
movq (%r13), %r8
movb (%r8), %r9b
cmpb $-0x7c, %r9b
jne 0x4f907
movb 0x37(%r8), %r9b
cmpb $-0x7b, %r9b
movb -0x40(%rbp), %r10b
jne 0x4feca
movq -0x58(%rbp), %rax
movq 0x220(%rax), %rax
movswl 0x30(%r8), %r14d
testq %rax, %rax
je 0x4ff3b
movslq %r14d, %rcx
movq 0x78(%rax), %rdx
imulq $0x38, %rcx, %r13
testb $0x1, -0x14(%rdx,%r13)
jne 0x4ff3b
movq %rdx, -0x70(%rbp)
movb %r9b, -0x90(%rbp)
movq %r8, -0x50(%rbp)
movq (%rax), %rdi
callq 0x129fe
testq %rax, %rax
je 0x4ffee
movq -0x70(%rbp), %rcx
leaq (%rcx,%r13), %rsi
addq $-0x38, %rsi
movq %rax, %r13
movq %rax, %rdi
callq 0xe4e0
movq %r13, %rdi
callq 0xfe30
cmpb $0x3, 0x26(%r13)
jne 0x4fff2
movq %r13, %rdi
callq 0xdf1e
movq %r13, %rdi
movq %rax, %rdx
jmp 0x4fff7
xorl %r14d, %r14d
movq -0x30(%rbp), %r13
movq %r12, %r15
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rax
movzwl 0x2(%rax), %ecx
movl $0x100, %edi            # imm = 0x100
movl %ecx, %edx
andl %edi, %edx
movzwl 0x2(%rsi), %r8d
andl %edi, %r8d
cmpw %r8w, %dx
jne 0x4fd0b
testw %dx, %dx
jne 0x4fd01
movq -0x58(%rbp), %rdi
callq 0x466ee
movq 0x10(%r13), %rsi
testq %rax, %rax
je 0x4fd0b
orb $0x1, 0x3(%rsi)
jmp 0x4fd0b
movq -0x70(%rbp), %rax
movl 0x14(%rax), %esi
movq 0x20(%rax), %rbx
pushq $-0x1
popq %rdx
movq %rdx, %rcx
movq -0x80(%rbp), %rdi
testl %esi, %esi
jle 0x4fb89
testq %rdx, %rdx
je 0x4fb89
movzbl 0x18(%rbx), %r15d
testw %r15w, %r15w
je 0x4fa98
movb 0x1a(%rbx), %r13b
testb $0x8, %r13b
jne 0x4fb2e
movl %esi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rcx, -0x78(%rbp)
movl 0xc(%rbx), %esi
callq 0x4ee15
movq %rax, %r14
testb $0x2, %r13b
je 0x4fa76
movq -0x70(%rbp), %rax
movq 0x20(%rax), %rax
movslq 0x8(%rbx), %rcx
imulq $0x38, %rcx, %rcx
movl 0xc(%rax,%rcx), %esi
movq -0x80(%rbp), %rdi
callq 0x4ee15
orq %rax, %r14
movq -0x48(%rbp), %rdx
andq %r14, %rdx
movzwl %r15w, %eax
movq -0x78(%rbp), %rcx
andq %r14, %rcx
testb $0x2, %al
movl $0x0, %eax
cmoveq %rax, %rcx
jmp 0x4fb1b
movl %esi, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x68(%rbp), %r13
movq %r13, %rdi
movl $0x1e8, %esi            # imm = 0x1E8
callq 0x103b4
testq %rax, %rax
je 0x4fb21
movq %rax, %r14
movq %rax, 0x10(%rbx)
orb $0x20, 0x1a(%rbx)
movw $0x200, 0x18(%rbx)      # imm = 0x200
movq -0x38(%rbp), %r15
movq (%r15), %rax
movq %rax, (%r14)
andq $0x0, 0x8(%r14)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, 0x14(%r14)
movq %r14, %rax
addq $0x28, %rax
movq %rax, 0x20(%r14)
movq (%rbx), %rsi
movq %r14, %rdi
pushq $0x45
popq %rdx
callq 0x4e828
movq %r14, %rdi
callq 0x4e890
movq %r15, 0x8(%r14)
cmpb $0x0, 0x50(%r13)
je 0x4fb39
xorl %r14d, %r14d
movq -0x48(%rbp), %rdx
andq %r14, %rdx
xorl %ecx, %ecx
movq -0x80(%rbp), %rdi
jmp 0x4fb2b
xorl %ecx, %ecx
movq -0x80(%rbp), %rdi
movq -0x48(%rbp), %rdx
movl -0x40(%rbp), %esi
decl %esi
addq $0x38, %rbx
jmp 0x4fa10
movq 0x20(%r14), %r13
movl 0x14(%r14), %r15d
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %r14d, %r14d
subl $0x1, %r15d
jb 0x4fb12
movq (%r13), %rax
movzbl (%rax), %eax
leal -0x51(%rax), %ecx
cmpl $-0x5, %ecx
setb %cl
andl $-0x2, %eax
cmpl $0x48, %eax
setne %al
testb %cl, %al
jne 0x4fb83
movl 0xc(%r13), %esi
movq -0x80(%rbp), %rdi
callq 0x4ee15
orq %rax, %r14
addq $0x38, %r13
jmp 0x4fb50
movq -0x70(%rbp), %rax
movq %rdx, 0x1e8(%rax)
xorl %eax, %eax
testq %rdx, %rdx
setne %al
shll $0x8, %eax
movw %ax, 0x18(%r12)
movq %rcx, -0x78(%rbp)
testq %rcx, %rcx
je 0x4f7a7
pushq $-0x1
popq %r14
xorl %ebx, %ebx
xorl %eax, %eax
testl %ebx, %ebx
jne 0x4fedb
cmpl $0x1, %eax
ja 0x4fedb
movl %eax, -0x9c(%rbp)
movq -0x70(%rbp), %rax
movq 0x20(%rax), %rbx
movl 0x14(%rax), %r12d
leaq 0x1a(%rbx), %r13
testl %r12d, %r12d
jle 0x4f7a7
andb $-0x41, 0x1a(%rbx)
movl 0xc(%rbx), %r15d
cmpl %r14d, %r15d
je 0x4fc09
movq -0x80(%rbp), %rdi
movl %r15d, %esi
callq 0x4ee15
testq %rax, -0x78(%rbp)
jne 0x4fc16
addq $0x38, %rbx
decl %r12d
addq $0x38, %r13
jmp 0x4fbe1
movl 0x10(%rbx), %ecx
decl %r12d
pushq $0x1
popq %rbx
movl %ecx, -0x40(%rbp)
testl %ebx, %ebx
je 0x4fc78
testl %r12d, %r12d
js 0x4fc78
cmpl %r15d, -0xe(%r13)
jne 0x4fc67
xorl %ebx, %ebx
cmpl %ecx, -0xa(%r13)
jne 0x4fc6f
movq -0x1a(%r13), %r14
movq 0x18(%r14), %rdi
callq 0x4667c
movb %al, -0x48(%rbp)
movq 0x10(%r14), %rdi
callq 0x4667c
movb -0x48(%rbp), %dl
movl -0x40(%rbp), %ecx
testb %dl, %dl
je 0x4fc60
cmpb %al, %dl
jne 0x4fc6f
orb $0x40, (%r13)
jmp 0x4fc6c
andb $-0x41, (%r13)
pushq $0x1
popq %rbx
decl %r12d
addq $0x38, %r13
jmp 0x4fc22
movl -0x9c(%rbp), %eax
incl %eax
movl %r15d, %r14d
jmp 0x4fbba
pushq $0x3
popq %rdx
movq -0x38(%rbp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x4f3bf
testl %eax, %eax
movl -0x5c(%rbp), %edx
je 0x4feaf
movq 0x20(%r14), %rcx
cltq
imulq $0x38, %rax, %rax
movl %edx, 0x8(%rcx,%rax)
movq -0x88(%rbp), %rdx
movb $0x1, 0x1b(%rcx,%rdx)
orb $0x8, 0x1a(%rcx,%rdx)
leaq (%rcx,%rax), %r12
addq %rdx, %rcx
movq -0x30(%rbp), %rax
cmpb $0x4c, (%rax)
jne 0x4fd94
testb $0x1, 0x2(%rax)
jne 0x4fd94
movq -0x68(%rbp), %rax
testb $0x2, 0x4d(%rax)
jne 0x4fd94
movq %rcx, %r15
orb $0x4, 0x19(%rcx)
movw $0x400, %r14w           # imm = 0x400
jmp 0x4f9ac
andl $0xfeff, %ecx           # imm = 0xFEFF
movw %cx, 0x2(%rax)
movq 0x18(%r13), %rdi
movq %rsi, 0x18(%r13)
movq %rdi, 0x10(%r13)
movb (%r13), %al
cmpb $0x4d, %al
jb 0x4fd29
addb $-0x4d, %al
xorb $0x2, %al
addb $0x4d, %al
movb %al, (%r13)
callq 0x45e0b
movl 0x2c(%rax), %ecx
movl %ecx, 0xc(%r12)
movswl 0x30(%rax), %eax
movl %eax, 0x10(%r12)
movq -0x48(%rbp), %rax
orq -0x98(%rbp), %rax
movq %rax, 0x28(%r12)
movq -0x78(%rbp), %rax
movq %rax, 0x30(%r12)
movzbl (%r13), %ecx
cmpl $0x48, %ecx
je 0x4fd70
cmpl $0x49, %ecx
movq %r15, %rdi
jne 0x4fd79
movw $0x80, %dx
jmp 0x4fd81
movw $0x1, %dx
movq %r15, %rdi
jmp 0x4fd81
addb $-0x4c, %cl
pushq $0x2
popq %rdx
shll %cl, %edx
movzwl %r14w, %eax
addl %edx, %eax
andl %ebx, %eax
movw %ax, 0x18(%r12)
jmp 0x4f831
movq %rcx, %r15
xorl %r14d, %r14d
jmp 0x4f9ac
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rbx
movq -0x48(%rbp), %rdi
cmpb $-0x69, (%rbx)
jne 0x4fea4
movq %rdi, %r15
movq 0x8(%rbx), %rdi
leaq 0x1f45e(%rip), %rsi     # 0x6f220
callq 0xb1bf
testl %eax, %eax
je 0x4fdd3
movq %r15, %rdi
jmp 0x4fea4
movq 0x20(%rbx), %rax
cmpl $0x2, (%rax)
movq %r15, %rdi
jne 0x4fea4
movq 0x8(%rax), %rax
movq 0x20(%rax), %r14
cmpb $-0x68, (%r14)
jne 0x4fea4
movq (%rax), %r13
movq -0x80(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5034c
movq %rbx, %rdi
movq %rax, %rbx
movq %r14, %rsi
callq 0x5034c
movq %r15, %rdi
testq %rbx, %rax
jne 0x4fea4
movq -0x68(%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x440d6
pushq $0x32
popq %rsi
movq -0x58(%rbp), %rdi
xorl %edx, %edx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x36a09
pushq $0x3
popq %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x4f3bf
movq 0x20(%r12), %rcx
cltq
imulq $0x38, %rax, %rax
movq %rbx, 0x28(%rcx,%rax)
movl 0x2c(%r14), %edx
movl %edx, 0xc(%rcx,%rax)
movswl 0x30(%r14), %edx
movl %edx, 0x10(%rcx,%rax)
movw $0x40, 0x18(%rcx,%rax)
movl -0x5c(%rbp), %edx
movl %edx, 0x8(%rcx,%rax)
movq 0x20(%r12), %rdx
movq -0x88(%rbp), %rsi
movb $0x1, 0x1b(%rdx,%rsi)
orb $0x8, 0x1a(%rdx,%rsi)
leaq (%rdx,%rsi), %rdi
movq 0x30(%rdx,%rsi), %rdx
movq %rdx, 0x30(%rcx,%rax)
movq -0x98(%rbp), %rax
orq %rax, 0x28(%rdi)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x38(%rbp), %r12
jmp 0x50343
cmpb $0x5e, %r9b
jne 0x4ff44
movq 0x8(%r8), %rdx
xorl %edi, %edi
jmp 0x5002f
testl %ebx, %ebx
je 0x4f7a7
movq -0x70(%rbp), %rax
movl 0x14(%rax), %ebx
movq 0x20(%rax), %r14
xorl %r15d, %r15d
xorl %esi, %esi
movl -0x5c(%rbp), %r12d
movq -0x68(%rbp), %r13
testl %ebx, %ebx
jle 0x4ff4e
testb $0x40, 0x1a(%r14)
je 0x4ff33
movq (%r14), %rax
movq 0x18(%rax), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x440d6
movq -0x50(%rbp), %rcx
movq (%rcx), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3b491
movq %rax, %r15
movq (%r14), %rax
movq 0x10(%rax), %rsi
addq $0x38, %r14
decl %ebx
jmp 0x4fefb
xorl %edi, %edi
xorl %edx, %edx
jmp 0x50006
movb $0x1, %r14b
xorl %edi, %edi
jmp 0x500e7
movq %r13, %rdi
xorl %edx, %edx
callq 0x440d6
pushq $0x48
popq %rsi
movq -0x58(%rbp), %rdi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x36a09
testq %rax, %rax
movq -0x38(%rbp), %rbx
je 0x4ffc9
movq -0x30(%rbp), %rdx
movzwl 0x2(%rdx), %ecx
andl $0x1, %ecx
orw %cx, 0x2(%rax)
movzwl 0x34(%rdx), %ecx
movw %cx, 0x34(%rax)
movq %r15, 0x20(%rax)
pushq $0x3
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4f3bf
movl %eax, %r14d
movq %rbx, %rdi
movl %eax, %esi
callq 0x4f4aa
movq 0x20(%rbx), %rcx
movslq %r14d, %rax
imulq $0x38, %rax, %rax
movl %r12d, 0x8(%rcx,%rax)
movq -0x88(%rbp), %rax
movb $0x1, 0x1b(%rcx,%rax)
jmp 0x4ffe2
movq %r13, %rdi
movq %r15, %rsi
callq 0x2f527
movq -0x88(%rbp), %rax
movq -0x90(%rbp), %rcx
movw $0x800, 0x18(%rcx,%rax) # imm = 0x800
jmp 0x4f7a7
xorl %edi, %edi
jmp 0x4fff5
movq %r13, %rdi
xorl %edx, %edx
movq -0x50(%rbp), %r8
movb -0x90(%rbp), %r9b
movb -0x40(%rbp), %r10b
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rax
cmpw $0x21, %r14w
jl 0x5001e
orl $-0x1, 0x104(%rax)
jmp 0x5002f
decb %r14b
pushq $0x1
popq %rsi
movl %r14d, %ecx
shll %cl, %esi
orl %esi, 0x104(%rax)
movb $0x1, %r14b
testq %rdx, %rdx
je 0x500e7
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
xorl %r14d, %r14d
movabsq $0x100000000, %rsi      # imm = 0x100000000
addq %rsi, %rax
movb (%rdx,%r14), %cl
incq %r14
testb %cl, %cl
je 0x5006e
cmpb %r10b, %cl
je 0x5006e
cmpb %r12b, %cl
je 0x5006e
cmpb %bl, %cl
jne 0x50052
cmpq $0x1, %r14
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rbx
je 0x500fa
sarq $0x20, %rax
cmpb $-0x1, (%rdx,%rax)
je 0x500fa
movl %r9d, %r13d
movq %r8, -0x50(%rbp)
movq %rdi, -0x40(%rbp)
xorl %ebx, %ebx
cmpb %r10b, %cl
jne 0x500a4
movl %r14d, %eax
xorl %ebx, %ebx
cmpb $0x0, (%rdx,%rax)
sete %bl
pushq $0x5e
popq %rsi
movq %r15, %rdi
callq 0x3b590
movq %rax, %r15
testq %rax, %rax
je 0x500c1
movq 0x8(%r15), %rax
movb $0x0, -0x1(%rax,%r14)
cmpb $-0x7b, %r13b
jne 0x50108
movq -0x58(%rbp), %rax
movq 0x10(%rax), %r12
movq -0x50(%rbp), %rax
movswl 0x30(%rax), %ecx
cmpl $0x21, %ecx
jl 0x50110
orl $-0x1, 0x104(%r12)
jmp 0x5011f
xorl %r15d, %r15d
xorl %r13d, %r13d
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rbx
jmp 0x50196
xorl %r15d, %r15d
xorl %r13d, %r13d
movb $0x1, %r14b
jmp 0x50196
xorl %r14d, %r14d
movl %ebx, %r13d
jmp 0x5018e
decb %cl
pushq $0x1
popq %rax
shll %cl, %eax
orl %eax, 0x104(%r12)
testl %ebx, %ebx
je 0x50184
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
cmpb $0x0, 0x1(%rax)
je 0x50173
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
callq 0x46ff9
movl %eax, %r14d
movq %rbx, %rdi
movq -0x50(%rbp), %rsi
movl %eax, %edx
callq 0x484da
movl 0x34(%r12), %eax
testl %eax, %eax
je 0x50167
decl %eax
movq 0x8(%r12), %rcx
imulq $0x18, %rax, %rax
andl $0x0, 0xc(%rcx,%rax)
movq -0x58(%rbp), %rdi
movl %r14d, %esi
callq 0x4701c
xorl %r14d, %r14d
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rbx
pushq $0x1
popq %r13
jmp 0x50192
xorl %r13d, %r13d
xorl %r14d, %r14d
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %rbx
movq -0x40(%rbp), %rdi
callq 0x12a43
testb %r14b, %r14b
movq -0x48(%rbp), %rdi
jne 0x4fdab
movq 0x20(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %r12
movq -0x68(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x440d6
cmpb $0x0, 0x50(%rbx)
movq %rax, -0x40(%rbp)
movq %r15, -0x50(%rbp)
je 0x501e1
movl %r13d, -0x48(%rbp)
movq -0x30(%rbp), %rbx
movb -0x78(%rbp), %sil
jmp 0x50223
movq 0x8(%rax), %r14
movq %r14, %rdi
callq 0x8f8e
movl %eax, %eax
movb -0x1(%r14,%rax), %cl
movb -0x78(%rbp), %sil
testb $0x2, %sil
jne 0x50214
movzbl %cl, %ecx
xorl %edx, %edx
cmpb $0x40, %cl
cmovel %edx, %r13d
leaq 0x17e5f(%rip), %rdx     # 0x68070
movb (%rcx,%rdx), %cl
movq -0x30(%rbp), %rbx
movl %r13d, -0x48(%rbp)
incb %cl
movb %cl, -0x1(%r14,%rax)
testb $0x2, %sil
leaq 0x1d8a8(%rip), %rax     # 0x6dad6
leaq 0x1d329(%rip), %rcx     # 0x6d55e
cmoveq %rax, %rcx
leaq -0xb0(%rbp), %r15
movq %rcx, (%r15)
movl $0x6, 0x8(%r15)
movq -0x68(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x440d6
movq -0x58(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3ea95
pushq $0x50
popq %rsi
movq %r14, %rdi
movq %rax, %rdx
movq -0x50(%rbp), %rcx
xorl %r8d, %r8d
callq 0x36a09
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x504bf
pushq $0x3
popq %rdx
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4f3bf
movl %eax, %r15d
movq %rbx, %rdi
movl %eax, %esi
callq 0x4f4aa
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x440d6
movq %r14, %rdi
movq %rax, %rsi
leaq -0xb0(%rbp), %rdx
callq 0x3ea95
pushq $0x4f
popq %rsi
movq %r14, %rdi
movq %rax, %rdx
movq -0x40(%rbp), %rcx
xorl %r8d, %r8d
callq 0x36a09
movq %rax, %r12
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x504bf
movq %rbx, %rdi
movq %r12, %rsi
movq %rbx, %r12
pushq $0x3
popq %rdx
callq 0x4f3bf
movl %eax, %r14d
movq %rbx, %rdi
movl %eax, %esi
callq 0x4f4aa
movq 0x20(%rbx), %rax
movq -0x88(%rbp), %rcx
leaq (%rax,%rcx), %rdi
cmpl $0x0, -0x48(%rbp)
je 0x50343
movslq %r15d, %rcx
imulq $0x38, %rcx, %rcx
movl -0x5c(%rbp), %edx
movl %edx, 0x8(%rax,%rcx)
movslq %r14d, %rcx
imulq $0x38, %rcx, %rcx
movl %edx, 0x8(%rax,%rcx)
movb $0x2, 0x1b(%rdi)
movq -0x30(%rbp), %rbx
jmp 0x4fdab