// File: /workspace/github_c_makefile_star2_O3/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 0x176226
movq %rdx, %rbx
testq %rdx, %rdx
je 0x176226
movq %r8, %rbp
testq %r8, %r8
je 0x176226
movl %ecx, %r15d
movq %rsi, %r13
movq %rdi, %r14
movq %rbx, %rdi
callq 0x143cab
testq %rax, %rax
je 0x175f3b
movl %r15d, 0xc(%rsp)
movq %rbx, %rdi
callq 0x142988
movq %rax, %r12
movq (%r14), %rdi
movq %rax, %rsi
callq 0x100add
testq %rax, %rax
je 0x175f99
movq %rax, %r15
jmp 0x175fe4
movq %rbx, %rdi
callq 0x161b97
testq %rax, %rax
je 0x176039
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x100add
testq %rax, %rax
jne 0x17610c
movl %r15d, 0xc(%rsp)
movq %r13, %rdi
callq 0x17623a
movq %rax, %r12
movq 0x8(%r14), %r15
movq %r13, %rdi
callq 0x11c5ff
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x100b18
incq 0x38(%r14)
movb $0x1, 0x29(%r14)
jmp 0x176026
movq %rbp, 0x10(%rsp)
leaq -0x130(%rip), %rdx      # 0x175e75
movl $0x1, %edi
xorl %esi, %esi
callq 0x1008fc
movq %rax, %r15
movq (%r14), %rbp
movq %r12, %rdi
callq 0x11c5ff
movq %rbp, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x100b18
incq 0x30(%r14)
movb $0x1, 0x28(%r14)
testq %r15, %r15
je 0x17622b
movq 0x10(%rsp), %rbp
movq %r15, %rdi
movq %r13, %rsi
callq 0x100add
testq %rax, %rax
je 0x176001
movq %rax, %r12
movl 0xc(%rsp), %r15d
jmp 0x17610f
movq %r13, %rdi
callq 0x17623a
movq %rax, %r12
movq %r13, %rdi
callq 0x11c5ff
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x100b18
incq 0x38(%r14)
testq %r12, %r12
movl 0xc(%rsp), %r15d
jne 0x17610f
callq 0x54fdf
movq %rbx, %rdi
callq 0x16e930
testq %rax, %rax
je 0x176090
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0x100add
testq %rax, %rax
jne 0x17610c
movl %r15d, 0xc(%rsp)
movq %r13, %rdi
callq 0x17623a
movq %rax, %r12
movq 0x10(%r14), %r15
movq %r13, %rdi
callq 0x11c5ff
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x100b18
incq 0x38(%r14)
movb $0x1, 0x2a(%r14)
jmp 0x176026
movq %rbx, %rdi
callq 0x2fccd4
testq %rax, %rax
je 0x1760e6
movq 0x18(%r14), %rdi
movq %r13, %rsi
callq 0x100add
testq %rax, %rax
jne 0x17610c
movl %r15d, 0xc(%rsp)
movq %r13, %rdi
callq 0x17623a
movq %rax, %r12
movq 0x18(%r14), %r15
movq %r13, %rdi
callq 0x11c5ff
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x100b18
incq 0x38(%r14)
movb $0x1, 0x2b(%r14)
jmp 0x176026
movq %rbx, %rdi
callq 0x173d9e
testq %rax, %rax
je 0x176034
movq 0x20(%r14), %rdi
movq %r13, %rsi
callq 0x100add
testq %rax, %rax
je 0x1761ee
movq %rax, %r12
cmpq %rbx, 0x10(%r12)
je 0x17611b
incq 0x18(%r12)
cmpl $0x2, %r15d
je 0x176141
cmpl $0x1, %r15d
jne 0x1761da
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x100add
testq %rax, %rax
je 0x176157
movq %rax, %r15
jmp 0x176182
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x100add
testq %rax, %rax
je 0x17619b
movq %rax, %r15
jmp 0x1761c2
callq 0x176bf5
movq %rax, %r15
movq %rbx, %rdi
callq 0x1443a0
movq %rax, %rbx
movq (%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x100b18
testq %r15, %r15
je 0x176230
movq (%r15), %rdi
movq %rbp, %rsi
callq 0x11bee9
cmpb $0x0, 0x2d(%r14)
jne 0x1761da
movb $0x1, 0x2d(%r14)
jmp 0x1761da
callq 0x176bf5
movq %rax, %r15
movq %rbx, %rdi
callq 0x1443a0
movq %rax, %rbx
movq (%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x100b18
testq %r15, %r15
je 0x176235
movq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0x11bee9
cmpb $0x0, 0x2e(%r14)
jne 0x1761da
movb $0x1, 0x2e(%r14)
movq %rbx, 0x10(%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, 0xc(%rsp)
movq %r13, %rdi
callq 0x17623a
movq %rax, %r12
movq 0x20(%r14), %r15
movq %r13, %rdi
callq 0x11c5ff
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x100b18
incq 0x38(%r14)
movb $0x1, 0x2c(%r14)
jmp 0x176026
callq 0x54efb
callq 0x54f34
callq 0x54f6d
callq 0x54fa6