// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x80000, %eax          # imm = 0x80000
cmpl $0x0, %eax
je 0x72526
movq -0x18(%rbp), %rax
movzbl 0x48(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x72526
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x72526
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x638c0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x726e0
cmpq $0x0, %rax
jne 0x7247b
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x7244d
movq -0x38(%rbp), %rax
movzbl 0x2c(%rax), %eax
cmpl $0x0, %eax
jne 0x7243b
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0x7243d
jmp 0x7244d
jmp 0x7243f
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x72416
cmpq $0x0, -0x38(%rbp)
jne 0x72459
jmp 0x72526
movq -0x30(%rbp), %rdi
callq 0x662a0
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %ecx
movl $0x7e, %esi
movl $0x1, %edx
callq 0x63980
movq -0x8(%rbp), %rax
movb $0x1, 0x206(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x694d0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x599b0
movq -0x8(%rbp), %rax
movb $0x0, 0x206(%rax)
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
jne 0x72512
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
callq 0x63ea0
movq -0x48(%rbp), %rdi
movl %eax, %ecx
addl $0x2, %ecx
movl $0x7e, %esi
xorl %edx, %edx
callq 0x63980
movq -0x8(%rbp), %rdi
movl $0x313, %esi            # imm = 0x313
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %ecx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
movl $0x4, %r9d
callq 0x677d0
cmpl $0x0, -0x24(%rbp)
je 0x72524
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x66470
jmp 0x72526
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)