// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, -0x3c(%rbp)
movq %rsi, %r12
movq %rdi, %r15
movq (%rdi), %rax
movl %edx, -0x2c(%rbp)
movslq %edx, %r13
movq %r13, %rcx
shlq $0x5, %rcx
movq %rax, -0x50(%rbp)
movq 0x20(%rax), %r14
movq %rcx, -0x48(%rbp)
addq %rcx, %r14
callq 0x45b57
movq %rax, -0x38(%rbp)
movq 0x1d8(%r15), %rbx
testq %rbx, %rbx
cmoveq %r15, %rbx
movq %r15, %rdi
movl %r13d, %esi
callq 0x45ff7
movl $0x1, %eax
movl %r13d, %ecx
shll %cl, %eax
orl %eax, 0x164(%rbx)
orb $0x1, 0x23(%rbx)
testb $0x10, 0x46(%r12)
je 0x4faee
movq -0x38(%rbp), %rdi
movl $0x86, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %r15, %rdi
movq %r12, %rsi
callq 0x4fd20
testq %rax, %rax
je 0x4fb15
movq %rax, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x4fdd7
movq 0x40(%r13), %r13
testq %r13, %r13
jne 0x4fb01
testb $0x8, 0x46(%r12)
movq -0x50(%rbp), %rbx
je 0x4fb39
movq (%r14), %rdx
movq (%r12), %rcx
leaq 0x2bcef(%rip), %rsi     # 0x7b81e
movq %r15, %rdi
xorl %eax, %eax
callq 0x465b3
movq (%r14), %rdx
cmpl $0x1, -0x2c(%rbp)
leaq 0x2a3d2(%rip), %rax     # 0x79f19
leaq 0x2a3de(%rip), %rcx     # 0x79f2c
cmoveq %rax, %rcx
movq (%r12), %r8
leaq 0x2bcee(%rip), %rsi     # 0x7b84b
movq %r15, %rdi
xorl %eax, %eax
callq 0x465b3
cmpl $0x0, -0x3c(%rbp)
jne 0x4fc17
testb $0x10, 0x46(%r12)
jne 0x4fc17
movl 0x3c(%r12), %r14d
xorl %eax, %eax
cmpl %eax, %r14d
movl $0x0, %r13d
cmovll %r14d, %r13d
testl %eax, %eax
cmovel %r14d, %r13d
movq 0x10(%r12), %rcx
testq %rcx, %rcx
je 0x4fbbf
movl 0x50(%rcx), %edx
cmpl %r13d, %edx
movl %r13d, %esi
cmovgl %edx, %esi
cmpl %eax, %edx
cmovll %esi, %r13d
testl %eax, %eax
cmovel %esi, %r13d
movq 0x28(%rcx), %rcx
jmp 0x4fb9c
testl %r13d, %r13d
je 0x4fc0e
movq 0x68(%r12), %rax
testq %rax, %rax
je 0x4fbf7
movq (%r15), %rdx
movl 0x28(%rdx), %ecx
testl %ecx, %ecx
jle 0x4fbfe
movq 0x20(%rdx), %rsi
addq $0x18, %rsi
xorl %edx, %edx
cmpq %rax, (%rsi)
je 0x4fc00
incq %rdx
addq $0x20, %rsi
cmpq %rdx, %rcx
jne 0x4fbe2
movl %ecx, %edx
jmp 0x4fc00
movl $0xfff0bdc0, %edx       # imm = 0xFFF0BDC0
jmp 0x4fc00
xorl %edx, %edx
movq %r15, %rdi
movl %r13d, %esi
callq 0x4ff8b
movl %r13d, %eax
testl %r13d, %r13d
jne 0x4fb84
testb $0x10, 0x46(%r12)
je 0x4fc4b
movq (%r12), %r13
movq -0x38(%rbp), %r14
movq %r14, %rdi
movl $0x88, %esi
movl -0x2c(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %r14, %rdi
movl %eax, %esi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x11975
movq (%r12), %r12
movq -0x38(%rbp), %r13
movq %r13, %rdi
movl $0x72, %esi
movl -0x2c(%rbp), %r14d
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %r13, %rdi
movl %eax, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x11975
movq %r15, %rdi
movl %r14d, %esi
callq 0x466e1
movq 0x20(%rbx), %rax
movq -0x48(%rbp), %r12
movq 0x18(%rax,%r12), %rax
testb $0x2, 0x72(%rax)
je 0x4fcda
movq 0x10(%rax), %r15
testq %r15, %r15
je 0x4fccc
movq 0x10(%r15), %r14
cmpq $0x0, 0x18(%r14)
je 0x4fcc7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x367d5
movq $0x0, 0x8(%r14)
movw $0x0, 0x42(%r14)
movq (%r15), %r15
jmp 0x4fc9d
movq 0x20(%rbx), %rax
movq 0x18(%rax,%r12), %rax
andw $-0x3, 0x72(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq