// File: /workspace/github_c_makefile_star2_O3/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 %r8, 0x30(%rsp)
movq %rcx, 0x20(%rsp)
testq %rdi, %rdi
je 0x303866
movq %rsi, %r14
testq %rsi, %rsi
je 0x303866
movq %rdx, %rbx
movq %rdi, %r15
movl 0x70(%rsp), %eax
movq %rax, 0x18(%rsp)
leal (%rax,%rax), %r13d
movq 0x8(%rdi), %rsi
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x100add
movq %rax, %rbp
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x100add
leaq 0xdbd99(%rip), %rdi     # 0x3df382
leaq 0xc6b80(%rip), %rdx     # 0x3ca170
movl %r13d, 0xc(%rsp)
movl %r13d, %esi
movq %rbp, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x103d72
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x303656
movq 0x8(%r14), %rsi
callq 0x100add
testq %rax, %rax
je 0x30366a
movq %rax, %rbp
leaq 0x9e6af(%rip), %rax     # 0x3a1cd5
leaq 0x82fbf(%rip), %rcx     # 0x3865ec
cmpb $0x0, (%rbp)
cmovneq %rax, %rcx
leaq 0xdbd68(%rip), %rdi     # 0x3df3a4
leaq 0xc6b2d(%rip), %rdx     # 0x3ca170
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x103d72
movb (%rbp), %bl
jmp 0x303855
leaq -0x1fefb3(%rip), %rdx   # 0x1046aa
xorl %edi, %edi
xorl %esi, %esi
callq 0x1008fc
movq %rax, 0x28(%r15)
leaq 0xdbb83(%rip), %rsi     # 0x3df1f4
movl $0x1, %edi
movl $0xb9, %edx
callq 0x104226
movq %rax, %r12
movq 0x8(%r14), %rsi
cmpq %rsi, 0x8(%r15)
je 0x3037ef
cmpb $0x0, 0x30(%r14)
movq 0x30(%rsp), %r13
jne 0x3036db
movl $0x8, %edi
callq 0xd214c
movq %rax, %rbp
movq %r14, %rdi
movq %rbx, %rsi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
callq 0x303870
movq %rbp, %rdi
callq 0xd24e0
testq %rax, %rax
jne 0x30386b
movq %rbp, %rdi
callq 0xd2938
movb $0x1, 0x30(%r14)
movq %r12, 0x10(%rsp)
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x33f817
movq %rax, %rbp
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x33f866
cmpq %rax, %rbp
je 0x303759
movl 0x70(%rsp), %eax
leal 0x1(%rax), %r12d
movq %r13, %rdi
movq %rbp, %rsi
callq 0xd2207
movq (%rax), %rdi
movl %r12d, (%rsp)
movq %r14, %rsi
movq %rbx, %rdx
movq 0x20(%rsp), %rcx
movq %r13, %r8
movq 0x28(%rsp), %r9
callq 0x30357d
testb %al, %al
jne 0x3037fd
movq (%r15), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x33f8b5
movq %rax, %rbp
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x33f866
cmpq %rax, %rbp
jne 0x303706
movq 0x20(%r15), %rdi
callq 0xd24e0
testq %rax, %rax
movl 0xc(%rsp), %r12d
je 0x3037be
movq 0x18(%rsp), %rax
incl %eax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movq 0x20(%r15), %rdi
movq %rbp, %rsi
callq 0xd2207
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movl %eax, (%rsp)
movq %r14, %rsi
movq %rbx, %rdx
movq 0x20(%rsp), %rcx
movq %r13, %r8
movq 0x28(%rsp), %r9
callq 0x30357d
testb %al, %al
jne 0x303826
incq %rbp
movq 0x20(%r15), %rdi
callq 0xd24e0
cmpq %rax, %rbp
jb 0x30377a
movq 0x10(%rsp), %rdx
movb $0x0, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x100b18
leaq 0xdbc0d(%rip), %rdi     # 0x3df3e7
leaq 0xc698f(%rip), %rdx     # 0x3ca170
xorl %ebx, %ebx
movl %r12d, %esi
xorl %eax, %eax
callq 0x103d72
jmp 0x303855
movb $0x1, (%r12)
movq 0x28(%r15), %rdi
movq %r12, %rdx
jmp 0x30380d
movq 0x10(%rsp), %rdx
movb $0x1, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x100b18
leaq 0xdbba4(%rip), %rdi     # 0x3df3bd
leaq 0xc6950(%rip), %rdx     # 0x3ca170
movl 0xc(%rsp), %esi
jmp 0x30384c
movq 0x10(%rsp), %rdx
movb $0x1, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x100b18
leaq 0xdbb7b(%rip), %rdi     # 0x3df3bd
leaq 0xc6927(%rip), %rdx     # 0x3ca170
movl %r12d, %esi
xorl %eax, %eax
callq 0x103d72
movb $0x1, %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8d3da
callq 0x8d413