// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/type_graph.c
// Function: gt_type_graph_add_stanza
void gt_type_graph_add_stanza(GtTypeGraph *type_graph,
                              const GtOBOStanza *stanza)
{
  const char *id_value, *name_value;
  GtUword i, size;
  GtTypeNode *node;
  GtStr *buf;
  gt_assert(type_graph && stanza && !type_graph->ready);
  gt_assert(gt_obo_stanza_size(stanza, "id") == 1);
  gt_assert(gt_obo_stanza_size(stanza, "name") == 1);
  id_value = gt_symbol(gt_obo_stanza_get_value(stanza, "id", 0));
  name_value = gt_symbol(gt_obo_stanza_get_value(stanza, "name", 0));
  gt_assert(id_value);
  gt_assert(name_value);
  gt_assert(!gt_hashmap_get(type_graph->nodemap, id_value));
  node = gt_type_node_new(gt_array_size(type_graph->nodes), id_value);
  gt_hashmap_add(type_graph->name2id, (char*) name_value, (char*) id_value);
  gt_hashmap_add(type_graph->id2name, (char*) id_value, (char*) name_value);
  gt_hashmap_add(type_graph->nodemap, (char*) id_value, node);
  gt_array_add(type_graph->nodes, node);
  buf = gt_str_new();
  /* store is_a entries in node, if necessary */
  if ((size = gt_obo_stanza_size(stanza, "is_a"))) {
    for (i = 0; i < size; i++) {
      const char *id = gt_obo_stanza_get_value(stanza, "is_a", i);
      gt_str_reset(buf);
      gt_str_append_cstr_nt(buf, id, strcspn(id, " \n"));
      gt_type_node_is_a_add(node, gt_symbol(gt_str_get(buf)));
    }
  }
  /* store part_of entries in node, if necessary */
  if ((size = gt_obo_stanza_size(stanza, "relationship"))) {
    for (i = 0; i < size; i++) {
      const char *rel = gt_obo_stanza_get_value(stanza, "relationship", i);
      gt_str_reset(buf);
      /* match part_of */
      if (!strncmp(rel, PART_OF, strlen(PART_OF))) {
        const char *part_of = rel + strlen(PART_OF) + 1;
        gt_str_append_cstr_nt(buf, part_of, strcspn(part_of, " \n"));
        gt_type_node_part_of_add(node, gt_symbol(gt_str_get(buf)));
        continue;
      }
      /* match member_of */
      if (!strncmp(rel, MEMBER_OF, strlen(MEMBER_OF))) {
        const char *member_of = rel + strlen(MEMBER_OF) + 1;
        gt_str_append_cstr_nt(buf, member_of, strcspn(member_of, " \n"));
        gt_type_node_part_of_add(node, gt_symbol(gt_str_get(buf)));
        continue;
      }
      /* match integral_part_of */
      if (!strncmp(rel, INTEGRAL_PART_OF, strlen(INTEGRAL_PART_OF))) {
        const char *integral_part_of = rel + strlen(INTEGRAL_PART_OF) + 1;
        gt_str_append_cstr_nt(buf, integral_part_of,
                              strcspn(integral_part_of, " \n"));
        gt_type_node_part_of_add(node, gt_symbol(gt_str_get(buf)));
      }
    }
  }
  gt_str_delete(buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x30ceee
movq %rsi, %rbx
testq %rsi, %rsi
je 0x30ceee
movq %rdi, %r14
cmpb $0x1, 0x30(%rdi)
je 0x30ceee
leaq 0xdbcb2(%rip), %rsi     # 0x3e893c
movq %rbx, %rdi
callq 0x349ae8
cmpq $0x1, %rax
jne 0x30cef3
leaq 0x7ee7f(%rip), %rsi     # 0x38bb22
movq %rbx, %rdi
callq 0x349ae8
cmpq $0x1, %rax
jne 0x30cef8
leaq 0xdbc80(%rip), %rsi     # 0x3e893c
movq %rbx, %rdi
xorl %edx, %edx
callq 0x349abc
movq %rax, %rdi
callq 0x12234f
movq %rax, %r15
leaq 0x7ee4a(%rip), %rsi     # 0x38bb22
movq %rbx, %rdi
xorl %edx, %edx
callq 0x349abc
movq %rax, %rdi
callq 0x12234f
testq %r15, %r15
je 0x30cefd
movq %rax, %r12
testq %rax, %rax
je 0x30cf02
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x105a11
testq %rax, %rax
jne 0x30cf07
movq 0x18(%r14), %rdi
callq 0xd4a9a
movq %rax, %rdi
movq %r15, %rsi
callq 0x30d1c0
movq %rsp, %r13
movq %rax, (%r13)
movq (%r14), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x105a4c
movq 0x8(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x105a4c
movq 0x10(%r14), %rdi
movq (%r13), %rdx
movq %r15, %rsi
callq 0x105a4c
movq 0x18(%r14), %rdi
movl $0x8, %edx
movq %r13, %rsi
callq 0xd49ce
callq 0x1208f8
movq %rax, %r14
leaq 0x93a7d(%rip), %rsi     # 0x3a07f9
movq %rbx, %rdi
callq 0x349ae8
testq %rax, %rax
movq %rbx, %rbp
je 0x30cdf9
movq %rax, %r15
xorl %r12d, %r12d
leaq 0xbec34(%rip), %r13     # 0x3cb9cd
movq %rbx, %rdi
leaq 0x93a56(%rip), %rsi     # 0x3a07f9
movq %r12, %rdx
callq 0x349abc
movq %rax, %rbx
movq %r14, %rdi
callq 0x120db4
movq %rbx, %rdi
movq %r13, %rsi
callq 0x170a0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x120a9d
movq (%rsp), %rbx
movq %r14, %rdi
callq 0x120d23
movq %rax, %rdi
callq 0x12234f
movq %rbx, %rdi
movq %rbp, %rbx
movq %rax, %rsi
callq 0x30d246
incq %r12
cmpq %r12, %r15
jne 0x30cd99
leaq 0xdba48(%rip), %rsi     # 0x3e8848
movq %rbx, %rdi
callq 0x349ae8
testq %rax, %rax
je 0x30ced7
movq %rax, %r15
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0xdba27(%rip), %rsi     # 0x3e8848
movq %r12, %rdx
callq 0x349abc
movq %rax, %r13
movq %r14, %rdi
callq 0x120db4
movl $0x7, %edx
movq %r13, %rdi
leaq 0x902a0(%rip), %rsi     # 0x39d0e3
callq 0x17330
testl %eax, %eax
je 0x30ce82
movl $0x9, %edx
movq %r13, %rdi
leaq 0xdb9fa(%rip), %rsi     # 0x3e8855
callq 0x17330
testl %eax, %eax
je 0x30ce88
movl $0x10, %edx
movq %r13, %rdi
leaq 0xdb9ec(%rip), %rsi     # 0x3e885f
callq 0x17330
testl %eax, %eax
jne 0x30cecb
addq $0x11, %r13
jmp 0x30ce8c
addq $0x8, %r13
jmp 0x30ce8c
addq $0xa, %r13
movq %r13, %rdi
leaq 0xbeb37(%rip), %rsi     # 0x3cb9cd
callq 0x170a0
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x120a9d
movq (%rsp), %rbx
movq %r14, %rdi
callq 0x120d23
movq %rax, %rdi
callq 0x12234f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30d2ed
movq %rbp, %rbx
incq %r12
cmpq %r12, %r15
jne 0x30ce17
movq %r14, %rdi
callq 0x121b03
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8ed3d
callq 0x8ec2a
callq 0x8ec61
callq 0x8ed06
callq 0x8eccf
callq 0x8ec98