// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rsi, %rbx
movq (%rdi), %r14
cmpb $0x0, 0x50(%r14)
je 0x3b4fd
movq %r14, %rdi
movq %rbx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x341f5
movl %ecx, %r12d
movl %edx, %eax
movq %rdi, %r15
testl %ecx, %ecx
je 0x3b50d
incb 0x53(%r14)
leaq 0x8(%rbx), %rdx
movq %r15, %rdi
movl %eax, -0x2c(%rbp)
movl %eax, %esi
callq 0x4a2cc
testl %r12d, %r12d
je 0x3b527
decb 0x53(%r14)
testq %rax, %rax
je 0x3b55e
movq 0x68(%rax), %rsi
testq %rsi, %rsi
je 0x3b574
movl 0x28(%r14), %ecx
testl %ecx, %ecx
jle 0x3b57c
movq 0x20(%r14), %rdx
addq $0x18, %rdx
xorl %r12d, %r12d
cmpq %rsi, (%rdx)
je 0x3b57f
incq %r12
addq $0x20, %rdx
cmpq %r12, %rcx
jne 0x3b548
movl %ecx, %r12d
jmp 0x3b57f
testl %r12d, %r12d
je 0x3b4e4
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x4f7ee
jmp 0x3b4e4
movl $0xfff0bdc0, %r12d      # imm = 0xFFF0BDC0
jmp 0x3b57f
xorl %r12d, %r12d
movq %rax, -0x38(%rbp)
testb $0x10, 0x46(%rax)
je 0x3b59d
movq %r15, %rdi
movq -0x38(%rbp), %rsi
callq 0x4a326
testl %eax, %eax
jne 0x3b4e4
cmpl $0x1, %r12d
leaq 0x3e971(%rip), %rax     # 0x79f19
leaq 0x3e97d(%rip), %rdx     # 0x79f2c
cmoveq %rax, %rdx
movq 0x20(%r14), %rax
movslq %r12d, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r13
movq %r15, %rdi
movl $0x9, %esi
xorl %ecx, %ecx
movq %r13, %r8
callq 0x45d75
movl -0x2c(%rbp), %ecx
testl %eax, %eax
jne 0x3b4e4
testl %ecx, %ecx
je 0x3b5fb
xorl %eax, %eax
cmpl $0x1, %r12d
setne %al
leal 0xf(,%rax,2), %esi
xorl %ecx, %ecx
movq -0x38(%rbp), %rdx
jmp 0x3b63a
movq -0x38(%rbp), %rdx
testb $0x10, 0x46(%rdx)
jne 0x3b619
xorl %eax, %eax
cmpl $0x1, %r12d
sete %al
leal 0xb(,%rax,2), %esi
xorl %ecx, %ecx
jmp 0x3b63a
movq 0x58(%rdx), %rax
testq %rax, %rax
je 0x3b62d
cmpq %r14, (%rax)
je 0x3b62d
movq 0x28(%rax), %rax
jmp 0x3b61d
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movl $0x1e, %esi
movq (%rdx), %rdx
movq %r15, %rdi
movq %r13, %r8
callq 0x45d75
testl %eax, %eax
jne 0x3b4e4
movq -0x38(%rbp), %rax
movq (%rax), %rdx
movq %r15, %rdi
movl $0x9, %esi
xorl %ecx, %ecx
movq %r13, %r8
callq 0x45d75
testl %eax, %eax
jne 0x3b4e4
movq -0x38(%rbp), %r13
movq (%r13), %rsi
leaq 0x7(%rsi), %rax
movq %rax, -0x48(%rbp)
movl $0x7, %ecx
leaq 0x3f75f(%rip), %r8      # 0x7adec
xorl %r10d, %r10d
leaq 0x3a9c9(%rip), %rax     # 0x76060
leaq 0x3f755(%rip), %rdx     # 0x7adf3
movq %r8, %r11
movq %rsi, -0x40(%rbp)
movzbl (%rsi), %r9d
testq %r9, %r9
je 0x3b6d2
movb (%r9,%rax), %r9b
movzbl (%r11), %edi
cmpb (%rdi,%rax), %r9b
jne 0x3b6da
incq %rsi
incq %r10
incq %r11
decq %rcx
jne 0x3b6a5
xorl %ecx, %ecx
movq -0x48(%rbp), %rsi
jmp 0x3b6dd
addq %r10, %r8
movq %r8, %rdx
jmp 0x3b6dd
movq %r11, %rdx
testl %ecx, %ecx
jle 0x3b6ef
movzbl (%rsi), %ecx
movb (%rcx,%rax), %cl
movzbl (%rdx), %edx
cmpb (%rdx,%rax), %cl
jne 0x3b762
movq -0x40(%rbp), %rsi
leaq 0xb(%rsi), %rcx
movq %rcx, -0x48(%rbp)
movl $0xb, %ecx
leaq 0x4007d(%rip), %r8      # 0x7b784
xorl %r10d, %r10d
leaq 0x4007e(%rip), %rdi     # 0x7b78f
movq %r8, %r11
movzbl (%rsi), %r9d
testq %r9, %r9
je 0x3b741
movb (%r9,%rax), %dl
movzbl (%r11), %r9d
cmpb (%r9,%rax), %dl
jne 0x3b749
incq %rsi
incq %r10
incq %r11
decq %rcx
jne 0x3b714
xorl %ecx, %ecx
movq -0x48(%rbp), %rsi
jmp 0x3b74c
addq %r10, %r8
movq %r8, %rdi
jmp 0x3b74c
movq %r11, %rdi
testl %ecx, %ecx
jle 0x3b762
movzbl (%rsi), %ecx
movb (%rcx,%rax), %cl
movzbl (%rdi), %edx
cmpb (%rdx,%rax), %cl
jne 0x3b7e7
movq 0x18(%r13), %rax
cmpl $0x0, -0x2c(%rbp)
je 0x3b77a
testq %rax, %rax
jne 0x3b788
leaq 0x40034(%rip), %rsi     # 0x7b7ac
jmp 0x3b7ee
testq %rax, %rax
je 0x3b788
leaq 0x40048(%rip), %rsi     # 0x7b7ce
jmp 0x3b7ee
movq %r15, %rdi
callq 0x45b57
testq %rax, %rax
je 0x3b4e4
movq %r15, %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x460a9
movq -0x38(%rbp), %r13
movq (%r13), %rcx
leaq 0x40036(%rip), %rdx     # 0x7b7ee
movq %r15, %rdi
movl %r12d, %esi
callq 0x4f89f
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x4f938
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl -0x2c(%rbp), %ecx
callq 0x4fa62
jmp 0x3b4e4
leaq 0x3ffa2(%rip), %rsi     # 0x7b790
movq %r15, %rdi
movq -0x40(%rbp), %rdx
xorl %eax, %eax
callq 0x11724
jmp 0x3b4e4