// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/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, 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.
  */
  sqlite3DeleteColumnNames(db, pTable);
  sqlite3DbFree(db, pTable->zName);
  sqlite3DbFree(db, pTable->zColAff);
  sqlite3SelectDelete(db, pTable->pSelect);
  sqlite3ExprListDelete(db, pTable->pCheck);
#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 %r12
pushq %rbx
testq %rsi, %rsi
je 0xb672
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
je 0xb66c
cmpq $0x0, 0x328(%r14)
jne 0xb67b
decw 0x40(%rbx)
je 0xb67b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0xb6b9
movq 0x28(%r15), %r12
testq %r14, %r14
je 0xb697
cmpq $0x0, 0x328(%r14)
jne 0xb6a9
movq (%r15), %rsi
movq 0x30(%r15), %rdi
addq $0x20, %rdi
xorl %edx, %edx
callq 0x36548
movq %r14, %rdi
movq %r15, %rsi
callq 0x36798
movq %r12, %r15
jmp 0xb67f
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0xb73c
testq %r14, %r14
je 0xb6d1
cmpq $0x0, 0x328(%r14)
jne 0xb710
movq 0x18(%r15), %rdx
movq 0x20(%r15), %rax
testq %rax, %rax
je 0xb6e4
movq %rdx, 0x18(%rax)
jmp 0xb703
testq %rdx, %rdx
movq %rdx, %rax
cmoveq %r15, %rax
movq 0x10(%rax), %rsi
movq 0x68(%rbx), %rdi
addq $0x50, %rdi
callq 0x36548
movq 0x18(%r15), %rdx
testq %rdx, %rdx
je 0xb710
movq 0x20(%r15), %rax
movq %rax, 0x20(%rdx)
movq 0x30(%r15), %rsi
movq %r14, %rdi
callq 0x38b72
movq 0x38(%r15), %rsi
movq %r14, %rdi
callq 0x38b72
movq 0x8(%r15), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0xb856
movq %r12, %r15
jmp 0xb6bd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x38951
movq (%rbx), %rsi
movq %r14, %rdi
callq 0xb856
movq 0x28(%rbx), %rsi
movq %r14, %rdi
callq 0xb856
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x368d0
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x36862
movq %r14, %rdi
movq %rbx, %rsi
callq 0x389d9
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xb856