// File: /workspace/github_c_makefile_star2_O3/jkbenaim[P]psfrag/sqlite3.c
// Function: renameResolveTrigger
static int renameResolveTrigger(Parse *pParse, const char *zDb){
  sqlite3 *db = pParse->db;
  Trigger *pNew = pParse->pNewTrigger;
  TriggerStep *pStep;
  NameContext sNC;
  int rc = SQLITE_OK;

  memset(&sNC, 0, sizeof(sNC));
  sNC.pParse = pParse;
  assert( pNew->pTabSchema );
  pParse->pTriggerTab = sqlite3FindTable(db, pNew->table, 
      db->aDb[sqlite3SchemaToIndex(db, pNew->pTabSchema)].zDbSName
  );
  pParse->eTriggerOp = pNew->op;
  /* ALWAYS() because if the table of the trigger does not exist, the
  ** error would have been hit before this point */
  if( ALWAYS(pParse->pTriggerTab) ){
    rc = sqlite3ViewGetColumnNames(pParse, pParse->pTriggerTab);
  }

  /* Resolve symbols in WHEN clause */
  if( rc==SQLITE_OK && pNew->pWhen ){
    rc = sqlite3ResolveExprNames(&sNC, pNew->pWhen);
  }

  for(pStep=pNew->step_list; rc==SQLITE_OK && pStep; pStep=pStep->pNext){
    if( pStep->pSelect ){
      sqlite3SelectPrep(pParse, pStep->pSelect, &sNC);
      if( pParse->nErr ) rc = pParse->rc;
    }
    if( rc==SQLITE_OK && pStep->zTarget ){
      Table *pTarget = sqlite3LocateTable(pParse, 0, pStep->zTarget, zDb);
      if( pTarget==0 ){
        rc = SQLITE_ERROR;
      }else if( SQLITE_OK==(rc = sqlite3ViewGetColumnNames(pParse, pTarget)) ){
        SrcList sSrc;
        memset(&sSrc, 0, sizeof(sSrc));
        sSrc.nSrc = 1;
        sSrc.a[0].zName = pStep->zTarget;
        sSrc.a[0].pTab = pTarget;
        sNC.pSrcList = &sSrc;
        if( pStep->pWhere ){
          rc = sqlite3ResolveExprNames(&sNC, pStep->pWhere);
        }
        if( rc==SQLITE_OK ){
          rc = sqlite3ResolveExprListNames(&sNC, pStep->pExprList);
        }
        assert( !pStep->pUpsert || (!pStep->pWhere && !pStep->pExprList) );
        if( pStep->pUpsert ){
          Upsert *pUpsert = pStep->pUpsert;
          assert( rc==SQLITE_OK );
          pUpsert->pUpsertSrc = &sSrc;
          sNC.uNC.pUpsert = pUpsert;
          sNC.ncFlags = NC_UUpsert;
          rc = sqlite3ResolveExprListNames(&sNC, pUpsert->pUpsertTarget);
          if( rc==SQLITE_OK ){
            ExprList *pUpsertSet = pUpsert->pUpsertSet;
            rc = sqlite3ResolveExprListNames(&sNC, pUpsertSet);
          }
          if( rc==SQLITE_OK ){
            rc = sqlite3ResolveExprNames(&sNC, pUpsert->pUpsertWhere);
          }
          if( rc==SQLITE_OK ){
            rc = sqlite3ResolveExprNames(&sNC, pUpsert->pUpsertTargetWhere);
          }
          sNC.ncFlags = 0;
        }
        sNC.pSrcList = 0;
      }
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x150(%r14), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq 0x8(%r15), %rsi
movq 0x30(%r15), %rdx
movq 0x20(%rdi), %rax
testq %rdx, %rdx
je 0x824b0
leaq 0x18(%rax), %r8
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %r9       # imm = 0x100000000
addq %r9, %rcx
leaq 0x20(%r8), %r10
cmpq %rdx, (%r8)
movq %r10, %r8
jne 0x8249b
sarq $0x20, %rcx
jmp 0x824b7
movq $-0xf4240, %rcx         # imm = 0xFFF0BDC0
shlq $0x5, %rcx
movq (%rax,%rcx), %rdx
callq 0x1a404
movq %rax, 0xa8(%r14)
movb 0x10(%r15), %cl
movb %cl, 0xc8(%r14)
testq %rax, %rax
je 0x824f3
movq %r14, %rdi
movq %rax, %rsi
callq 0x5f3a8
movl $0x1, %ebp
testl %eax, %eax
jne 0x826a3
movq 0x18(%r15), %rsi
testq %rsi, %rsi
je 0x8250a
leaq 0x8(%rsp), %rdi
callq 0x5b9a5
movl %eax, %ebp
jmp 0x8250c
xorl %ebp, %ebp
movq 0x38(%r15), %r13
testl %ebp, %ebp
sete %al
testq %r13, %r13
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x826a3
leaq 0x8(%rsp), %r15
movq 0x10(%r13), %rsi
testq %rsi, %rsi
je 0x82552
movq %r14, %rdi
movq %r15, %rdx
callq 0x5dba8
cmpl $0x0, 0x30(%r14)
je 0x82552
movl 0x18(%r14), %ebp
testl %ebp, %ebp
jne 0x826a3
movq 0x18(%r13), %rdx
testq %rdx, %rdx
je 0x82669
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x1366c
movl $0x1, %ebp
testq %rax, %rax
je 0x826a3
movq %rax, %r12
movq %r14, %rdi
movq %rax, %rsi
callq 0x5f3a8
testl %eax, %eax
jne 0x826a3
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0xb0(%rsp)
movl $0x1, 0x40(%rsp)
movq 0x18(%r13), %rax
movq %rax, 0x58(%rsp)
movq %r12, 0x68(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%r13), %rsi
testq %rsi, %rsi
je 0x82605
movq %r15, %rdi
callq 0x5b9a5
movl $0x1, %ebp
testl %eax, %eax
jne 0x82613
movq 0x28(%r13), %rsi
movq %r15, %rdi
callq 0x5ba7c
movl %eax, %ebp
movq 0x38(%r13), %r12
testq %r12, %r12
je 0x8265e
leaq 0x40(%rsp), %rax
movq %rax, 0x28(%r12)
movq %r12, 0x18(%rsp)
movl $0x200, 0x30(%rsp)      # imm = 0x200
movq (%r12), %rsi
movq %r15, %rdi
callq 0x5ba7c
testl %eax, %eax
jne 0x82654
movq 0x10(%r12), %rsi
movq %r15, %rdi
callq 0x5ba7c
testl %eax, %eax
je 0x8267e
movl %eax, %ebp
movl $0x0, 0x30(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0x8266b
xorl %ebp, %ebp
testl %ebp, %ebp
jne 0x826a3
movq 0x48(%r13), %r13
testq %r13, %r13
jne 0x8252b
jmp 0x826a3
movq 0x18(%r12), %rsi
movq %r15, %rdi
callq 0x5b9a5
movl $0x1, %ebp
testl %eax, %eax
jne 0x82656
movq 0x8(%r12), %rsi
movq %r15, %rdi
callq 0x5b9a5
jmp 0x82654
movl %ebp, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq