// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: resolveExprStep
static int resolveExprStep(Walker *pWalker, Expr *pExpr){
  NameContext *pNC;
  Parse *pParse;

  pNC = pWalker->u.pNC;
  assert( pNC!=0 );
  pParse = pNC->pParse;
  assert( pParse==pWalker->pParse );

  if( ExprHasProperty(pExpr, EP_Resolved) ) return WRC_Prune;
  ExprSetProperty(pExpr, EP_Resolved);
#ifndef NDEBUG
  if( pNC->pSrcList && pNC->pSrcList->nAlloc>0 ){
    SrcList *pSrcList = pNC->pSrcList;
    int i;
    for(i=0; i<pNC->pSrcList->nSrc; i++){
      assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab);
    }
  }
#endif
  switch( pExpr->op ){

#if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY)
    /* The special operator TK_ROW means use the rowid for the first
    ** column in the FROM clause.  This is used by the LIMIT and ORDER BY
    ** clause processing on UPDATE and DELETE statements.
    */
    case TK_ROW: {
      SrcList *pSrcList = pNC->pSrcList;
      struct SrcList_item *pItem;
      assert( pSrcList && pSrcList->nSrc==1 );
      pItem = pSrcList->a; 
      pExpr->op = TK_COLUMN;
      pExpr->pTab = pItem->pTab;
      pExpr->iTable = pItem->iCursor;
      pExpr->iColumn = -1;
      pExpr->affinity = SQLITE_AFF_INTEGER;
      break;
    }
#endif /* defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT)
          && !defined(SQLITE_OMIT_SUBQUERY) */

    /* A lone identifier is the name of a column.
    */
    case TK_ID: {
      return lookupName(pParse, 0, 0, pExpr->u.zToken, pNC, pExpr);
    }
  
    /* A table name and column name:     ID.ID
    ** Or a database, table and column:  ID.ID.ID
    */
    case TK_DOT: {
      const char *zColumn;
      const char *zTable;
      const char *zDb;
      Expr *pRight;

      /* if( pSrcList==0 ) break; */
      notValid(pParse, pNC, "the \".\" operator", NC_IdxExpr);
      /*notValid(pParse, pNC, "the \".\" operator", NC_PartIdx|NC_IsCheck, 1);*/
      pRight = pExpr->pRight;
      if( pRight->op==TK_ID ){
        zDb = 0;
        zTable = pExpr->pLeft->u.zToken;
        zColumn = pRight->u.zToken;
      }else{
        assert( pRight->op==TK_DOT );
        zDb = pExpr->pLeft->u.zToken;
        zTable = pRight->pLeft->u.zToken;
        zColumn = pRight->pRight->u.zToken;
      }
      return lookupName(pParse, zDb, zTable, zColumn, pNC, pExpr);
    }

    /* Resolve function names
    */
    case TK_FUNCTION: {
      ExprList *pList = pExpr->x.pList;    /* The argument list */
      int n = pList ? pList->nExpr : 0;    /* Number of arguments */
      int no_such_func = 0;       /* True if no such function exists */
      int wrong_num_args = 0;     /* True if wrong number of arguments */
      int is_agg = 0;             /* True if is an aggregate function */
      int auth;                   /* Authorization to use the function */
      int nId;                    /* Number of characters in function name */
      const char *zId;            /* The function name. */
      FuncDef *pDef;              /* Information about the function */
      u8 enc = ENC(pParse->db);   /* The database encoding */

      assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
      notValid(pParse, pNC, "functions", NC_PartIdx);
      zId = pExpr->u.zToken;
      nId = sqlite3Strlen30(zId);
      pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0);
      if( pDef==0 ){
        pDef = sqlite3FindFunction(pParse->db, zId, nId, -2, enc, 0);
        if( pDef==0 ){
          no_such_func = 1;
        }else{
          wrong_num_args = 1;
        }
      }else{
        is_agg = pDef->xFunc==0;
        if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){
          ExprSetProperty(pExpr, EP_Unlikely|EP_Skip);
          if( n==2 ){
            pExpr->iTable = exprProbability(pList->a[1].pExpr);
            if( pExpr->iTable<0 ){
              sqlite3ErrorMsg(pParse,
                "second argument to likelihood() must be a "
                "constant between 0.0 and 1.0");
              pNC->nErr++;
            }
          }else{
            /* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is
            ** equivalent to likelihood(X, 0.0625).
            ** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is
            ** short-hand for likelihood(X,0.0625).
            ** EVIDENCE-OF: R-36850-34127 The likely(X) function is short-hand
            ** for likelihood(X,0.9375).
            ** EVIDENCE-OF: R-53436-40973 The likely(X) function is equivalent
            ** to likelihood(X,0.9375). */
            /* TUNING: unlikely() probability is 0.0625.  likely() is 0.9375 */
            pExpr->iTable = pDef->zName[0]=='u' ? 8388608 : 125829120;
          }             
        }
#ifndef SQLITE_OMIT_AUTHORIZATION
        auth = sqlite3AuthCheck(pParse, SQLITE_FUNCTION, 0, pDef->zName, 0);
        if( auth!=SQLITE_OK ){
          if( auth==SQLITE_DENY ){
            sqlite3ErrorMsg(pParse, "not authorized to use function: %s",
                                    pDef->zName);
            pNC->nErr++;
          }
          pExpr->op = TK_NULL;
          return WRC_Prune;
        }
#endif
        if( pDef->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) ){
          /* For the purposes of the EP_ConstFunc flag, date and time
          ** functions and other functions that change slowly are considered
          ** constant because they are constant for the duration of one query */
          ExprSetProperty(pExpr,EP_ConstFunc);
        }
        if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){
          /* Date/time functions that use 'now', and other functions like
          ** sqlite_version() that might change over time cannot be used
          ** in an index. */
          notValid(pParse, pNC, "non-deterministic functions", NC_IdxExpr);
        }
      }
      if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){
        sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
        pNC->nErr++;
        is_agg = 0;
      }else if( no_such_func && pParse->db->init.busy==0 ){
        sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
        pNC->nErr++;
      }else if( wrong_num_args ){
        sqlite3ErrorMsg(pParse,"wrong number of arguments to function %.*s()",
             nId, zId);
        pNC->nErr++;
      }
      if( is_agg ) pNC->ncFlags &= ~NC_AllowAgg;
      sqlite3WalkExprList(pWalker, pList);
      if( is_agg ){
        NameContext *pNC2 = pNC;
        pExpr->op = TK_AGG_FUNCTION;
        pExpr->op2 = 0;
        while( pNC2 && !sqlite3FunctionUsesThisSrc(pExpr, pNC2->pSrcList) ){
          pExpr->op2++;
          pNC2 = pNC2->pNext;
        }
        assert( pDef!=0 );
        if( pNC2 ){
          assert( SQLITE_FUNC_MINMAX==NC_MinMaxAgg );
          testcase( (pDef->funcFlags & SQLITE_FUNC_MINMAX)!=0 );
          pNC2->ncFlags |= NC_HasAgg | (pDef->funcFlags & SQLITE_FUNC_MINMAX);

        }
        pNC->ncFlags |= NC_AllowAgg;
      }
      /* FIX ME:  Compute pExpr->affinity based on the expected return
      ** type of the function 
      */
      return WRC_Prune;
    }
#ifndef SQLITE_OMIT_SUBQUERY
    case TK_SELECT:
    case TK_EXISTS:  testcase( pExpr->op==TK_EXISTS );
#endif
    case TK_IN: {
      testcase( pExpr->op==TK_IN );
      if( ExprHasProperty(pExpr, EP_xIsSelect) ){
        int nRef = pNC->nRef;
        notValid(pParse, pNC, "subqueries", NC_IsCheck|NC_PartIdx|NC_IdxExpr);
        sqlite3WalkSelect(pWalker, pExpr->x.pSelect);
        assert( pNC->nRef>=nRef );
        if( nRef!=pNC->nRef ){
          ExprSetProperty(pExpr, EP_VarSelect);
        }
      }
      break;
    }
    case TK_VARIABLE: {
      notValid(pParse, pNC, "parameters", NC_IsCheck|NC_PartIdx|NC_IdxExpr);
      break;
    }
  }
  return (pParse->nErr || pParse->db->mallocFailed) ? WRC_Abort : WRC_Continue;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x74dd5
movl $0x1, -0x4(%rbp)
jmp 0x753e4
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x90(%rbp)
subl $0x14, %eax
je 0x75322
jmp 0x74dfa
movl -0x90(%rbp), %eax
subl $0x1b, %eax
je 0x74e5f
jmp 0x74e07
movl -0x90(%rbp), %eax
subl $0x4b, %eax
je 0x75324
jmp 0x74e18
movl -0x90(%rbp), %eax
subl $0x77, %eax
je 0x75322
jmp 0x74e29
movl -0x90(%rbp), %eax
subl $0x7a, %eax
je 0x74e87
jmp 0x74e36
movl -0x90(%rbp), %eax
subl $0x87, %eax
je 0x7538c
jmp 0x74e49
movl -0x90(%rbp), %eax
subl $0x97, %eax
je 0x74f33
jmp 0x753a5
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %r8
movq -0x18(%rbp), %r9
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x75a80
movl %eax, -0x4(%rbp)
jmp 0x753e4
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x327ed(%rip), %rdx     # 0xa7683
movl $0x20, %ecx
callq 0x76550
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x1b, %eax
jne 0x74ede
movq $0x0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x74f0e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x18(%rbp), %r9
callq 0x75a80
movl %eax, -0x4(%rbp)
jmp 0x753e4
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x74f54
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x94(%rbp)
jmp 0x74f5e
xorl %eax, %eax
movl %eax, -0x94(%rbp)
jmp 0x74f5e
movl -0x94(%rbp), %eax
movl %eax, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movb 0x4e(%rax), %al
movb %al, -0x79(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x32778(%rip), %rdx     # 0xa7710
movl $0x10, %ecx
callq 0x76550
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xc6c0
movl %eax, -0x68(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x70(%rbp), %rsi
movl -0x68(%rbp), %edx
movl -0x54(%rbp), %ecx
xorl %r9d, %r9d
movzbl -0x79(%rbp), %r8d
callq 0x1dbc0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x75023
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x70(%rbp), %rsi
movl -0x68(%rbp), %edx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
xorl %r9d, %r9d
movzbl -0x79(%rbp), %r8d
callq 0x1dbc0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
jne 0x75017
movl $0x1, -0x58(%rbp)
jmp 0x7501e
movl $0x1, -0x5c(%rbp)
jmp 0x7517e
movq -0x78(%rbp), %rax
cmpq $0x0, 0x18(%rax)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x60(%rbp)
movq -0x78(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x750c8
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x41000, %ecx          # imm = 0x41000
movl %ecx, 0x4(%rax)
cmpl $0x2, -0x54(%rbp)
jne 0x750a4
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rdi
callq 0x765e0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jge 0x750a2
movq -0x28(%rbp), %rdi
leaq 0x32606(%rip), %rsi     # 0xa7694
movb $0x0, %al
callq 0x17840
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x750c6
movq -0x78(%rbp), %rax
movq 0x30(%rax), %rax
movsbl (%rax), %edx
movl $0x7800000, %ecx        # imm = 0x7800000
movl $0x800000, %eax         # imm = 0x800000
cmpl $0x75, %edx
cmovel %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x750c8
movq -0x28(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x30(%rax), %rcx
movl $0x1f, %esi
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rdx
callq 0x73440
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
je 0x7512f
cmpl $0x1, -0x64(%rbp)
jne 0x7511c
movq -0x28(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x30(%rax), %rdx
leaq 0x325d3(%rip), %rsi     # 0xa76db
movb $0x0, %al
callq 0x17840
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq -0x18(%rbp), %rax
movb $0x65, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x753e4
movq -0x78(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x2800, %eax           # imm = 0x2800
cmpl $0x0, %eax
je 0x75151
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x80000, %ecx          # imm = 0x80000
movl %ecx, 0x4(%rax)
movq -0x78(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x7517c
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x3258c(%rip), %rdx     # 0xa76fe
movl $0x20, %ecx
callq 0x76550
jmp 0x7517e
cmpl $0x0, -0x60(%rbp)
je 0x751c3
movq -0x20(%rbp), %rax
movzwl 0x30(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x751c3
movq -0x28(%rbp), %rdi
movl -0x68(%rbp), %edx
movq -0x70(%rbp), %rcx
leaq 0x32574(%rip), %rsi     # 0xa771a
movb $0x0, %al
callq 0x17840
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movl $0x0, -0x60(%rbp)
jmp 0x75234
cmpl $0x0, -0x58(%rbp)
je 0x75204
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzbl 0xa1(%rax), %eax
cmpl $0x0, %eax
jne 0x75204
movq -0x28(%rbp), %rdi
movl -0x68(%rbp), %edx
movq -0x70(%rbp), %rcx
leaq 0x32550(%rip), %rsi     # 0xa773e
movb $0x0, %al
callq 0x17840
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x75232
cmpl $0x0, -0x5c(%rbp)
je 0x75230
movq -0x28(%rbp), %rdi
movl -0x68(%rbp), %edx
movq -0x70(%rbp), %rcx
leaq 0x32539(%rip), %rsi     # 0xa7755
movb $0x0, %al
callq 0x17840
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x75232
jmp 0x75234
cmpl $0x0, -0x60(%rbp)
je 0x75249
movq -0x20(%rbp), %rax
movzwl 0x30(%rax), %ecx
andl $-0x2, %ecx
movw %cx, 0x30(%rax)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x71060
cmpl $0x0, -0x60(%rbp)
je 0x75316
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movb $-0x67, (%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x36(%rax)
xorl %eax, %eax
cmpq $0x0, -0x88(%rbp)
movb %al, -0x95(%rbp)
je 0x752ae
movq -0x18(%rbp), %rdi
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x76680
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x95(%rbp)
movb -0x95(%rbp), %al
testb $0x1, %al
jne 0x752ba
jmp 0x752db
movq -0x18(%rbp), %rax
movb 0x36(%rax), %cl
addb $0x1, %cl
movb %cl, 0x36(%rax)
movq -0x88(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x7527a
cmpq $0x0, -0x88(%rbp)
je 0x75307
movq -0x78(%rbp), %rax
movzwl 0x2(%rax), %edx
andl $0x1000, %edx           # imm = 0x1000
orl $0x2, %edx
movq -0x88(%rbp), %rax
movzwl 0x30(%rax), %ecx
orl %edx, %ecx
movw %cx, 0x30(%rax)
movq -0x20(%rbp), %rax
movzwl 0x30(%rax), %ecx
orl $0x1, %ecx
movw %cx, 0x30(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x753e4
jmp 0x75324
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x7538a
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x32431(%rip), %rdx     # 0xa7782
movl $0x34, %ecx
callq 0x76550
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x70f50
movl -0x8c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x28(%rcx), %eax
je 0x75388
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x4(%rax)
jmp 0x7538a
jmp 0x753a5
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x323f2(%rip), %rdx     # 0xa778d
movl $0x34, %ecx
callq 0x76550
movq -0x28(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x4c(%rcx)
movb %al, -0x96(%rbp)
jne 0x753ce
movq -0x28(%rbp), %rax
movq (%rax), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x96(%rbp)
movb -0x96(%rbp), %dl
xorl %eax, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq