// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3DropTable
SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
  Table *pTab;
  Vdbe *v;
  sqlite3 *db = pParse->db;
  int iDb;

  if( db->mallocFailed ){
    goto exit_drop_table;
  }
  assert( pParse->nErr==0 );
  assert( pName->nSrc==1 );
  if( noErr ) db->suppressErr++;
  pTab = sqlite3LocateTableItem(pParse, isView, &pName->a[0]);
  if( noErr ) db->suppressErr--;

  if( pTab==0 ){
    if( noErr ) sqlite3CodeVerifyNamedSchema(pParse, pName->a[0].zDatabase);
    goto exit_drop_table;
  }
  iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
  assert( iDb>=0 && iDb<db->nDb );

  /* If pTab is a virtual table, call ViewGetColumnNames() to ensure
  ** it is initialized.
  */
  if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){
    goto exit_drop_table;
  }
#ifndef SQLITE_OMIT_AUTHORIZATION
  {
    int code;
    const char *zTab = SCHEMA_TABLE(iDb);
    const char *zDb = db->aDb[iDb].zName;
    const char *zArg2 = 0;
    if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){
      goto exit_drop_table;
    }
    if( isView ){
      if( !OMIT_TEMPDB && iDb==1 ){
        code = SQLITE_DROP_TEMP_VIEW;
      }else{
        code = SQLITE_DROP_VIEW;
      }
#ifndef SQLITE_OMIT_VIRTUALTABLE
    }else if( IsVirtual(pTab) ){
      code = SQLITE_DROP_VTABLE;
      zArg2 = sqlite3GetVTable(db, pTab)->pMod->zName;
#endif
    }else{
      if( !OMIT_TEMPDB && iDb==1 ){
        code = SQLITE_DROP_TEMP_TABLE;
      }else{
        code = SQLITE_DROP_TABLE;
      }
    }
    if( sqlite3AuthCheck(pParse, code, pTab->zName, zArg2, zDb) ){
      goto exit_drop_table;
    }
    if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
      goto exit_drop_table;
    }
  }
#endif
  if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 
    && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){
    sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
    goto exit_drop_table;
  }

#ifndef SQLITE_OMIT_VIEW
  /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used
  ** on a table.
  */
  if( isView && pTab->pSelect==0 ){
    sqlite3ErrorMsg(pParse, "use DROP TABLE to delete table %s", pTab->zName);
    goto exit_drop_table;
  }
  if( !isView && pTab->pSelect ){
    sqlite3ErrorMsg(pParse, "use DROP VIEW to delete view %s", pTab->zName);
    goto exit_drop_table;
  }
#endif

  /* Generate code to remove the table from the master table
  ** on disk.
  */
  v = sqlite3GetVdbe(pParse);
  if( v ){
    sqlite3BeginWriteOperation(pParse, 1, iDb);
    sqlite3ClearStatTables(pParse, iDb, "tbl", pTab->zName);
    sqlite3FkDropTable(pParse, pName, pTab);
    sqlite3CodeDropTable(pParse, pTab, iDb, isView);
  }

exit_drop_table:
  sqlite3SrcListDelete(db, pName);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq (%rdi), %r14
cmpb $0x0, 0x50(%r14)
je 0x37ba2
movq %r14, %rdi
movq %rbx, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f60e
movl %ecx, %r12d
movl %edx, %r13d
movq %rdi, %r15
testl %ecx, %ecx
je 0x37bb3
incb 0x53(%r14)
leaq 0x8(%rbx), %rdx
movq %r15, %rdi
movl %r13d, %esi
callq 0x45a80
testl %r12d, %r12d
je 0x37bde
decb 0x53(%r14)
testq %rax, %rax
jne 0x37be3
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x4a330
jmp 0x37b89
testq %rax, %rax
je 0x37b89
movq 0x68(%rax), %rsi
movq %r14, %rdi
movq %rax, -0x30(%rbp)
callq 0x1064e
movq -0x30(%rbp), %rsi
movl %eax, -0x34(%rbp)
testb $0x10, 0x46(%rsi)
je 0x37c10
movq %r15, %rdi
callq 0x45ad0
testl %eax, %eax
jne 0x37b89
movl -0x34(%rbp), %ecx
cmpl $0x1, %ecx
leaq 0x3431c(%rip), %rax     # 0x6bf39
leaq 0x34328(%rip), %rdx     # 0x6bf4c
cmoveq %rax, %rdx
movq 0x20(%r14), %rax
movslq %ecx, %rcx
shlq $0x5, %rcx
movq %rcx, -0x58(%rbp)
movq (%rax,%rcx), %r12
pushq $0x9
popq %rsi
movq %r15, %rdi
movq %rdx, -0x50(%rbp)
xorl %ecx, %ecx
movq %r12, %r8
callq 0x42151
movq -0x30(%rbp), %rdx
testl %eax, %eax
jne 0x37b89
testl %r13d, %r13d
je 0x37c72
xorl %eax, %eax
cmpl $0x1, -0x34(%rbp)
setne %al
leal 0xf(,%rax,2), %esi
jmp 0x37c8c
testb $0x10, 0x46(%rdx)
jne 0x37cfe
xorl %eax, %eax
cmpl $0x1, -0x34(%rbp)
sete %al
leal 0xb(,%rax,2), %esi
xorl %ecx, %ecx
movq (%rdx), %rdx
movq %r15, %rdi
movq %r12, %r8
callq 0x42151
movq -0x30(%rbp), %rcx
testl %eax, %eax
jne 0x37b89
movq (%rcx), %rdx
pushq $0x9
popq %rsi
movq %r15, %rdi
xorl %ecx, %ecx
movq %r12, %r8
callq 0x42151
movq -0x30(%rbp), %r12
testl %eax, %eax
jne 0x37b89
movq (%r12), %rdi
leaq 0x3513a(%rip), %rsi     # 0x6ce0c
pushq $0x7
popq %rdx
movq %rdi, -0x40(%rbp)
callq 0x8f45
testl %eax, %eax
je 0x37d1d
movq -0x40(%rbp), %rdx
movq 0x18(%r12), %rax
testl %r13d, %r13d
je 0x37d44
testq %rax, %rax
jne 0x37d5f
leaq 0x35ad0(%rip), %rsi     # 0x6d7cc
jmp 0x37d50
movq %r14, %rdi
movq %rdx, %rsi
callq 0x3095c
movq -0x30(%rbp), %rdx
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
pushq $0x1e
popq %rsi
jmp 0x37c8e
leaq 0x35a80(%rip), %rsi     # 0x6d7a4
pushq $0xb
popq %rdx
movq -0x40(%rbp), %rdi
callq 0x8f45
testl %eax, %eax
je 0x37ce2
leaq 0x35a75(%rip), %rsi     # 0x6d7b0
movq %r15, %rdi
movq -0x40(%rbp), %rdx
jmp 0x37d53
testq %rax, %rax
je 0x37d5f
leaq 0x35a9e(%rip), %rsi     # 0x6d7ee
movq %r15, %rdi
xorl %eax, %eax
callq 0x104d6
jmp 0x37b89
movq %r15, %rdi
callq 0x41ef4
movq -0x30(%rbp), %r12
testq %rax, %rax
je 0x37b89
pushq $0x1
popq %rsi
movq %r15, %rdi
movl -0x34(%rbp), %edx
callq 0x423f5
movq (%r12), %rcx
leaq 0x35a81(%rip), %rdx     # 0x6d80e
movq %r15, %rdi
movl -0x34(%rbp), %esi
callq 0x4a39d
movq (%r15), %rcx
testb $0x8, 0x2e(%rcx)
je 0x37dba
movq -0x30(%rbp), %rax
testb $0x10, 0x46(%rax)
jne 0x37dba
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x37fb8
movq (%r15), %rax
movq %rax, -0x48(%rbp)
movq 0x20(%rax), %rax
addq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %r15, %rdi
callq 0x41ef4
movq %rax, %r12
pushq $0x1
popq %rsi
movq %r15, %rdi
movl -0x34(%rbp), %edx
callq 0x423f5
movq -0x30(%rbp), %rsi
testb $0x10, 0x46(%rsi)
je 0x37e01
movq %r12, %rdi
movl $0x86, %esi
callq 0x41f34
movq -0x30(%rbp), %rsi
movq %r12, -0x40(%rbp)
movq %r15, %rdi
callq 0x4a45f
movq %rax, %r12
testq %r12, %r12
je 0x37e27
movq %r15, %rdi
movq %r12, %rsi
callq 0x4a4e8
movq 0x40(%r12), %r12
jmp 0x37e10
movq -0x30(%rbp), %rax
testb $0x8, 0x46(%rax)
movq -0x60(%rbp), %r12
je 0x37e4d
movq (%r12), %rdx
movq (%rax), %rcx
leaq 0x359fb(%rip), %rsi     # 0x6d83e
movq %r15, %rdi
xorl %eax, %eax
callq 0x4268c
movq (%r12), %rdx
movq -0x30(%rbp), %rax
movq (%rax), %r8
leaq 0x35a0c(%rip), %rsi     # 0x6d86b
movq %r15, %rdi
movq -0x50(%rbp), %rcx
xorl %eax, %eax
callq 0x4268c
movq -0x30(%rbp), %r8
movb 0x46(%r8), %al
testl %r13d, %r13d
movq -0x40(%rbp), %r12
jne 0x37f06
movl %eax, %ecx
andb $0x10, %cl
jne 0x37f06
movl 0x3c(%r8), %r13d
movq %r8, %rax
addq $0x10, %rax
movq %rax, -0x50(%rbp)
xorl %eax, %eax
cmpl %eax, %r13d
movl $0x0, %r12d
cmovll %r13d, %r12d
testl %eax, %eax
cmovel %r13d, %r12d
movq -0x50(%rbp), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x37ed7
movl 0x50(%rcx), %edx
cmpl %r12d, %edx
movl %r12d, %esi
cmovgl %edx, %esi
cmpl %eax, %edx
cmovll %esi, %r12d
testl %eax, %eax
cmovel %esi, %r12d
addq $0x28, %rcx
jmp 0x37eb1
testl %r12d, %r12d
je 0x37efe
movq (%r15), %rdi
movq 0x68(%r8), %rsi
callq 0x1064e
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x4a635
movq -0x30(%rbp), %r8
movl %r12d, %eax
jmp 0x37e9a
movb 0x46(%r8), %al
movq -0x40(%rbp), %r12
testb $0x10, %al
movq -0x48(%rbp), %r13
je 0x37f2e
movq (%r8), %r9
andl $0x0, (%rsp)
movq %r12, %rdi
movl $0x88, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x41fd2
movq -0x30(%rbp), %r8
movq (%r8), %r9
andl $0x0, (%rsp)
pushq $0x72
popq %rsi
movq %r12, %rdi
movl -0x34(%rbp), %r12d
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x41fd2
movq %r15, %rdi
movl %r12d, %esi
callq 0x427b7
movq 0x20(%r13), %rax
movq -0x58(%rbp), %rcx
movq 0x18(%rax,%rcx), %r12
testb $0x2, 0x72(%r12)
je 0x37b89
addq $0x10, %r12
movq (%r12), %r12
testq %r12, %r12
je 0x37fa1
movq 0x10(%r12), %r15
cmpq $0x0, 0x18(%r15)
je 0x37f74
movq %r13, %rdi
movq %r15, %rsi
callq 0x317e5
andq $0x0, 0x8(%r15)
andw $0x0, 0x42(%r15)
jmp 0x37f74
movq 0x20(%r13), %rax
movq -0x58(%rbp), %rcx
movq 0x18(%rax,%rcx), %rax
andw $-0x3, 0x72(%rax)
jmp 0x37b89
movq %rcx, -0x48(%rbp)
movq %r15, %rdi
callq 0x41ef4
movq %rax, %r12
movq -0x30(%rbp), %rdi
callq 0x4a434
movl $0x0, -0x40(%rbp)
testq %rax, %rax
jne 0x38015
movq -0x30(%rbp), %rax
addq $0x20, %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x37dba
leaq 0x8(%rcx), %rax
cmpb $0x0, 0x2c(%rcx)
je 0x37fe4
movq %r12, %rdi
callq 0x47934
pushq $0x7c
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rdi
movl %eax, -0x40(%rbp)
movl %eax, %ecx
callq 0x41f42
movb $0x1, 0x1f6(%r15)
movq -0x48(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4467b
movq %r15, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3b914
movb $0x0, 0x1f6(%r15)
movl 0x34(%r12), %ecx
addl $0x2, %ecx
pushq $0x7c
popq %rsi
movq %r12, -0x48(%rbp)
movq %r12, %rdi
xorl %edx, %edx
callq 0x41f42
leaq 0x3384a(%rip), %rcx     # 0x6b8aa
pushq $0x2
popq %rdx
pushq $-0x2
popq %r8
movq %r15, %rdi
movl $0x313, %esi            # imm = 0x313
callq 0x478d0
movl -0x40(%rbp), %r12d
testl %r12d, %r12d
je 0x37dba
jns 0x37dba
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
je 0x37dba
notl %r12d
movq -0x48(%rbp), %rcx
movl 0x34(%rcx), %ecx
movl %r12d, %edx
movl %ecx, (%rax,%rdx,4)
jmp 0x37dba