// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/cds_check_visitor.c
// Function: check_cds_phases_if_necessary
static int check_cds_phases_if_necessary(GtFeatureNode *fn,
                                         GtCDSCheckVisitor *v,
                                         bool second_pass, GtError *err)
{
  GtFeatureNodeIterator *fni;
  GtFeatureNode *node;
  GtArray *cds_features = NULL;
  GtHashmap *multi_features = NULL;
  int had_err = 0;
  gt_error_check(err);
  gt_assert(fn);
  fni = gt_feature_node_iterator_new_direct(fn);
  while ((node = gt_feature_node_iterator_next(fni))) {
    if (gt_feature_node_has_type(node, gt_ft_CDS)) {
      if (gt_feature_node_is_multi(node)) {
        GtArray *features;
        if (!multi_features)
          multi_features = gt_hashmap_new(GT_HASH_DIRECT, NULL,
                                          (GtFree) gt_array_delete);
        if ((features =
                gt_hashmap_get(multi_features,
                             gt_feature_node_get_multi_representative(node)))) {
          gt_array_add(features, node);
        }
        else {
          GtFeatureNode *representative;
          features = gt_array_new(sizeof (GtFeatureNode*));
          representative = gt_feature_node_get_multi_representative(node);
          gt_array_add(features, representative);
          gt_hashmap_add(multi_features, representative, features);
        }
      }
      else {
        if (!cds_features)
          cds_features = gt_array_new(sizeof (GtFeatureNode*));
        gt_array_add(cds_features, node);
      }
    }
  }
  if (cds_features)
    had_err = check_cds_phases(cds_features, v, false, second_pass, err);
  if (!had_err && multi_features)
    had_err = gt_hashmap_foreach(multi_features, check_cds_phases_hm, v, err);
  gt_array_delete(cds_features);
  gt_hashmap_delete(multi_features);
  gt_feature_node_iterator_delete(fni);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testq %rdx, %rdx
je 0x84388
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0x84526
movq %rbx, %rdi
callq 0x40fcd
movq %rax, %rbx
movq %rax, %rdi
callq 0x41076
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x844bb
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
xorl %r12d, %r12d
leaq 0x60e12(%rip), %rbp     # 0xe51cf
leaq 0x8(%rsp), %r15
xorl %r13d, %r13d
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3faa4
testb %al, %al
je 0x84440
movq 0x8(%rsp), %rdi
callq 0x3facd
testb %al, %al
je 0x8441e
testq %r12, %r12
jne 0x843fa
xorl %edi, %edi
xorl %esi, %esi
leaq -0x14c8a(%rip), %rdx    # 0x6f768
callq 0x7740c
movq %rax, %r12
movq 0x8(%rsp), %rdi
callq 0x3fc0c
movq %r12, %rdi
movq %rax, %rsi
callq 0x775ed
testq %rax, %rax
je 0x84458
movl $0x8, %edx
movq %rax, %rdi
jmp 0x84438
testq %r13, %r13
jne 0x84430
movl $0x8, %edi
callq 0x6ef7c
movq %rax, %r13
movl $0x8, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x6f240
movq %rbx, %rdi
callq 0x41076
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x843c5
jmp 0x84498
movl $0x8, %edi
callq 0x6ef7c
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x3fc0c
movq %rax, 0x20(%rsp)
movl $0x8, %edx
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0x6f240
movq 0x20(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x77628
jmp 0x84440
testq %r13, %r13
je 0x844c5
movq %r13, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
xorl %edx, %edx
movq 0x18(%rsp), %r14
movq %r14, %rcx
callq 0x8452b
movl %eax, %ebp
jmp 0x844d4
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %ebp, %ebp
jmp 0x844fd
xorl %r13d, %r13d
xorl %ebp, %ebp
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %r15
testl %ebp, %ebp
sete %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x844fd
leaq 0x34e(%rip), %rsi       # 0x8483b
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x776d9
movl %eax, %ebp
movq %r13, %rdi
callq 0x6f768
movq %r12, %rdi
callq 0x77bab
movq %rbx, %rdi
callq 0x41108
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1f188