// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3FkRequired
SQLITE_PRIVATE int sqlite3FkRequired(
  Parse *pParse,                  /* Parse context */
  Table *pTab,                    /* Table being modified */
  int *aChange,                   /* Non-NULL for UPDATE operations */
  int chngRowid                   /* True for UPDATE that affects rowid */
){
  int eRet = 0;
  if( pParse->db->flags&SQLITE_ForeignKeys ){
    if( !aChange ){
      /* A DELETE operation. Foreign key processing is required if the
      ** table in question is either the child or parent table for any
      ** foreign key constraint.  */
      eRet = (sqlite3FkReferences(pTab) || pTab->pFKey);
    }else{
      /* This is an UPDATE. Foreign key processing is only required if the
      ** operation modifies one or more child or parent key columns. */
      FKey *p;

      /* Check if any child key columns are being modified. */
      for(p=pTab->pFKey; p; p=p->pNextFrom){
        if( 0==sqlite3_stricmp(pTab->zName, p->zTo) ) return 2;
        if( fkChildIsModified(pTab, p, aChange, chngRowid) ){
          eRet = 1;
        }
      }

      /* Check if any parent key columns are being modified. */
      for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){
        if( fkParentIsModified(pTab, p, aChange, chngRowid) ){
          if( p->aAction[1]!=OE_None ) return 2;
          eRet = 1;
        }
      }
    }
  }
  return eRet;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
andq $0x4000, %rax           # imm = 0x4000
cmpq $0x0, %rax
je 0x45a45f
cmpq $0x0, -0x20(%rbp)
jne 0x45a396
movq -0x18(%rbp), %rdi
callq 0x43e590
movq %rax, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, -0x31(%rbp)
jne 0x45a386
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
jmp 0x45a45d
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x45a401
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x3c3e00
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x45a3d1
movl $0x2, -0x4(%rbp)
jmp 0x45a465
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x45ae60
cmpl $0x0, %eax
je 0x45a3f1
movl $0x1, -0x28(%rbp)
jmp 0x45a3f3
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x45a3a2
movq -0x18(%rbp), %rdi
callq 0x43e590
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x45a45b
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x45aef0
cmpl $0x0, %eax
je 0x45a44b
movq -0x30(%rbp), %rax
movzbl 0x2e(%rax), %eax
cmpl $0x0, %eax
je 0x45a444
movl $0x2, -0x4(%rbp)
jmp 0x45a465
movl $0x1, -0x28(%rbp)
jmp 0x45a44d
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x45a40e
jmp 0x45a45d
jmp 0x45a45f
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop