// File: /workspace/github_c_makefile_star2_O0/ukontainer[P]sqlite-bench/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;

  /* Resolve symbols in WHEN clause */
  if( 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;
        }
      }
    }
  }
  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 0x148(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x64(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x4010b0
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 0x4111b0
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 0x419420
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, 0xc0(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4a50fd
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x4756c0
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 0x4a5125
cmpq $0x0, -0x28(%rbp)
setne %al
movb %al, -0x111(%rbp)
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0x4a5134
jmp 0x4a5323
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4a516a
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x60(%rbp), %rdx
callq 0x478170
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x4a5168
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0x4a516a
cmpl $0x0, -0x64(%rbp)
jne 0x4a5310
movq -0x28(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4a5310
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rcx
xorl %esi, %esi
callq 0x410f30
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x4a51b1
movl $0x1, -0x64(%rbp)
jmp 0x4a530e
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x479ee0
movl %eax, %ecx
movl %ecx, -0x64(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x4a530c
leaq -0xe8(%rbp), %rdi
xorl %esi, %esi
movl $0x78, %edx
callq 0x4010b0
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 0x4a522e
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x4756c0
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x4a5248
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x475800
movl %eax, -0x64(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x4a530a
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)
movw $0x200, -0x38(%rbp)     # imm = 0x200
movq -0xf0(%rbp), %rax
movq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x475800
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x4a52ca
movq -0xf0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x475800
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x4a52e7
movq -0xf0(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x4756c0
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x4a5304
movq -0xf0(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x4756c0
movl %eax, -0x64(%rbp)
movw $0x0, -0x38(%rbp)
jmp 0x4a530c
jmp 0x4a530e
jmp 0x4a5310
jmp 0x4a5312
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x4a5109
movl -0x64(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nop