// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x5c(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x19360
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x3cb770
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movl %eax, %ecx
movq -0x90(%rbp), %rax
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdx
callq 0x3d38b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0x18(%rbp), %rax
movb 0x10(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xd0(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
je 0x4698df
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x43a5e0
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x469904
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x469904
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x435380
movl %eax, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x5c(%rbp)
movb %al, -0xa1(%rbp)
jne 0x46992c
cmpq $0x0, -0x20(%rbp)
setne %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x46993b
jmp 0x469b92
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x469971
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x58(%rbp), %rdx
callq 0x438710
movq -0x8(%rbp), %rax
cmpl $0x0, 0x30(%rax)
je 0x46996f
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x5c(%rbp)
jmp 0x469971
cmpl $0x0, -0x5c(%rbp)
jne 0x469b7f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x469b7f
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x45c5b0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x469b76
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %ecx
movq -0x68(%rbp), %rdx
xorl %eax, %eax
cmpl (%rdx), %ecx
movb %al, -0xa2(%rbp)
jge 0x4699cd
cmpl $0x0, -0x5c(%rbp)
sete %al
movb %al, -0xa2(%rbp)
movb -0xa2(%rbp), %al
testb $0x1, %al
jne 0x4699dc
jmp 0x469a6c
movq -0x68(%rbp), %rax
addq $0x8, %rax
movslq -0x6c(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rdx
xorl %esi, %esi
callq 0x43a500
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movl 0x34(%rax), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0x34(%rax)
movq -0x78(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x78(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x469a37
movl $0x1, -0x5c(%rbp)
jmp 0x469a5c
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x3c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x3c(%rax)
movq -0x8(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x43a5e0
movl %eax, -0x5c(%rbp)
jmp 0x469a5e
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x4699ad
movq -0x68(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x469a99
movq -0x20(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x469a99
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x435380
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x469ab3
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x4354b0
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x469b5f
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x68(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x80(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x200, -0x30(%rbp)     # imm = 0x200
movq -0x80(%rbp), %rax
movq (%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x4354b0
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x469b24
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x4354b0
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x469b3e
movq -0x80(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x435380
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x469b58
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x435380
movl %eax, -0x5c(%rbp)
movl $0x0, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x40c9d0
jmp 0x469b7d
movl $0x7, -0x5c(%rbp)
jmp 0x469b7f
jmp 0x469b81
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x469910
movl -0x5c(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nop