// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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_schema and/or
  ** sqlite_temp_schema 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->zDbSName, pTab->zName
    );
  }
#endif

  /* Drop all entries in the schema table that refer to the
  ** table. The program name loops through the schema 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." DFLT_SCHEMA_TABLE
      " WHERE tbl_name=%Q and type!='trigger'",
      pDb->zDbSName, 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);
    sqlite3MayAbort(pParse);
  }
  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 0x4299d0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
movl $0x1, %esi
callq 0x433bf0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x43e46e
movq -0x20(%rbp), %rdi
movl $0xa2, %esi
callq 0x429a40
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x43e5c0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x43e4a1
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x43e6e0
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x43e47f
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x43e4d0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x16f5a9(%rip), %rsi    # 0x5ada72
movb $0x0, %al
callq 0x434d60
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0x16f5b6(%rip), %rsi    # 0x5ada9f
movb $0x0, %al
callq 0x434d60
cmpl $0x0, -0x18(%rbp)
jne 0x43e50d
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jne 0x43e50d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x43e840
movq -0x10(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x43e545
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %r9
movl $0xa4, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0x0, (%rsp)
callq 0x429aa0
movq -0x8(%rbp), %rdi
callq 0x42e470
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %r9
movl $0x8f, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0x0, (%rsp)
callq 0x429aa0
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x434f00
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x43e910
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)