// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %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, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x52420
jmp 0x526ec
cmpl $0x0, -0x18(%rbp)
je 0x52433
movq -0x30(%rbp), %rax
movb 0x53(%rax), %cl
addb $0x1, %cl
movb %cl, 0x53(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
callq 0x64100
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x5245e
movq -0x30(%rbp), %rax
movb 0x53(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x53(%rax)
cmpq $0x0, -0x20(%rbp)
jne 0x52481
cmpl $0x0, -0x18(%rbp)
je 0x5247c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x6b6a0
jmp 0x526ec
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x68(%rax), %rsi
callq 0x13940
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x524bc
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x64180
cmpl $0x0, %eax
je 0x524bc
jmp 0x526ec
movl -0x34(%rbp), %edx
leaq 0x5c562(%rip), %rax     # 0xaea28
leaq 0x5c548(%rip), %rcx     # 0xaea15
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq -0x48(%rbp), %r8
movl $0x9, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x5e720
cmpl $0x0, %eax
je 0x5251e
jmp 0x526ec
cmpl $0x0, -0x14(%rbp)
je 0x5253c
cmpl $0x1, -0x34(%rbp)
jne 0x52533
movl $0xf, -0x38(%rbp)
jmp 0x5253a
movl $0x11, -0x38(%rbp)
jmp 0x52588
movq -0x20(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x5256e
movl $0x1e, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x49880
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x52586
cmpl $0x1, -0x34(%rbp)
jne 0x5257d
movl $0xd, -0x38(%rbp)
jmp 0x52584
movl $0xb, -0x38(%rbp)
jmp 0x52586
jmp 0x52588
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
callq 0x5e720
cmpl $0x0, %eax
je 0x525ad
jmp 0x526ec
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x48(%rbp), %r8
movl $0x9, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x5e720
cmpl $0x0, %eax
je 0x525d4
jmp 0x526ec
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x5d306(%rip), %rsi     # 0xaf8e8
movl $0x7, %edx
callq 0x9210
cmpl $0x0, %eax
jne 0x5262c
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq 0x5dc81(%rip), %rsi     # 0xb0280
movl $0xb, %edx
callq 0x9210
cmpl $0x0, %eax
je 0x5262c
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x5dc6c(%rip), %rsi     # 0xb028c
movb $0x0, %al
callq 0x136f0
jmp 0x526ec
cmpl $0x0, -0x14(%rbp)
je 0x5265b
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x5265b
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x5dc59(%rip), %rsi     # 0xb02a8
movb $0x0, %al
callq 0x136f0
jmp 0x526ec
cmpl $0x0, -0x14(%rbp)
jne 0x52687
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x52687
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x5dc4c(%rip), %rsi     # 0xb02ca
movb $0x0, %al
callq 0x136f0
jmp 0x526ec
movq -0x8(%rbp), %rdi
callq 0x5e000
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x526ea
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
movl $0x1, %esi
callq 0x5ec70
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rcx
leaq 0x5dc29(%rip), %rdx     # 0xb02ea
callq 0x6b730
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x6b7e0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x14(%rbp), %ecx
callq 0x6b960
jmp 0x526ec
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x475c0
addq $0x50, %rsp
popq %rbp
retq
nop