// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3DeleteTable
SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
  Index *pIndex, *pNext;
  TESTONLY( int nLookaside; ) /* Used to verify lookaside not used for schema */

  assert( !pTable || pTable->nRef>0 );

  /* Do not delete the table until the reference count reaches zero. */
  if( !pTable ) return;
  if( ((!db || db->pnBytesFreed==0) && (--pTable->nRef)>0) ) return;

  /* Record the number of outstanding lookaside allocations in schema Tables
  ** prior to doing any free() operations.  Since schema Tables do not use
  ** lookaside, this number should not change. */
  TESTONLY( nLookaside = (db && (pTable->tabFlags & TF_Ephemeral)==0) ?
                         db->lookaside.nOut : 0 );

  /* Delete all indices associated with this table. */
  for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
    pNext = pIndex->pNext;
    assert( pIndex->pSchema==pTable->pSchema );
    if( !db || db->pnBytesFreed==0 ){
      char *zName = pIndex->zName; 
      TESTONLY ( Index *pOld = ) sqlite3HashInsert(
         &pIndex->pSchema->idxHash, zName, sqlite3Strlen30(zName), 0
      );
      assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
      assert( pOld==pIndex || pOld==0 );
    }
    freeIndex(db, pIndex);
  }

  /* Delete any foreign keys attached to this table. */
  sqlite3FkDelete(db, pTable);

  /* Delete the Table structure itself.
  */
  sqliteDeleteColumnNames(db, pTable);
  sqlite3DbFree(db, pTable->zName);
  sqlite3DbFree(db, pTable->zColAff);
  sqlite3SelectDelete(db, pTable->pSelect);
#ifndef SQLITE_OMIT_CHECK
  sqlite3ExprListDelete(db, pTable->pCheck);
#endif
#ifndef SQLITE_OMIT_VIRTUALTABLE
  sqlite3VtabClear(db, pTable);
#endif
  sqlite3DbFree(db, pTable);

  /* Verify that no lookaside memory was used by schema tables */
  assert( nLookaside==0 || nLookaside==db->lookaside.nOut );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x9a4c
jmp 0x9b7f
cmpq $0x0, -0x8(%rbp)
je 0x9a61
movq -0x8(%rbp), %rax
cmpq $0x0, 0x328(%rax)
jne 0x9a7e
movq -0x10(%rbp), %rcx
movw 0x44(%rcx), %ax
addw $-0x1, %ax
movw %ax, 0x44(%rcx)
movzwl %ax, %eax
cmpl $0x0, %eax
jle 0x9a7e
jmp 0x9b7f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x9b08
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x9ab2
movq -0x8(%rbp), %rax
cmpq $0x0, 0x328(%rax)
jne 0x9af1
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
addq $0x20, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x92f0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x46e00
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x472c0
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x9a8a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4b420
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4b560
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x47420
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x47460
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4b620
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9cd0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)