// File: /workspace/github_c_makefile_star2_O3/skeeto[P]flappy/sqlite3.c
// Function: sqlite3FkDropTable
SQLITE_PRIVATE void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTab){
  sqlite3 *db = pParse->db;
  if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){
    int iSkip = 0;
    Vdbe *v = sqlite3GetVdbe(pParse);

    assert( v );                  /* VDBE has already been allocated */
    if( sqlite3FkReferences(pTab)==0 ){
      /* Search for a deferred foreign key constraint for which this table
      ** is the child table. If one cannot be found, return without 
      ** generating any VDBE code. If one can be found, then jump over
      ** the entire DELETE if there are no outstanding deferred constraints
      ** when this statement is run.  */
      FKey *p;
      for(p=pTab->pFKey; p; p=p->pNextFrom){
        if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break;
      }
      if( !p ) return;
      iSkip = sqlite3VdbeMakeLabel(v);
      sqlite3VdbeAddOp2(v, OP_FkIfZero, 1, iSkip);
    }

    pParse->disableTriggers = 1;
    sqlite3DeleteFrom(pParse, sqlite3SrcListDup(db, pName, 0), 0);
    pParse->disableTriggers = 0;

    /* If the DELETE has generated immediate foreign key constraint 
    ** violations, halt the VDBE and return an error at this point, before
    ** any modifications to the schema are made. This is because statement
    ** transactions are not able to rollback schema changes.  
    **
    ** If the SQLITE_DeferFKs flag is set, then this is not required, as
    ** the statement transaction will not be rolled back even if FK
    ** constraints are violated.
    */
    if( (db->flags & SQLITE_DeferFKs)==0 ){
      sqlite3VdbeAddOp2(v, OP_FkIfZero, 0, sqlite3VdbeCurrentAddr(v)+2);
      sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_FOREIGNKEY,
          OE_Abort, 0, P4_STATIC, P5_ConstraintFK);
    }

    if( iSkip ){
      sqlite3VdbeResolveLabel(v, iSkip);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r15
testb $0x8, 0x2e(%r15)
je 0x52c21
movq %rdx, %r13
testb $0x10, 0x48(%rdx)
jne 0x52c21
cmpq $0x0, 0x18(%r13)
je 0x52c30
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r12
movq %rdi, %r14
callq 0x48791
movq %rax, %rbx
movq %r13, %rdi
callq 0x52fb1
xorl %ebp, %ebp
testq %rax, %rax
jne 0x52c8a
movq 0x20(%r13), %rax
testq %rax, %rax
je 0x52c21
cmpb $0x0, 0x2c(%rax)
jne 0x52c69
testb $0x1, 0x2f(%r15)
jne 0x52c69
movq 0x8(%rax), %rax
jmp 0x52c51
movq %rbx, %rdi
callq 0x4a501
movl %eax, %ebp
movq %rbx, %rdi
movl $0x7e, %esi
movl $0x1, %edx
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x487d8
movb $0x1, 0x206(%r14)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4c5b3
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3fc95
movb $0x0, 0x206(%r14)
testb $0x1, 0x2f(%r15)
jne 0x52cf3
movl 0x34(%rbx), %ecx
addl $0x2, %ecx
movq %rbx, %rdi
movl $0x7e, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x487d8
movq %r14, %rdi
movl $0x313, %esi            # imm = 0x313
movl $0x2, %edx
xorl %ecx, %ecx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
movl $0x4, %r9d
callq 0x4b546
testl %ebp, %ebp
je 0x52c21
jns 0x52c21
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x52c21
notl %ebp
movl 0x34(%rbx), %ecx
movl %ebp, %edx
movl %ecx, (%rax,%rdx,4)
jmp 0x52c21