// File: /workspace/github_c_makefile_star2_O2/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 0x11ab49
movq %rdx, %rbx
testq %rdx, %rdx
je 0x11ab49
movq %r8, %rbp
testq %r8, %r8
je 0x11ab49
movl %ecx, %r15d
movq %rsi, %r13
movq %rdi, %r14
movq %rbx, %rdi
callq 0xdc2f0
testq %rax, %rax
je 0x11a82d
movl %r15d, 0xc(%rsp)
movq %rbx, %rdi
callq 0xda338
movq %rax, %r12
movq (%r14), %rdi
movq %rax, %rsi
callq 0x8f482
testq %rax, %rax
je 0x11a88b
movq %rax, %r15
jmp 0x11a8d4
movq %rbx, %rdi
callq 0x101423
testq %rax, %rax
je 0x11a955
movq 0x8(%r14), %rdi
movq %r13, %rsi
callq 0x8f482
testq %rax, %rax
jne 0x11aa2b
movl %r15d, 0xc(%rsp)
movq %r13, %rdi
callq 0x11ac0e
movq %rax, %r12
movq 0x8(%r14), %r15
movq %r13, %rdi
callq 0xaed4b
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x8f4bd
incq 0x38(%r14)
movb $0x1, 0x29(%r14)
jmp 0x11a916
movq %rbp, 0x10(%rsp)
leaq -0x196(%rip), %rdx      # 0x11a701
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x8f330
movq %rax, %r15
movq (%r14), %rbp
movq %r12, %rdi
callq 0xaed4b
movq %rbp, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x8f4bd
incq 0x30(%r14)
movb $0x1, 0x28(%r14)
testq %r15, %r15
je 0x11ab81
movq 0x10(%rsp), %rbp
movq %r15, %rdi
movq %r13, %rsi
callq 0x8f482
testq %rax, %rax
je 0x11a8f1
movq %rax, %r12
movl 0xc(%rsp), %r15d
jmp 0x11aa2e
movq %r13, %rdi
callq 0x11ac0e
movq %rax, %r12
movq %r13, %rdi
callq 0xaed4b
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x8f4bd
incq 0x38(%r14)
testq %r12, %r12
movl 0xc(%rsp), %r15d
jne 0x11aa2e
movq 0x31d63d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ca6de(%rip), %rsi    # 0x2e5013
leaq 0x20bea4(%rip), %rdx    # 0x3267e0
leaq 0x21900b(%rip), %rcx    # 0x33394e
leaq 0x218f8b(%rip), %r8     # 0x3338d5
movl $0xec, %r9d
jmp 0x11ab75
movq %rbx, %rdi
callq 0x1112ad
testq %rax, %rax
je 0x11a9af
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0x8f482
testq %rax, %rax
jne 0x11aa2b
movl %r15d, 0xc(%rsp)
movq %r13, %rdi
callq 0x11ac0e
movq %rax, %r12
movq 0x10(%r14), %r15
movq %r13, %rdi
callq 0xaed4b
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x8f4bd
incq 0x38(%r14)
movb $0x1, 0x2a(%r14)
jmp 0x11a916
movq %rbx, %rdi
callq 0x299556
testq %rax, %rax
je 0x11aa05
movq 0x18(%r14), %rdi
movq %r13, %rsi
callq 0x8f482
testq %rax, %rax
jne 0x11aa2b
movl %r15d, 0xc(%rsp)
movq %r13, %rdi
callq 0x11ac0e
movq %rax, %r12
movq 0x18(%r14), %r15
movq %r13, %rdi
callq 0xaed4b
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x8f4bd
incq 0x38(%r14)
movb $0x1, 0x2b(%r14)
jmp 0x11a916
movq %rbx, %rdi
callq 0x117eb6
testq %rax, %rax
je 0x11a924
movq 0x20(%r14), %rdi
movq %r13, %rsi
callq 0x8f482
testq %rax, %rax
je 0x11ab11
movq %rax, %r12
cmpq %rbx, 0x10(%r12)
je 0x11aa3a
incq 0x18(%r12)
cmpl $0x2, %r15d
je 0x11aa60
cmpl $0x1, %r15d
jne 0x11aafd
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x8f482
testq %rax, %rax
je 0x11aa76
movq %rax, %r15
jmp 0x11aaa1
movq (%r12), %rdi
movq %rbx, %rsi
callq 0x8f482
testq %rax, %rax
je 0x11aaba
movq %rax, %r15
jmp 0x11aae5
callq 0x11b700
movq %rax, %r15
movq %rbx, %rdi
callq 0xdccf8
movq %rax, %rbx
movq (%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x8f4bd
testq %r15, %r15
je 0x11abaf
movq (%r15), %rdi
movq %rbp, %rsi
callq 0xae22f
cmpb $0x0, 0x2d(%r14)
jne 0x11aafd
movb $0x1, 0x2d(%r14)
jmp 0x11aafd
callq 0x11b700
movq %rax, %r15
movq %rbx, %rdi
callq 0xdccf8
movq %rax, %rbx
movq (%r12), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x8f4bd
testq %r15, %r15
je 0x11abdd
movq 0x8(%r15), %rdi
movq %rbp, %rsi
callq 0xae22f
cmpb $0x0, 0x2e(%r14)
jne 0x11aafd
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 0x11ac0e
movq %rax, %r12
movq 0x20(%r14), %r15
movq %r13, %rdi
callq 0xaed4b
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x8f4bd
incq 0x38(%r14)
movb $0x1, 0x2c(%r14)
jmp 0x11a916
movq 0x31d418(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ca4b9(%rip), %rsi    # 0x2e5013
leaq 0x218dce(%rip), %rdx    # 0x33392f
leaq 0x218de6(%rip), %rcx    # 0x33394e
leaq 0x218d66(%rip), %r8     # 0x3338d5
movl $0xbc, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x31d3e0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ca481(%rip), %rsi    # 0x2e5013
leaq 0x218dd0(%rip), %rdx    # 0x333969
leaq 0x218dae(%rip), %rcx    # 0x33394e
leaq 0x218d2e(%rip), %r8     # 0x3338d5
movl $0xc9, %r9d
jmp 0x11ab75
movq 0x31d3b2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ca453(%rip), %rsi    # 0x2e5013
leaq 0x218db3(%rip), %rdx    # 0x33397a
leaq 0x218d80(%rip), %rcx    # 0x33394e
leaq 0x218d00(%rip), %r8     # 0x3338d5
movl $0xfa, %r9d
jmp 0x11ab75
movq 0x31d384(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ca425(%rip), %rsi    # 0x2e5013
leaq 0x218d85(%rip), %rdx    # 0x33397a
leaq 0x218d52(%rip), %rcx    # 0x33394e
leaq 0x218cd2(%rip), %r8     # 0x3338d5
movl $0x105, %r9d            # imm = 0x105
jmp 0x11ab75