// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/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 ) 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.  */
    sqlite3VdbeAddOp2(v, OP_FkIfZero, 0, sqlite3VdbeCurrentAddr(v)+2);
    sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_FOREIGNKEY,
        OE_Abort, "foreign key constraint failed", P4_STATIC
    );

    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 0x6b94e
movq -0x18(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x6b94e
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6b94e
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5e000
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6bb10
cmpq $0x0, %rax
jne 0x6b8b7
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x6b889
movq -0x38(%rbp), %rax
cmpb $0x0, 0x2c(%rax)
je 0x6b879
jmp 0x6b889
jmp 0x6b87b
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x6b866
cmpq $0x0, -0x38(%rbp)
jne 0x6b895
jmp 0x6b94e
movq -0x30(%rbp), %rdi
callq 0x67890
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %ecx
movl $0x7c, %esi
movl $0x1, %edx
callq 0x5e0c0
movq -0x8(%rbp), %rax
movb $0x1, 0x1f6(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x62000
movq -0x48(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x54e60
movq -0x8(%rbp), %rax
movb $0x0, 0x1f6(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5e520
movq -0x40(%rbp), %rdi
movl %eax, %ecx
addl $0x2, %ecx
movl $0x7c, %esi
xorl %edx, %edx
callq 0x5e0c0
movq -0x8(%rbp), %rdi
movl $0x313, %esi            # imm = 0x313
movl $0x2, %edx
leaq 0x42a52(%rip), %rcx     # 0xae381
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
callq 0x67830
cmpl $0x0, -0x24(%rbp)
je 0x6b94c
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x677f0
jmp 0x6b94e
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)