// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: substExpr
static Expr *substExpr(
  SubstContext *pSubst,  /* Description of the substitution */
  Expr *pExpr            /* Expr in which substitution occurs */
){
  if( pExpr==0 ) return 0;
  if( ExprHasProperty(pExpr, EP_FromJoin)
   && pExpr->iRightJoinTable==pSubst->iTable
  ){
    pExpr->iRightJoinTable = pSubst->iNewTable;
  }
  if( pExpr->op==TK_COLUMN
   && pExpr->iTable==pSubst->iTable
   && !ExprHasProperty(pExpr, EP_FixedCol)
  ){
    if( pExpr->iColumn<0 ){
      pExpr->op = TK_NULL;
    }else{
      Expr *pNew;
      Expr *pCopy = pSubst->pEList->a[pExpr->iColumn].pExpr;
      Expr ifNullRow;
      assert( pSubst->pEList!=0 && pExpr->iColumn<pSubst->pEList->nExpr );
      assert( pExpr->pRight==0 );
      if( sqlite3ExprIsVector(pCopy) ){
        sqlite3VectorErrorMsg(pSubst->pParse, pCopy);
      }else{
        sqlite3 *db = pSubst->pParse->db;
        if( pSubst->isLeftJoin && pCopy->op!=TK_COLUMN ){
          memset(&ifNullRow, 0, sizeof(ifNullRow));
          ifNullRow.op = TK_IF_NULL_ROW;
          ifNullRow.pLeft = pCopy;
          ifNullRow.iTable = pSubst->iNewTable;
          ifNullRow.flags = EP_Skip;
          pCopy = &ifNullRow;
        }
        testcase( ExprHasProperty(pCopy, EP_Subquery) );
        pNew = sqlite3ExprDup(db, pCopy, 0);
        if( pNew && pSubst->isLeftJoin ){
          ExprSetProperty(pNew, EP_CanBeNull);
        }
        if( pNew && ExprHasProperty(pExpr,EP_FromJoin) ){
          pNew->iRightJoinTable = pExpr->iRightJoinTable;
          ExprSetProperty(pNew, EP_FromJoin);
        }
        sqlite3ExprDelete(db, pExpr);
        pExpr = pNew;

        /* Ensure that the expression now has an implicit collation sequence,
        ** just as it did when it was a column of a view or sub-query. */
        if( pExpr ){
          if( pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE ){
            CollSeq *pColl = sqlite3ExprCollSeq(pSubst->pParse, pExpr);
            pExpr = sqlite3ExprAddCollateString(pSubst->pParse, pExpr,
                (pColl ? pColl->zName : "BINARY")
            );
          }
          ExprClearProperty(pExpr, EP_Collate);
        }
      }
    }
  }else{
    if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){
      pExpr->iTable = pSubst->iNewTable;
    }
    pExpr->pLeft = substExpr(pSubst, pExpr->pLeft);
    pExpr->pRight = substExpr(pSubst, pExpr->pRight);
    if( ExprHasProperty(pExpr, EP_xIsSelect) ){
      substSelect(pSubst, pExpr->x.pSelect, 1);
    }else{
      substExprList(pSubst, pExpr->x.pList);
    }
#ifndef SQLITE_OMIT_WINDOWFUNC
    if( ExprHasProperty(pExpr, EP_WinFunc) ){
      Window *pWin = pExpr->y.pWin;
      pWin->pFilter = substExpr(pSubst, pWin->pFilter);
      substExprList(pSubst, pWin->pPartition);
      substExprList(pSubst, pWin->pOrderBy);
    }
#endif
  }
  return pExpr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x446617
movq $0x0, -0x8(%rbp)
jmp 0x44697a
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x446649
movq -0x18(%rbp), %rax
movswl 0x34(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x446649
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0x34(%rax)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa4, %eax
jne 0x446868
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x446868
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x446868
movq -0x18(%rbp), %rax
movswl 0x30(%rax), %eax
cmpl $0x0, %eax
jge 0x44669b
movq -0x18(%rbp), %rax
movb $0x77, (%rax)
jmp 0x446863
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
addq $0x8, %rax
movq -0x18(%rbp), %rcx
movswq 0x30(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x42c210
cmpl $0x0, %eax
je 0x4466e1
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x431760
jmp 0x446861
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x44673c
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa4, %eax
je 0x44673c
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x19360
movb $-0x50, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x44(%rbp)
movl $0x1000, -0x6c(%rbp)    # imm = 0x1000
leaq -0x70(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x78(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x42dee0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x446770
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x446770
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x100000, %ecx         # imm = 0x100000
movl %ecx, 0x4(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x4467a3
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4467a3
movq -0x18(%rbp), %rax
movw 0x34(%rax), %cx
movq -0x20(%rbp), %rax
movw %cx, 0x34(%rax)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x78(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x40c670
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x44685f
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xa4, %eax
je 0x44684f
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x6f, %eax
je 0x44684f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x4124c0
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0x446821
movq -0x80(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x446831
leaq 0x164a75(%rip), %rax    # 0x5ab29d
movq %rax, -0xa0(%rbp)
jmp 0x446831
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rdx
callq 0x4383b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0xfffffeff, %ecx       # imm = 0xFFFFFEFF
movl %ecx, 0x4(%rax)
jmp 0x446861
jmp 0x446863
jmp 0x446972
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xb0, %eax
jne 0x446894
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x446894
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x4465f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x4465f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4468f5
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x1, %edx
callq 0x4463c0
jmp 0x446906
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x446570
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0x446970
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x88(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x4465f0
movq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rdi
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x446570
movq -0x10(%rbp), %rdi
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x446570
jmp 0x446972
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)