// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: codeTriggerProgram
static int codeTriggerProgram(
  Parse *pParse,            /* The parser context */
  TriggerStep *pStepList,   /* List of statements inside the trigger body */
  int orconf                /* Conflict algorithm. (OE_Abort, etc) */  
){
  TriggerStep *pStep;
  Vdbe *v = pParse->pVdbe;
  sqlite3 *db = pParse->db;

  assert( pParse->pTriggerTab && pParse->pToplevel );
  assert( pStepList );
  assert( v!=0 );
  for(pStep=pStepList; pStep; pStep=pStep->pNext){
    /* Figure out the ON CONFLICT policy that will be used for this step
    ** of the trigger program. If the statement that caused this trigger
    ** to fire had an explicit ON CONFLICT, then use it. Otherwise, use
    ** the ON CONFLICT policy that was specified as part of the trigger
    ** step statement. Example:
    **
    **   CREATE TRIGGER AFTER INSERT ON t1 BEGIN;
    **     INSERT OR REPLACE INTO t2 VALUES(new.a, new.b);
    **   END;
    **
    **   INSERT INTO t1 ... ;            -- insert into t2 uses REPLACE policy
    **   INSERT OR IGNORE INTO t1 ... ;  -- insert into t2 uses IGNORE policy
    */
    pParse->eOrconf = (orconf==OE_Default)?pStep->orconf:(u8)orconf;

    /* Clear the cookieGoto flag. When coding triggers, the cookieGoto 
    ** variable is used as a flag to indicate to sqlite3ExprCodeConstants()
    ** that it is not safe to refactor constants (this happens after the
    ** start of the first loop in the SQL statement is coded - at that 
    ** point code may be conditionally executed, so it is no longer safe to 
    ** initialize constant register values).  */
    assert( pParse->cookieGoto==0 || pParse->cookieGoto==-1 );
    pParse->cookieGoto = 0;

    switch( pStep->op ){
      case TK_UPDATE: {
        sqlite3Update(pParse, 
          targetSrcList(pParse, pStep),
          sqlite3ExprListDup(db, pStep->pExprList, 0), 
          sqlite3ExprDup(db, pStep->pWhere, 0), 
          pParse->eOrconf
        );
        break;
      }
      case TK_INSERT: {
        sqlite3Insert(pParse, 
          targetSrcList(pParse, pStep),
          sqlite3ExprListDup(db, pStep->pExprList, 0), 
          sqlite3SelectDup(db, pStep->pSelect, 0), 
          sqlite3IdListDup(db, pStep->pIdList), 
          pParse->eOrconf
        );
        break;
      }
      case TK_DELETE: {
        sqlite3DeleteFrom(pParse, 
          targetSrcList(pParse, pStep),
          sqlite3ExprDup(db, pStep->pWhere, 0)
        );
        break;
      }
      default: assert( pStep->op==TK_SELECT ); {
        SelectDest sDest;
        Select *pSelect = sqlite3SelectDup(db, pStep->pSelect, 0);
        sqlite3SelectDestInit(&sDest, SRT_Discard, 0);
        sqlite3Select(pParse, pSelect, &sDest);
        sqlite3SelectDelete(db, pSelect);
        break;
      }
    } 
    if( pStep->op!=TK_SELECT ){
      sqlite3VdbeAddOp0(v, OP_ResetCount);
    }
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7e325
cmpl $0x63, -0x14(%rbp)
jne 0x7e123
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
movl %eax, -0x4c(%rbp)
jmp 0x7e12c
movl -0x14(%rbp), %eax
movzbl %al, %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x1f5(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x16c(%rax)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x50(%rbp)
subl $0x69, %eax
je 0x7e1e2
jmp 0x7e15e
movl -0x50(%rbp), %eax
subl $0x6a, %eax
je 0x7e269
jmp 0x7e16c
movl -0x50(%rbp), %eax
subl $0x6b, %eax
jne 0x7e2b3
jmp 0x7e17a
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7e3e0
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
xorl %edx, %edx
callq 0x61da0
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
xorl %edx, %edx
callq 0x61690
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rax, %rcx
movq -0x8(%rbp), %rax
movzbl 0x1f5(%rax), %r8d
callq 0x55550
jmp 0x7e2f8
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7e3e0
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
xorl %edx, %edx
callq 0x61da0
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
xorl %edx, %edx
callq 0x61ba0
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x622c0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq %rax, %r8
movq -0x8(%rbp), %rax
movzbl 0x1f5(%rax), %r9d
callq 0x56670
jmp 0x7e2f8
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7e3e0
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rsi
xorl %edx, %edx
callq 0x61690
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq %rax, %rdx
callq 0x54e60
jmp 0x7e2f8
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
xorl %edx, %edx
callq 0x61ba0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x5ef20
movq -0x8(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x529a0
movq -0x30(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x47420
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x74, %eax
je 0x7e312
movq -0x28(%rbp), %rdi
movl $0x47, %esi
callq 0x5e060
jmp 0x7e314
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x7e105
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbp
retq