// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3DropTriggerPtr
SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
  Table   *pTable;
  Vdbe *v;
  sqlite3 *db = pParse->db;
  int iDb;

  iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
  assert( iDb>=0 && iDb<db->nDb );
  pTable = tableOfTrigger(pTrigger);
  assert( pTable );
  assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
#ifndef SQLITE_OMIT_AUTHORIZATION
  {
    int code = SQLITE_DROP_TRIGGER;
    const char *zDb = db->aDb[iDb].zName;
    const char *zTab = SCHEMA_TABLE(iDb);
    if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER;
    if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
      sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
      return;
    }
  }
#endif

  /* Generate code to destroy the database record of the trigger.
  */
  assert( pTable!=0 );
  if( (v = sqlite3GetVdbe(pParse))!=0 ){
    int base;
    static const VdbeOpList dropTrigger[] = {
      { OP_Rewind,     0, ADDR(9),  0},
      { OP_String8,    0, 1,        0}, /* 1 */
      { OP_Column,     0, 1,        2},
      { OP_Ne,         2, ADDR(8),  1},
      { OP_String8,    0, 1,        0}, /* 4: "trigger" */
      { OP_Column,     0, 0,        2},
      { OP_Ne,         2, ADDR(8),  1},
      { OP_Delete,     0, 0,        0},
      { OP_Next,       0, ADDR(1),  0}, /* 8 */
    };

    sqlite3BeginWriteOperation(pParse, 0, iDb);
    sqlite3OpenMasterTable(pParse, iDb);
    base = sqlite3VdbeAddOpList(v,  ArraySize(dropTrigger), dropTrigger);
    sqlite3VdbeChangeP4(v, base+1, pTrigger->zName, P4_TRANSIENT);
    sqlite3VdbeChangeP4(v, base+4, "trigger", P4_STATIC);
    sqlite3ChangeCookie(pParse, iDb);
    sqlite3VdbeAddOp2(v, OP_Close, 0, 0);
    sqlite3VdbeAddOp4(v, OP_DropTrigger, iDb, 0, 0, pTrigger->zName, 0);
    if( pParse->nMem<3 ){
      pParse->nMem = 3;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %r12
movq 0x28(%rsi), %rsi
movq %r12, %rdi
callq 0x1064e
movl %eax, %r15d
movq %r14, %rdi
callq 0x2f70c
movq 0x20(%r12), %rcx
movslq %r15d, %rdx
shlq $0x5, %rdx
movq (%rcx,%rdx), %r12
xorl %ecx, %ecx
cmpl $0x1, %r15d
setne %cl
leal 0xe(,%rcx,2), %esi
movq (%r14), %rdx
movq (%rax), %rcx
movq %rbx, %rdi
movq %r12, %r8
callq 0x42151
testl %eax, %eax
jne 0x4a575
cmpl $0x1, %r15d
leaq 0x219e3(%rip), %rax     # 0x6bf39
leaq 0x219ef(%rip), %rdx     # 0x6bf4c
cmoveq %rax, %rdx
pushq $0x9
popq %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
movq %r12, %r8
callq 0x42151
testl %eax, %eax
je 0x4a584
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x41ef4
testq %rax, %rax
je 0x4a575
movq %rax, %r12
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x423f5
movq %rbx, %rdi
movl %r15d, %esi
callq 0x42445
leaq 0x202cd(%rip), %rdx     # 0x6a880
pushq $0x9
popq %rsi
movq %r12, %rdi
callq 0x1068d
movl %eax, %r13d
leal 0x1(%r13), %esi
movq (%r14), %rdx
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x1074b
addl $0x4, %r13d
leaq 0x24a10(%rip), %rdx     # 0x6efed
pushq $-0x2
popq %rcx
movq %r12, %rdi
movl %r13d, %esi
callq 0x1074b
movq %rbx, %rdi
movl %r15d, %esi
callq 0x427b7
pushq $0x36
popq %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x41f42
movq (%r14), %r9
andl $0x0, (%rsp)
pushq $0x74
popq %rsi
movq %r12, %rdi
movl %r15d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x41fd2
cmpl $0x2, 0x58(%rbx)
jg 0x4a575
movl $0x3, 0x58(%rbx)
jmp 0x4a575