// File: /workspace/github_c_makefile_star2_O1/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 0x30d6c7
movq %rsi, %r14
testq %rsi, %rsi
je 0x30d6c7
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 0x105a11
movq %rax, %rbp
movq 0x8(%r14), %rsi
movq %r12, %rdi
callq 0x105a11
leaq 0xdb63f(%rip), %rdi     # 0x3e8a89
leaq 0xc643f(%rip), %rdx     # 0x3d3890
movl %r13d, 0xc(%rsp)
movl %r13d, %esi
movq %rbp, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x108e02
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x30d4b7
movq 0x8(%r14), %rsi
callq 0x105a11
testq %rax, %rax
je 0x30d4cb
movq %rax, %rbp
leaq 0x9ddab(%rip), %rax     # 0x3ab232
leaq 0x8253e(%rip), %rcx     # 0x38f9cc
cmpb $0x0, (%rbp)
cmovneq %rax, %rcx
leaq 0xdb60e(%rip), %rdi     # 0x3e8aab
leaq 0xc63ec(%rip), %rdx     # 0x3d3890
movl 0xc(%rsp), %esi
xorl %eax, %eax
callq 0x108e02
movb (%rbp), %bl
jmp 0x30d6b6
leaq -0x203d8f(%rip), %rdx   # 0x10972f
xorl %edi, %edi
xorl %esi, %esi
callq 0x105830
movq %rax, 0x28(%r15)
leaq 0xdb429(%rip), %rsi     # 0x3e88fb
movl $0x1, %edi
movl $0xb9, %edx
callq 0x1092b2
movq %rax, %r12
movq 0x8(%r14), %rsi
cmpq %rsi, 0x8(%r15)
je 0x30d650
cmpb $0x0, 0x30(%r14)
movq 0x30(%rsp), %r13
jne 0x30d53c
movl $0x8, %edi
callq 0xd46fc
movq %rax, %rbp
movq %r14, %rdi
movq %rbx, %rsi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
callq 0x30d6d1
movq %rbp, %rdi
callq 0xd4a9a
testq %rax, %rax
jne 0x30d6cc
movq %rbp, %rdi
callq 0xd4ef4
movb $0x1, 0x30(%r14)
movq %r12, 0x10(%rsp)
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x348aeb
movq %rax, %rbp
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x348b3a
cmpq %rax, %rbp
je 0x30d5ba
movl 0x70(%rsp), %eax
leal 0x1(%rax), %r12d
movq %r13, %rdi
movq %rbp, %rsi
callq 0xd47ba
movq (%rax), %rdi
movl %r12d, (%rsp)
movq %r14, %rsi
movq %rbx, %rdx
movq 0x20(%rsp), %rcx
movq %r13, %r8
movq 0x28(%rsp), %r9
callq 0x30d3de
testb %al, %al
jne 0x30d65e
movq (%r15), %rsi
movq %rbx, %rdi
movq %rbp, %rdx
callq 0x348b89
movq %rax, %rbp
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x348b3a
cmpq %rax, %rbp
jne 0x30d567
movq 0x20(%r15), %rdi
callq 0xd4a9a
testq %rax, %rax
movl 0xc(%rsp), %r12d
je 0x30d61f
movq 0x18(%rsp), %rax
incl %eax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
movq 0x20(%r15), %rdi
movq %rbp, %rsi
callq 0xd47ba
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 0x30d3de
testb %al, %al
jne 0x30d687
incq %rbp
movq 0x20(%r15), %rdi
callq 0xd4a9a
cmpq %rax, %rbp
jb 0x30d5db
movq 0x10(%rsp), %rdx
movb $0x0, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x105a4c
leaq 0xdb4b3(%rip), %rdi     # 0x3e8aee
leaq 0xc624e(%rip), %rdx     # 0x3d3890
xorl %ebx, %ebx
movl %r12d, %esi
xorl %eax, %eax
callq 0x108e02
jmp 0x30d6b6
movb $0x1, (%r12)
movq 0x28(%r15), %rdi
movq %r12, %rdx
jmp 0x30d66e
movq 0x10(%rsp), %rdx
movb $0x1, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x105a4c
leaq 0xdb44a(%rip), %rdi     # 0x3e8ac4
leaq 0xc620f(%rip), %rdx     # 0x3d3890
movl 0xc(%rsp), %esi
jmp 0x30d6ad
movq 0x10(%rsp), %rdx
movb $0x1, (%rdx)
movq 0x28(%r15), %rdi
movq 0x8(%r14), %rsi
callq 0x105a4c
leaq 0xdb421(%rip), %rdi     # 0x3e8ac4
leaq 0xc61e6(%rip), %rdx     # 0x3d3890
movl %r12d, %esi
xorl %eax, %eax
callq 0x108e02
movb $0x1, %bl
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8f0f4
callq 0x8f12d