// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: deleteTable
static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
  Index *pIndex, *pNext;

#ifdef SQLITE_DEBUG
  /* 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.
  **
  ** If malloc has already failed, it may be that it failed while allocating
  ** a Table object that was going to be marked ephemeral. So do not check
  ** that no lookaside memory is used in this case either. */
  int nLookaside = 0;
  if( db && !db->mallocFailed && (pTable->tabFlags & TF_Ephemeral)==0 ){
    nLookaside = sqlite3LookasideUsed(db, 0);
  }
#endif

  /* Delete all indices associated with this table. */
  for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
    pNext = pIndex->pNext;
    assert( pIndex->pSchema==pTable->pSchema
         || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF) );
    if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){
      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 );
    }
    sqlite3FreeIndex(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==sqlite3LookasideUsed(db,0) );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %r12
testq %r12, %r12
je 0x2a91d1
movq %r12, %r15
movq 0x28(%r12), %r12
testq %r14, %r14
je 0x2a91ac
cmpq $0x0, 0x2d0(%r14)
jne 0x2a91c4
cmpl $0x0, 0x54(%rbx)
jne 0x2a91c4
movq (%r15), %rsi
movq 0x30(%r15), %rdi
addq $0x20, %rdi
xorl %edx, %edx
callq 0x2a5210
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a60fe
jmp 0x2a9190
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x2a925e
testq %r14, %r14
je 0x2a91ed
cmpq $0x0, 0x2d0(%r14)
jne 0x2a922f
movq 0x18(%r15), %rdx
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x2a9200
movq %rdx, 0x18(%rax)
jmp 0x2a921e
movq 0x70(%rbx), %rdi
addq $0x50, %rdi
testq %rdx, %rdx
je 0x2a9213
movq 0x10(%rdx), %rsi
jmp 0x2a9219
movq 0x10(%r15), %rsi
xorl %edx, %edx
callq 0x2a5210
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x2a922f
movq 0x20(%r15), %rcx
movq %rcx, 0x20(%rax)
movq 0x30(%r15), %rsi
movq %r14, %rdi
callq 0x2a93f1
movq 0x38(%r15), %rsi
movq %r14, %rdi
callq 0x2a93f1
movq 0x8(%r15), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x282904
movq %r12, %r15
testq %r12, %r12
jne 0x2a91de
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a9368
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x2a9279
movq %r14, %rdi
callq 0x282904
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x2a928a
movq %r14, %rdi
callq 0x282904
movq 0x18(%rbx), %rsi
testq %rsi, %rsi
je 0x2a92a0
movq %r14, %rdi
movl $0x1, %edx
callq 0x2a62e6
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x2a92b1
movq %r14, %rdi
callq 0x2a65a3
testq %r14, %r14
je 0x2a92c0
cmpq $0x0, 0x2d0(%r14)
jne 0x2a9305
movq 0x60(%rbx), %rax
movq $0x0, 0x60(%rbx)
testq %rax, %rax
je 0x2a9305
leaq 0x60(%rbx), %rcx
movq (%rax), %rdx
testq %rdx, %rdx
je 0x2a92ed
movq 0x218(%rdx), %rsi
addq $0x218, %rdx            # imm = 0x218
jmp 0x2a92f2
movq %rcx, %rdx
xorl %esi, %esi
movq 0x28(%rax), %rdi
movq %rax, (%rdx)
movq %rsi, 0x28(%rax)
movq %rdi, %rax
testq %rdi, %rdi
jne 0x2a92d5
movq 0x58(%rbx), %rsi
testq %rsi, %rsi
je 0x2a9352
movl 0x54(%rbx), %eax
testl %eax, %eax
jle 0x2a934a
xorl %r15d, %r15d
cmpq $0x1, %r15
je 0x2a9336
movq 0x58(%rbx), %rcx
movq (%rcx,%r15,8), %rsi
testq %rsi, %rsi
je 0x2a9336
movq %r14, %rdi
callq 0x282904
movl 0x54(%rbx), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x2a9318
movq 0x58(%rbx), %rsi
testq %rsi, %rsi
je 0x2a9352
movq %r14, %rdi
callq 0x282904
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x282904