// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x9407
movq %rdi, %r14
testq %rdi, %rdi
je 0x9401
cmpq $0x0, 0x328(%r14)
jne 0x9416
decw 0x44(%rsi)
je 0x9416
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, -0x30(%rbp)
movq 0x10(%rsi), %r15
testq %r15, %r15
je 0x9468
movq 0x28(%r15), %rbx
testq %r14, %r14
je 0x9436
cmpq $0x0, 0x328(%r14)
jne 0x9458
movq (%r15), %r12
movq 0x30(%r15), %r13
addq $0x20, %r13
movq %r12, %rdi
callq 0x8f8e
movq %r13, %rdi
movq %r12, %rsi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x2f1a7
movq %r14, %rdi
movq %r15, %rsi
callq 0x2f445
movq %rbx, %r15
jmp 0x941e
movq -0x30(%rbp), %rax
movq 0x20(%rax), %r15
testq %r15, %r15
je 0x950e
testq %r14, %r14
je 0x9488
cmpq $0x0, 0x328(%r14)
jne 0x94df
movq 0x18(%r15), %r12
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x949b
movq %r12, 0x18(%rax)
jmp 0x94d1
testq %r12, %r12
movq %r12, %rax
cmoveq %r15, %rax
movq 0x10(%rax), %r13
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rbx
addq $0x50, %rbx
movq %r13, %rdi
callq 0x8f8e
movq %rbx, %rdi
movq %r13, %rsi
movl %eax, %edx
movq %r12, %rcx
callq 0x2f1a7
movq 0x18(%r15), %r12
testq %r12, %r12
je 0x94df
movq 0x20(%r15), %rax
movq %rax, 0x20(%r12)
movq 0x30(%r15), %rsi
movq %r14, %rdi
callq 0x3186d
movq 0x38(%r15), %rsi
movq %r14, %rdi
callq 0x3186d
movq 0x8(%r15), %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x968b
movq %rbx, %r15
jmp 0x9470
movq %r14, %rdi
movq -0x30(%rbp), %r15
movq %r15, %rsi
callq 0x317e5
movq (%r15), %rsi
movq %r14, %rdi
callq 0x968b
movq 0x28(%r15), %rsi
movq %r14, %rdi
callq 0x968b
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x2f500
movq 0x30(%r15), %rsi
movq %r14, %rdi
callq 0x2f527
testq %r14, %r14
je 0x955b
cmpq $0x0, 0x328(%r14)
jne 0x9565
xorl %edi, %edi
movq %r15, %rsi
callq 0x3097c
cmpq $0x0, 0x50(%r15)
je 0x959e
xorl %ebx, %ebx
movslq 0x4c(%r15), %rax
cmpq %rax, %rbx
jge 0x9592
cmpq $0x1, %rbx
je 0x958d
movq 0x50(%r15), %rax
movq (%rax,%rbx,8), %rsi
movq %r14, %rdi
callq 0x968b
incq %rbx
jmp 0x956e
movq 0x50(%r15), %rsi
movq %r14, %rdi
callq 0x968b
movq %r14, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x968b