// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: renameResolveTrigger
static int renameResolveTrigger(Parse *pParse){
  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 ){
      SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
      if( pSrc ){
        int i;
        for(i=0; i<pSrc->nSrc && rc==SQLITE_OK; i++){
          struct SrcList_item *p = &pSrc->a[i];
          p->pTab = sqlite3LocateTableItem(pParse, 0, p);
          p->iCursor = pParse->nTab++;
          if( p->pTab==0 ){
            rc = SQLITE_ERROR;
          }else{
            p->pTab->nTabRef++;
            rc = sqlite3ViewGetColumnNames(pParse, p->pTab);
          }
        }
        sNC.pSrcList = pSrc;
        if( rc==SQLITE_OK && 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 = pSrc;
          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;
        sqlite3SrcListDelete(db, pSrc);
      }else{
        rc = SQLITE_NOMEM;
      }
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq (%rdi), %r13
movq 0x158(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
movups %xmm0, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x20(%r13), %r14
movq 0x8(%r15), %r12
movq 0x30(%r15), %rsi
movq %r13, %rdi
callq 0x226e9e
cltq
shlq $0x5, %rax
movq (%r14,%rax), %rdx
movq %r13, 0x40(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x22beb2
movq %rax, 0xa8(%rbx)
movb 0x10(%r15), %cl
movb %cl, 0xd0(%rbx)
pushq $0x1
popq %r14
testq %rax, %rax
je 0x287d82
movq %rbx, %rdi
movq %rax, %rsi
callq 0x26e712
movl %r14d, %ebp
testl %eax, %eax
jne 0x287d9b
movq 0x18(%r15), %rsi
testq %rsi, %rsi
je 0x287d99
leaq 0x8(%rsp), %rdi
callq 0x26afc4
movl %eax, %ebp
jmp 0x287d9b
xorl %ebp, %ebp
addq $0x38, %r15
leaq 0x8(%rsp), %r12
testl %ebp, %ebp
jne 0x287f21
movq (%r15), %r15
testq %r15, %r15
je 0x287f21
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x287ddd
movq %rbx, %rdi
movq %r12, %rdx
callq 0x26d3a5
cmpl $0x0, 0x30(%rbx)
je 0x287ddd
movl 0x18(%rbx), %ebp
testl %ebp, %ebp
jne 0x287ef1
cmpq $0x0, 0x18(%r15)
je 0x287eef
movq %rbx, %rdi
movq %r15, %rsi
callq 0x280771
pushq $0x7
popq %rbp
testq %rax, %rax
je 0x287ef1
movq %rax, %r13
movq %rax, %rbp
addq $0x48, %rbp
xorl %r12d, %r12d
xorl %eax, %eax
movslq (%r13), %rcx
cmpq %rcx, %r12
jge 0x287e58
testl %eax, %eax
jne 0x287e58
leaq -0x40(%rbp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x26e69f
movq %rax, %rsi
movq %rax, -0x20(%rbp)
movl 0x34(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x34(%rbx)
movl %eax, (%rbp)
movl %r14d, %eax
testq %rsi, %rsi
je 0x287e4f
incl 0x3c(%rsi)
movq %rbx, %rdi
callq 0x26e712
incq %r12
addq $0x70, %rbp
jmp 0x287e0e
movq %r13, 0x10(%rsp)
movl %r14d, %ebp
testl %eax, %eax
jne 0x287e8e
movq 0x28(%r15), %rsi
testq %rsi, %rsi
je 0x287e7e
leaq 0x8(%rsp), %rdi
callq 0x26afc4
movl %r14d, %ebp
testl %eax, %eax
jne 0x287e8e
movq 0x30(%r15), %rsi
leaq 0x8(%rsp), %rdi
callq 0x26b08f
movl %eax, %ebp
movq 0x40(%r15), %r12
testq %r12, %r12
je 0x287ed5
movq %r13, 0x28(%r12)
movq %r12, 0x18(%rsp)
movl $0x200, 0x30(%rsp)      # imm = 0x200
movq (%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x26b08f
testl %eax, %eax
jne 0x287ece
movq 0x10(%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x26b08f
testl %eax, %eax
je 0x287efa
movl %eax, %ebp
andl $0x0, 0x30(%rsp)
andq $0x0, 0x10(%rsp)
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x24b836
leaq 0x8(%rsp), %r12
jmp 0x287ef1
xorl %ebp, %ebp
addq $0x50, %r15
jmp 0x287da4
movq 0x18(%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x26afc4
movl %r14d, %ebp
testl %eax, %eax
jne 0x287ed0
movq 0x8(%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x26afc4
jmp 0x287ece
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq