// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/type_node.c
// Function: gt_type_node_has_parent
bool gt_type_node_has_parent(GtTypeNode *node, GtTypeNode *pnode,
                             GtBoolMatrix *part_of_out_edges,
                             GtBoolMatrix *part_of_in_edges,
                             GtArray *node_list, GtHashmap *id2name,
                             unsigned int indentlevel)
{
  GtTypeNode *parent;
  GtUword i;
  bool *result;
  gt_assert(node && pnode);
  gt_log_log("%*scheck if node %s has parent %s", indentlevel * 2, "",
             (const char*) gt_hashmap_get(id2name, node->id),
             (const char*) gt_hashmap_get(id2name, pnode->id));

  /* try cache */
  if (node->cache) {
    if ((result = gt_hashmap_get(node->cache, pnode->id))) {
      gt_log_log("%*sreturn %s (cache hit)", indentlevel * 2, "",
                 *result ?  "true" : "false");
      return *result;
    }
  }
  else
    node->cache = gt_hashmap_new(GT_HASH_DIRECT, NULL, gt_free_func);
  result = gt_malloc(sizeof (bool));

  /* no cache hit found */
  if (node->id == pnode->id) {
    *result = true;
    gt_hashmap_add(node->cache, (char*) pnode->id, result);
    gt_log_log("%*sreturn true", indentlevel * 2, "");
    return true;
  }
  /* create transitive part_of edges for the parent, if they have not been
     created already */
  if (!pnode->transitive_edges_created) {
    GtArray *node_stack;
    node_stack = gt_array_new(sizeof (GtTypeNode*));
    create_transitive_part_of_edges(pnode, part_of_out_edges, part_of_in_edges,
                                    node_stack);
    gt_assert(!gt_array_size(node_stack));
    gt_array_delete(node_stack);
    pnode->transitive_edges_created = true;
  }
  /* traversal of part_of out edges */
  for (i  = gt_bool_matrix_get_first_column(part_of_out_edges, node->num);
       i != gt_bool_matrix_get_last_column(part_of_out_edges, node->num);
       i  = gt_bool_matrix_get_next_column(part_of_out_edges, node->num, i)) {
    parent = *(GtTypeNode**) gt_array_get(node_list, i);
    if (gt_type_node_has_parent(parent, pnode, part_of_out_edges,
                                part_of_in_edges, node_list, id2name,
                                indentlevel + 1)) {
      *result = true;
      gt_hashmap_add(node->cache, (char*) pnode->id, result);
      gt_log_log("%*sreturn true", indentlevel * 2, "");
      return true;
    }
  }
  /* traversal of is_a out edges */
  for (i = 0; i < gt_array_size(node->is_a_out_edges); i++) {
    parent = *(GtTypeNode**) gt_array_get(node->is_a_out_edges, i);
    if (gt_type_node_has_parent(parent, pnode, part_of_out_edges,
                                part_of_in_edges, node_list, id2name,
                                indentlevel + 1)) {
      *result = true;
      gt_hashmap_add(node->cache, (char*) pnode->id, result);
      gt_log_log("%*sreturn true", indentlevel * 2, "");
      return true;
    }
  }
  /* no result found */
  *result = false;
  gt_hashmap_add(node->cache, (char*) pnode->id, result);
  gt_log_log("%*sreturn false", indentlevel * 2, "");
  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x28(%rsp)
movq %rcx, 0x30(%rsp)
testq %rdi, %rdi
je 0x2a0dc0
movq %rsi, %r14
testq %rsi, %rsi
je 0x2a0dc0
movq %r8, %r13
movq %rdx, %rbx
movq %rdi, %r15
movl 0x70(%rsp), %eax
movq %rax, 0x20(%rsp)
leal (%rax,%rax), %ebp
movq 0x8(%rdi), %rsi
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x8f482
movq %rax, 0x18(%rsp)
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x8f482
leaq 0xdebb0(%rip), %rdi     # 0x37f752
leaq 0xc99c7(%rip), %rdx     # 0x36a570
movl %ebp, 0x14(%rsp)
movl %ebp, %esi
movq 0x18(%rsp), %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x92a82
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x2a0c0f
movq 0x8(%r14), %rsi
callq 0x8f482
testq %rax, %rax
je 0x2a0c23
movq %rax, %rbp
leaq 0xa13e5(%rip), %rax     # 0x341fc4
leaq 0x85e06(%rip), %rcx     # 0x3269ec
cmpb $0x0, (%rbp)
cmovneq %rax, %rcx
leaq 0xdeb7f(%rip), %rdi     # 0x37f774
leaq 0xc9974(%rip), %rdx     # 0x36a570
movl 0x14(%rsp), %esi
xorl %eax, %eax
callq 0x92a82
movb (%rbp), %bl
jmp 0x2a0d7d
leaq -0x20d3d7(%rip), %rdx   # 0x9383f
xorl %edi, %edi
xorl %esi, %esi
callq 0x8f330
movq %rax, 0x28(%r15)
leaq 0xde99a(%rip), %rsi     # 0x37f5c4
pushq $0x1
popq %rdi
movl $0xb9, %edx
callq 0x93160
movq 0x8(%r14), %rsi
cmpq %rsi, 0x8(%r15)
je 0x2a0cfd
movq %rax, 0x18(%rsp)
cmpb $0x0, 0x30(%r14)
movq 0x30(%rsp), %r12
jne 0x2a0c90
pushq $0x8
popq %rdi
callq 0x5809c
movq %rax, %rbp
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0x2a0e26
movq %rbp, %rdi
callq 0x586a4
testq %rax, %rax
jne 0x2a0df8
movq %rbp, %rdi
callq 0x58eb9
movb $0x1, 0x30(%r14)
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x2de5e0
movq %rax, %rbp
movq 0x20(%rsp), %rax
incl %eax
movq %rax, 0x20(%rsp)
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x2de65c
cmpq %rax, %rbp
je 0x2a0d09
movq %r13, %rdi
movq %rbp, %rsi
callq 0x581aa
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movl %eax, (%rsp)
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movq %r13, %r8
movq 0x28(%rsp), %r9
callq 0x2a0b37
testb %al, %al
jne 0x2a0d4d
movq (%r15), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x2de6d8
movq %rax, %rbp
jmp 0x2a0caa
movb $0x1, (%rax)
movq 0x28(%r15), %rdi
movq %rax, %rdx
jmp 0x2a0d5d
xorl %ebp, %ebp
movq 0x20(%r15), %rdi
callq 0x586a4
cmpq %rax, %rbp
jae 0x2a0d8e
movq 0x20(%r15), %rdi
movq %rbp, %rsi
callq 0x581aa
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movl %eax, (%rsp)
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movq %r13, %r8
movq 0x28(%rsp), %r9
callq 0x2a0b37
incq %rbp
testb %al, %al
je 0x2a0d0b
movq 0x18(%rsp), %rdx
movb $0x1, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x8f4bd
leaq 0xdea24(%rip), %rdi     # 0x37f78d
leaq 0xc9800(%rip), %rdx     # 0x36a570
movl 0x14(%rsp), %esi
xorl %eax, %eax
callq 0x92a82
movb $0x1, %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rsp), %rdx
movb $0x0, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x8f4bd
leaq 0xdea0d(%rip), %rdi     # 0x37f7b7
leaq 0xc97bf(%rip), %rdx     # 0x36a570
xorl %ebx, %ebx
movl 0x14(%rsp), %esi
xorl %eax, %eax
callq 0x92a82
jmp 0x2a0d7d
movq 0x1971a1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x44242(%rip), %rsi     # 0x2e5013
leaq 0xde954(%rip), %rdx     # 0x37f72c
leaq 0xde95b(%rip), %rcx     # 0x37f73a
leaq 0xde7de(%rip), %r8      # 0x37f5c4
movl $0xaa, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x197169(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x4420a(%rip), %rsi     # 0x2e5013
leaq 0xde98c(%rip), %rdx     # 0x37f79c
leaq 0xde923(%rip), %rcx     # 0x37f73a
leaq 0xde7a6(%rip), %r8      # 0x37f5c4
movl $0xc9, %r9d
jmp 0x2a0dec