// File: /workspace/github_c_makefile_star2_O1/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 0x52652
movq %rdx, %r13
testb $0x10, 0x48(%rdx)
jne 0x52652
cmpq $0x0, 0x18(%r13)
je 0x52661
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r12
movq %rdi, %r14
callq 0x47f6a
movq %rax, %rbx
movq %r13, %rdi
callq 0x529ef
xorl %ebp, %ebp
testq %rax, %rax
jne 0x526be
movq 0x20(%r13), %rax
xorl %ebp, %ebp
testq %rax, %rax
sete %r13b
je 0x526b8
cmpb $0x0, 0x2c(%rax)
je 0x52751
movq %rbx, %rdi
callq 0x49cbd
movl %eax, %ebp
movq %rbx, %rdi
movl $0x7e, %esi
movl $0x1, %edx
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x47fb1
testb $0x1, %r13b
jne 0x52652
movb $0x1, 0x206(%r14)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4be07
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3f423
movb $0x0, 0x206(%r14)
testb $0x1, 0x2f(%r15)
jne 0x52727
movl 0x34(%rbx), %ecx
addl $0x2, %ecx
movq %rbx, %rdi
movl $0x7e, %esi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x313, %esi            # imm = 0x313
movl $0x2, %edx
xorl %ecx, %ecx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
movl $0x4, %r9d
callq 0x4ad4b
testl %ebp, %ebp
je 0x52652
jns 0x52652
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x52652
notl %ebp
movl 0x34(%rbx), %ecx
movl %ebp, %edx
movl %ecx, (%rax,%rdx,4)
jmp 0x52652
movl 0x2c(%r15), %ecx
btl $0x18, %ecx
jb 0x52697
movq 0x8(%rax), %rax
testq %rax, %rax
sete %r13b
je 0x526b8
cmpb $0x0, 0x2c(%rax)
je 0x52755
jmp 0x52697