// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/spec_results.c
// Function: gt_spec_results_add_result
void gt_spec_results_add_result(GtSpecResults *sr,
                                const char *aspect,
                                GtGenomeNode *node,
                                GtSpecResultStatus status,
                                const char *error_string)
{
  GtSpecAspect *sa = NULL;
  GtSpecAspectNodeResult *sanr = NULL;
  gt_assert(aspect && node && error_string);

  if (gt_feature_node_try_cast(node)) {
    GtHashmap *per_type_aspects;
    const char *type = gt_feature_node_get_type((GtFeatureNode*) node);
    if (!(per_type_aspects = gt_hashmap_get(sr->feature_aspects, type))) {
      per_type_aspects = gt_hashmap_new(GT_HASH_STRING, NULL,
                                        (GtFree) gt_spec_aspect_delete);
      gt_hashmap_add(sr->feature_aspects, (void*) gt_symbol(type),
                     per_type_aspects);
      sr->checked_types++;
      sr->seen_feature = true;
    }
    gt_assert(per_type_aspects);
    if (!(sa = gt_hashmap_get(per_type_aspects, aspect))) {
      sa = gt_spec_aspect_new(aspect);
      gt_hashmap_add(per_type_aspects, (void*) gt_symbol(aspect), sa);
      sr->checked_aspects++;
    }
  } else if (gt_meta_node_try_cast(node)) {
    if (!(sa = gt_hashmap_get(sr->meta_aspects, aspect))) {
      sa = gt_spec_aspect_new(aspect);
      gt_hashmap_add(sr->meta_aspects, (void*) gt_symbol(aspect), sa);
      sr->checked_aspects++;
      sr->seen_meta = true;
    }
  } else if (gt_region_node_try_cast(node)) {
    if (!(sa = gt_hashmap_get(sr->region_aspects, aspect))) {
      sa = gt_spec_aspect_new(aspect);
      gt_hashmap_add(sr->region_aspects, (void*) gt_symbol(aspect), sa);
      sr->checked_aspects++;
      sr->seen_region = true;
    }
  } else if (gt_comment_node_try_cast(node)) {
    if (!(sa = gt_hashmap_get(sr->comment_aspects, aspect))) {
      sa = gt_spec_aspect_new(aspect);
      gt_hashmap_add(sr->comment_aspects, (void*) gt_symbol(aspect), sa);
      sr->checked_aspects++;
      sr->seen_comment = true;
    }
  } else if (gt_sequence_node_try_cast(node)) {
    if (!(sa = gt_hashmap_get(sr->sequence_aspects, aspect))) {
      sa = gt_spec_aspect_new(aspect);
      gt_hashmap_add(sr->sequence_aspects, (void*) gt_symbol(aspect), sa);
      sr->checked_aspects++;
      sr->seen_sequence = true;
    }
  }
  gt_assert(sa);
  /* count number of nodes seen for this aspect */
  if (sa->last_node != node)
    sa->nof_nodes++;
  switch (status) {
    case GT_SPEC_SUCCESS:
      /* pass */
      break;
    case GT_SPEC_FAILURE:
      if (!(sanr = gt_hashmap_get(sa->aspect_node_results, node))) {
        sanr = gt_spec_aspect_node_result_new();
        node = gt_genome_node_ref(node);
        gt_hashmap_add(sa->aspect_node_results, node, sanr);
      }
      gt_assert(sanr);
      gt_str_array_add_cstr(sanr->failure_messages, error_string);
      if (!sr->has_failures)
        sr->has_failures = true;
      break;
    case GT_SPEC_RUNTIME_ERROR:
      if (!(sanr = gt_hashmap_get(sa->aspect_node_results, node))) {
        sanr = gt_spec_aspect_node_result_new();
        node = gt_genome_node_ref(node);
        gt_hashmap_add(sa->aspect_node_results, node, sanr);
      }
      gt_assert(sanr);
      gt_str_array_add_cstr(sanr->runtime_error_messages, error_string);
      if (!sr->has_runtime_errors)
        sr->has_runtime_errors = true;
      break;
  }
  sa->last_node = node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x17e6b4
movq %rdx, %rbx
testq %rdx, %rdx
je 0x17e6b4
movq %r8, %rbp
testq %r8, %r8
je 0x17e6b4
movl %ecx, %r15d
movq %rsi, %r13
movq %rdi, %r14
movq %rbx, %rdi
callq 0x14aefc
testq %rax, %rax
je 0x17e411
movl %r15d, 0xc(%rsp)
movq %rbx, %rdi
callq 0x149bb2
movq %rax, %r12
movq (%r14), %rdi
movq %rax, %rsi
callq 0x105a11
movq %rax, %r15
testq %rax, %rax
jne 0x17e3f0
leaq -0xcc(%rip), %rdx       # 0x17e2e9
movl $0x1, %edi
xorl %esi, %esi
callq 0x105830
movq %rax, %r15
movq %rbp, 0x10(%rsp)
movq (%r14), %rbp
movq %r12, %rdi
callq 0x12234f
movq %rbp, %rdi
movq 0x10(%rsp), %rbp
movq %rax, %rsi
movq %r15, %rdx
callq 0x105a4c
incq 0x30(%r14)
movb $0x1, 0x28(%r14)
testq %r15, %r15
je 0x17e6be
movq %r15, %rdi
movq %r13, %rsi
callq 0x105a11
testq %rax, %rax
je 0x17e474
movq %rax, %r12
jmp 0x17e499
movq %rbx, %rdi
callq 0x1699eb
testq %rax, %rax
je 0x17e4a3
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x105a11
testq %rax, %rax
jne 0x17e580
movq %r13, %rdi
callq 0x17e6cd
movq %rax, %r12
movl %r15d, 0xc(%rsp)
movq 0x8(%r14), %r15
movq %r13, %rdi
callq 0x12234f
movq %r15, %rdi
movl 0xc(%rsp), %r15d
movq %rax, %rsi
movq %r12, %rdx
callq 0x105a4c
incq 0x38(%r14)
movb $0x1, 0x29(%r14)
jmp 0x17e583
movq %r13, %rdi
callq 0x17e6cd
movq %rax, %r12
movq %r13, %rdi
callq 0x12234f
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x105a4c
incq 0x38(%r14)
movl 0xc(%rsp), %r15d
jmp 0x17e583
movq %rbx, %rdi
callq 0x176cbc
testq %rax, %rax
je 0x17e502
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0x105a11
testq %rax, %rax
jne 0x17e580
movq %r13, %rdi
callq 0x17e6cd
movq %rax, %r12
movl %r15d, 0xc(%rsp)
movq 0x10(%r14), %r15
movq %r13, %rdi
callq 0x12234f
movq %r15, %rdi
movl 0xc(%rsp), %r15d
movq %rax, %rsi
movq %r12, %rdx
callq 0x105a4c
incq 0x38(%r14)
movb $0x1, 0x2a(%r14)
jmp 0x17e583
movq %rbx, %rdi
callq 0x3069e8
testq %rax, %rax
je 0x17e55a
movq 0x18(%r14), %rdi
movq %r13, %rsi
callq 0x105a11
testq %rax, %rax
jne 0x17e580
movq %r13, %rdi
callq 0x17e6cd
movq %rax, %r12
movl %r15d, 0xc(%rsp)
movq 0x18(%r14), %r15
movq %r13, %rdi
callq 0x12234f
movq %r15, %rdi
movl 0xc(%rsp), %r15d
movq %rax, %rsi
movq %r12, %rdx
callq 0x105a4c
incq 0x38(%r14)
movb $0x1, 0x2b(%r14)
jmp 0x17e583
movq %rbx, %rdi
callq 0x17c192
testq %rax, %rax
je 0x17e66f
movq 0x20(%r14), %rdi
movq %r13, %rsi
callq 0x105a11
testq %rax, %rax
je 0x17e677
movq %rax, %r12
testq %r12, %r12
je 0x17e6b9
cmpq %rbx, 0x10(%r12)
je 0x17e598
incq 0x18(%r12)
cmpl $0x2, %r15d
je 0x17e5be
cmpl $0x1, %r15d
jne 0x17e65b
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x105a11
testq %rax, %rax
je 0x17e5d4
movq %rax, %r15
jmp 0x17e5f6
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x105a11
testq %rax, %rax
je 0x17e618
movq %rax, %r15
jmp 0x17e63a
callq 0x17f087
movq %rax, %r15
movq %rbx, %rdi
callq 0x14b5fc
movq %rax, %rbx
movq (%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x105a4c
testq %r15, %r15
je 0x17e6c3
movq (%r15), %rdi
movq %rbp, %rsi
callq 0x121c30
cmpb $0x0, 0x2d(%r14)
jne 0x17e65b
movb $0x1, 0x2d(%r14)
jmp 0x17e65b
callq 0x17f087
movq %rax, %r15
movq %rbx, %rdi
callq 0x14b5fc
movq %rax, %rbx
movq (%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x105a4c
testq %r15, %r15
je 0x17e6c8
movq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0x121c30
cmpb $0x0, 0x2e(%r14)
jne 0x17e65b
movb $0x1, 0x2e(%r14)
movq %rbx, 0x10(%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
jmp 0x17e583
movq %r13, %rdi
callq 0x17e6cd
movq %rax, %r12
movl %r15d, 0xc(%rsp)
movq 0x20(%r14), %r15
movq %r13, %rdi
callq 0x12234f
movq %r15, %rdi
movl 0xc(%rsp), %r15d
movq %rax, %rsi
movq %r12, %rdx
callq 0x105a4c
incq 0x38(%r14)
movb $0x1, 0x2c(%r14)
jmp 0x17e583
callq 0x56059
callq 0x5613d
callq 0x56092
callq 0x560cb
callq 0x56104