// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rcx
movl %edx, 0x8(%rsp)
movslq %edx, %r13
movq %r13, %rax
shlq $0x5, %rax
movq %rcx, 0x20(%rsp)
movq 0x20(%rcx), %rbp
movq %rax, 0x10(%rsp)
addq %rax, %rbp
callq 0x2bc630
movq %rax, %rbx
movq 0xa0(%r14), %r12
testq %r12, %r12
cmoveq %r14, %r12
movq %r14, %rdi
movl %r13d, %esi
callq 0x2c26e5
movl $0x1, %eax
movl %r13d, %ecx
shll %cl, %eax
orl %eax, 0x70(%r12)
orb $0x1, 0x20(%r12)
cmpl $0x0, 0x54(%r15)
je 0x2cad81
movq %rbx, %rdi
movl $0xa2, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq %rbx, 0x18(%rsp)
movq (%r14), %rax
movq 0x20(%rax), %rax
movq 0x38(%rax), %rdi
movzbl 0xd2(%r14), %esi
movq %r15, %rdx
callq 0x2cafa3
testq %rax, %rax
je 0x2cadbd
movq %rax, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x2cb027
movq 0x40(%r13), %r13
testq %r13, %r13
jne 0x2cada9
testb $0x8, 0x40(%r15)
movq 0x10(%rsp), %r12
je 0x2cade1
movq (%rbp), %rdx
movq (%r15), %rcx
leaq 0x10d801(%rip), %rsi    # 0x3d85d8
movq %r14, %rdi
xorl %eax, %eax
callq 0x2c461b
movq (%rbp), %rdx
movq (%r15), %rcx
leaq 0x10d816(%rip), %rsi    # 0x3d8605
movq %r14, %rdi
xorl %eax, %eax
callq 0x2c461b
movl 0x54(%r15), %eax
cmpl $0x0, 0xc(%rsp)
je 0x2cae0e
movl 0x8(%rsp), %ebp
testl %eax, %eax
jne 0x2cae1a
jmp 0x2cae57
testl %eax, %eax
movl 0x8(%rsp), %ebp
je 0x2caf1c
movq (%r15), %r13
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl $0xa4, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq %rbx, %rdi
movl %eax, %esi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x27b778
movq 0xa0(%r14), %rax
testq %rax, %rax
cmoveq %r14, %rax
movb $0x1, 0x21(%rax)
movq (%r15), %r15
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl $0x8f, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x27b778
movq (%r14), %rax
movq 0x10(%r14), %rdi
movq 0x20(%rax), %rax
movq 0x18(%rax,%r12), %rax
movl (%rax), %r8d
incl %r8d
movl $0x5e, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x2a83e1
movq 0x20(%rsp), %rbx
movq 0x20(%rbx), %rax
movq 0x18(%rax,%r12), %rax
movzwl 0x72(%rax), %ecx
testb $0x2, %cl
je 0x2caf0d
movq 0x10(%rax), %r15
testq %r15, %r15
je 0x2caf03
movq 0x10(%r15), %r14
cmpq $0x0, 0x18(%r14)
je 0x2caeee
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2a9368
movq $0x0, 0x8(%r14)
movw $0x0, 0x46(%r14)
movq (%r15), %r15
testq %r15, %r15
jne 0x2caec9
movq 0x20(%rbx), %rax
movq 0x18(%rax,%r12), %rax
movzwl 0x72(%rax), %ecx
andl $0xfffd, %ecx           # imm = 0xFFFD
movw %cx, 0x72(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x38(%r15), %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
movl %r13d, %eax
decl %eax
cmpl %ebp, %eax
movl %ebp, %r13d
cmovbl %r12d, %r13d
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0x2caf55
movl 0x58(%rcx), %edx
cmpl %r13d, %edx
movl %r13d, %esi
cmoval %edx, %esi
cmpl %edx, %eax
cmovael %esi, %r13d
movq 0x28(%rcx), %rcx
jmp 0x2caf38
testl %r13d, %r13d
je 0x2caf95
movq 0x70(%r15), %rax
testq %rax, %rax
je 0x2caf83
movq (%r14), %rcx
movq 0x20(%rcx), %rcx
addq $0x18, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
incl %edx
leaq 0x20(%rcx), %rsi
cmpq %rax, (%rcx)
movq %rsi, %rcx
jne 0x2caf73
jmp 0x2caf88
movl $0xffff8000, %edx       # imm = 0xFFFF8000
movq %r14, %rdi
movl %r13d, %esi
callq 0x2cb17c
jmp 0x2caf26
movl 0x54(%r15), %eax
movq 0x10(%rsp), %r12
jmp 0x2cae04