// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x64(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x8130
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x16cd0
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
movl %eax, %ecx
movq -0x100(%rbp), %rax
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdx
callq 0x1f130
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0x20(%rbp), %rax
movb 0x10(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xc8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
je 0xb02a3
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x830e0
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0xb02c8
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xb02c8
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7e480
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x64(%rbp)
movb %al, -0x111(%rbp)
jne 0xb02f0
cmpq $0x0, -0x28(%rbp)
setne %al
movb %al, -0x111(%rbp)
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0xb02ff
jmp 0xb04f6
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xb0335
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x60(%rbp), %rdx
callq 0x812e0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0xb0333
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0xb0335
cmpl $0x0, -0x64(%rbp)
jne 0xb04e3
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xb04e3
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rcx
xorl %esi, %esi
callq 0x16a20
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0xb037c
movl $0x1, -0x64(%rbp)
jmp 0xb04e1
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x830e0
movl %eax, %ecx
movl %ecx, -0x64(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xb04df
leaq -0xe8(%rbp), %rdi
xorl %esi, %esi
movl $0x78, %edx
callq 0x8130
movl $0x1, -0xe8(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xe8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xb03f9
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7e480
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0xb0413
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7e5b0
movl %eax, -0x64(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xb04d7
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
leaq -0xe8(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0xf0(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x200, -0x38(%rbp)     # imm = 0x200
movq -0xf0(%rbp), %rax
movq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7e5b0
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0xb0496
movq -0xf0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7e5b0
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0xb04b3
movq -0xf0(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7e480
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0xb04d0
movq -0xf0(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x7e480
movl %eax, -0x64(%rbp)
movl $0x0, -0x38(%rbp)
movq $0x0, -0x58(%rbp)
jmp 0xb04e1
jmp 0xb04e3
jmp 0xb04e5
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xb02d4
movl -0x64(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)