// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movl %ecx, (%rsp)
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %rcx
movl %edx, 0x4(%rsp)
movslq %edx, %r13
movq %r13, %rax
shlq $0x5, %rax
movq %rcx, 0x8(%rsp)
movq 0x20(%rcx), %r12
movq %rax, 0x10(%rsp)
addq %rax, %r12
callq 0x2c5ddf
movq %rax, %rbx
movq 0xa0(%r14), %rbp
testq %rbp, %rbp
cmoveq %r14, %rbp
movq %r14, %rdi
movl %r13d, %esi
callq 0x2cbe18
movl $0x1, %eax
movl %r13d, %ecx
shll %cl, %eax
orl %eax, 0x70(%rbp)
orb $0x1, 0x20(%rbp)
cmpl $0x0, 0x54(%r15)
je 0x2d469f
movq %rbx, %rdi
movl $0xa2, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %r14, %rdi
movq %r15, %rsi
callq 0x2d4883
testq %rax, %rax
je 0x2d46c6
movq %rax, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x2d4928
movq 0x40(%r13), %r13
testq %r13, %r13
jne 0x2d46b2
testb $0x8, 0x40(%r15)
je 0x2d46e5
movq (%r12), %rdx
movq (%r15), %rcx
leaq 0x10d652(%rip), %rsi    # 0x3e1d2d
movq %r14, %rdi
xorl %eax, %eax
callq 0x2cdd65
movq (%r12), %rdx
movq (%r15), %rcx
leaq 0x10d667(%rip), %rsi    # 0x3e1d5a
movq %r14, %rdi
xorl %eax, %eax
callq 0x2cdd65
cmpl $0x0, (%rsp)
jne 0x2d478a
cmpl $0x0, 0x54(%r15)
jne 0x2d478a
movl 0x38(%r15), %r12d
xorl %ebp, %ebp
xorl %eax, %eax
leal -0x1(%rax), %ecx
cmpl %r12d, %ecx
movl %r12d, %r13d
cmovbl %ebp, %r13d
movq 0x10(%r15), %rdx
testq %rdx, %rdx
je 0x2d4744
movl 0x58(%rdx), %esi
cmpl %r13d, %esi
movl %r13d, %edi
cmoval %esi, %edi
cmpl %esi, %ecx
cmovael %edi, %r13d
movq 0x28(%rdx), %rdx
jmp 0x2d4727
testl %r13d, %r13d
je 0x2d4785
movq 0x70(%r15), %rax
testq %rax, %rax
je 0x2d4772
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 0x2d4762
jmp 0x2d4777
movl $0xffff8000, %edx       # imm = 0xFFFF8000
movq %r14, %rdi
movl %r13d, %esi
callq 0x2d4a7d
movl %r13d, %eax
testl %r13d, %r13d
jne 0x2d4716
cmpl $0x0, 0x54(%r15)
movl 0x4(%rsp), %ebp
je 0x2d47cd
movq (%r15), %r13
movq %rbx, %rdi
movl $0xa4, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl %eax, %esi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x285198
movq 0xa0(%r14), %rax
testq %rax, %rax
cmoveq %r14, %rax
movb $0x1, 0x21(%rax)
movq (%r15), %r15
movq %rbx, %rdi
movl $0x8f, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x285198
movq (%r14), %rax
movq 0x10(%r14), %rdi
movq 0x20(%rax), %rax
movq 0x10(%rsp), %r12
movq 0x18(%rax,%r12), %rax
movl (%rax), %r8d
incl %r8d
movl $0x5e, %esi
movl %ebp, %edx
movl $0x1, %ecx
callq 0x2b200c
movq 0x8(%rsp), %rbx
movq 0x20(%rbx), %rax
movq 0x18(%rax,%r12), %rax
testb $0x2, 0x72(%rax)
je 0x2d4874
movq 0x10(%rax), %r15
testq %r15, %r15
je 0x2d4866
movq 0x10(%r15), %r14
cmpq $0x0, 0x18(%r14)
je 0x2d4861
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2b2f93
movq $0x0, 0x8(%r14)
movw $0x0, 0x46(%r14)
movq (%r15), %r15
jmp 0x2d4837
movq 0x20(%rbx), %rax
movq 0x18(%rax,%r12), %rax
andw $-0x3, 0x72(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq