// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rdx, %rdx
je 0x63b9c
movq %rbx, %rdi
callq 0xc103
testb %al, %al
jne 0x63cf4
movq %r15, %rdi
callq 0x1ba16
movq %rax, %r15
xorl %r12d, %r12d
leaq 0x6a61e(%rip), %rbp     # 0xce1cf
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x1bb1e
movq %rax, (%rsp)
testq %rax, %rax
je 0x63c87
movq %rax, %rdi
movq %rbp, %rsi
callq 0x1987b
testb %al, %al
je 0x63bb4
movq (%rsp), %rdi
callq 0x198d7
testb %al, %al
je 0x63c72
testq %r13, %r13
jne 0x63c01
xorl %edi, %edi
xorl %esi, %esi
leaq -0x17a5c(%rip), %rdx    # 0x4c19d
callq 0x55da4
movq %rax, %r13
movq (%rsp), %rdi
callq 0x19b8f
movq %r13, %rdi
movq %rax, %rsi
callq 0x55ef6
testq %rax, %rax
je 0x63c2a
movq %rax, %rdi
movq %rsp, %rsi
pushq $0x8
popq %rdx
callq 0x4b801
jmp 0x63bb4
pushq $0x8
popq %rdi
callq 0x4b380
movq %r14, 0x10(%rsp)
movq %rax, %r14
movq (%rsp), %rdi
callq 0x19b8f
movq %rax, 0x8(%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x4b801
movq 0x8(%rsp), %rsi
movq %r13, %rdi
movq %r14, %rdx
movq 0x10(%rsp), %r14
callq 0x55f31
jmp 0x63bb4
testq %r12, %r12
jne 0x63c82
pushq $0x8
popq %rdi
callq 0x4b380
movq %rax, %r12
movq %r12, %rdi
jmp 0x63c1d
testq %r12, %r12
je 0x63ca0
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x63d2c
movl %eax, %ebp
jmp 0x63ca2
xorl %ebp, %ebp
testl %ebp, %ebp
sete %al
testq %r13, %r13
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x63ccb
leaq 0x3ee(%rip), %rsi       # 0x640a9
movq %r13, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x55fe2
movl %eax, %ebp
movq %r12, %rdi
callq 0x4c19d
movq %r13, %rdi
callq 0x563a7
movq %r15, %rdi
callq 0x1bbe1
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xca2bd(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x66361(%rip), %rsi     # 0xca066
leaq 0x6694d(%rip), %rdx     # 0xca659
leaq 0x7963b(%rip), %rcx     # 0xdd34e
leaq 0x795ec(%rip), %r8      # 0xdd306
movl $0x9a, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300