// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3CodeDropTable
SQLITE_PRIVATE void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, int isView){
  Vdbe *v;
  sqlite3 *db = pParse->db;
  Trigger *pTrigger;
  Db *pDb = &db->aDb[iDb];

  v = sqlite3GetVdbe(pParse);
  assert( v!=0 );
  sqlite3BeginWriteOperation(pParse, 1, iDb);

#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( IsVirtual(pTab) ){
    sqlite3VdbeAddOp0(v, OP_VBegin);
  }
#endif

  /* Drop all triggers associated with the table being dropped. Code
  ** is generated to remove entries from sqlite_master and/or
  ** sqlite_temp_master if required.
  */
  pTrigger = sqlite3TriggerList(pParse, pTab);
  while( pTrigger ){
    assert( pTrigger->pSchema==pTab->pSchema || 
        pTrigger->pSchema==db->aDb[1].pSchema );
    sqlite3DropTriggerPtr(pParse, pTrigger);
    pTrigger = pTrigger->pNext;
  }

#ifndef SQLITE_OMIT_AUTOINCREMENT
  /* Remove any entries of the sqlite_sequence table associated with
  ** the table being dropped. This is done before the table is dropped
  ** at the btree level, in case the sqlite_sequence table needs to
  ** move as a result of the drop (can happen in auto-vacuum mode).
  */
  if( pTab->tabFlags & TF_Autoincrement ){
    sqlite3NestedParse(pParse,
      "DELETE FROM %Q.sqlite_sequence WHERE name=%Q",
      pDb->zName, pTab->zName
    );
  }
#endif

  /* Drop all SQLITE_MASTER table and index entries that refer to the
  ** table. The program name loops through the master table and deletes
  ** every row that refers to a table of the same name as the one being
  ** dropped. Triggers are handled separately because a trigger can be
  ** created in the temp database that refers to a table in another
  ** database.
  */
  sqlite3NestedParse(pParse, 
      "DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'",
      pDb->zName, SCHEMA_TABLE(iDb), pTab->zName);
  if( !isView && !IsVirtual(pTab) ){
    destroyTable(pParse, pTab);
  }

  /* Remove the table entry from SQLite's internal schema and modify
  ** the schema cookie.
  */
  if( IsVirtual(pTab) ){
    sqlite3VdbeAddOp4(v, OP_VDestroy, iDb, 0, 0, pTab->zName, 0);
  }
  sqlite3VdbeAddOp4(v, OP_DropTable, iDb, 0, 0, pTab->zName, 0);
  sqlite3ChangeCookie(pParse, iDb);
  sqliteViewResetAll(db, iDb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5e000
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
movl $0x1, %esi
callq 0x5ec70
movq -0x10(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x6b9d4
movq -0x20(%rbp), %rdi
movl $0x86, %esi
callq 0x5e060
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6bb50
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x6ba07
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x6bc70
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x6b9e5
movq -0x10(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x6ba37
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x448ea(%rip), %rsi     # 0xb031a
movb $0x0, %al
callq 0x5f320
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movl -0x14(%rbp), %esi
leaq 0x42fdc(%rip), %rcx     # 0xaea28
leaq 0x42fc2(%rip), %rax     # 0xaea15
cmpl $0x1, %esi
cmoveq %rax, %rcx
movq -0x10(%rbp), %rax
movq (%rax), %r8
leaq 0x448df(%rip), %rsi     # 0xb0347
movb $0x0, %al
callq 0x5f320
cmpl $0x0, -0x18(%rbp)
jne 0x6ba92
movq -0x10(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x6ba92
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6be20
movq -0x10(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x6bac7
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %r9
movl $0x88, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0x0, (%rsp)
callq 0x5e1b0
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %r9
movl $0x72, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0x0, (%rsp)
callq 0x5e1b0
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x5f4a0
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x6bef0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)