// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x13940
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x47740
movq %rax, -0x18(%rbp)
movl $0x10, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %edx
leaq 0x42d4e(%rip), %rax     # 0xaea28
leaq 0x42d34(%rip), %rcx     # 0xaea15
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0x40(%rbp)
cmpl $0x1, -0x2c(%rbp)
jne 0x6bcf9
movl $0xe, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0x30(%rbp), %esi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x38(%rbp), %r8
callq 0x5e720
cmpl $0x0, %eax
jne 0x6bd3b
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %r8
movl $0x9, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x5e720
cmpl $0x0, %eax
je 0x6bd40
jmp 0x6be16
movq -0x8(%rbp), %rdi
callq 0x5e000
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x6be16
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %edx
xorl %esi, %esi
callq 0x5ec70
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x5ed20
movq -0x20(%rbp), %rdi
movl $0x9, %esi
leaq 0x4164f(%rip), %rdx     # 0xad3d0
callq 0x139a0
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rdi
movl -0x44(%rbp), %esi
addl $0x1, %esi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
xorl %ecx, %ecx
callq 0x13c20
movq -0x20(%rbp), %rdi
movl -0x44(%rbp), %esi
addl $0x4, %esi
leaq 0x45d24(%rip), %rdx     # 0xb1ad6
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x13c20
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x5f4a0
movq -0x20(%rbp), %rdi
movl $0x36, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x5e0c0
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %r9
movl $0x74, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0x0, (%rsp)
callq 0x5e1b0
movq -0x8(%rbp), %rax
cmpl $0x3, 0x58(%rax)
jge 0x6be14
movq -0x8(%rbp), %rax
movl $0x3, 0x58(%rax)
jmp 0x6be16
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)