// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x68, %rsp
movb %dl, %al
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
andb $0x1, %al
movb %al, 0x57(%rsp)
movq %rcx, 0x48(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0xa4dc5
movq 0x48(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xa4d8d
jmp 0xa4dc5
movq 0x10f244(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xb92c8(%rip), %rsi     # 0x15e066
leaq 0xb98a3(%rip), %rdx     # 0x15e648
leaq 0xcd46c(%rip), %rcx     # 0x172218
leaq 0xcd41d(%rip), %r8      # 0x1721d0
movl $0x9a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xa4dc7
jmp 0xa4dc9
cmpq $0x0, 0x60(%rsp)
jne 0xa4e09
movq 0x10f200(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xb9284(%rip), %rsi     # 0x15e066
leaq 0xcd798(%rip), %rdx     # 0x172581
leaq 0xcd428(%rip), %rcx     # 0x172218
leaq 0xcd3d9(%rip), %r8      # 0x1721d0
movl $0x9b, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xa4e0b
movq 0x60(%rsp), %rdi
callq 0x24a80
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
callq 0x24bd0
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0xa4f3b
movq 0x38(%rsp), %rdi
leaq 0xbd3fc(%rip), %rsi     # 0x16223b
callq 0x21700
testb $0x1, %al
jne 0xa4e4d
jmp 0xa4f36
movq 0x38(%rsp), %rdi
callq 0x217b0
testb $0x1, %al
jne 0xa4e60
jmp 0xa4f09
cmpq $0x0, 0x28(%rsp)
jne 0xa4e7f
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
leaq -0x2ddd5(%rip), %rdx    # 0x770a0
callq 0x86190
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rdi
callq 0x21c40
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x86470
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0xa4ec1
movq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
jmp 0xa4f07
movl $0x8, %edi
callq 0x75ab0
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rdi
callq 0x21c40
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x86510
jmp 0xa4f34
cmpq $0x0, 0x30(%rsp)
jne 0xa4f20
movl $0x8, %edi
callq 0x75ab0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movl $0x8, %edx
callq 0x76220
jmp 0xa4f36
jmp 0xa4e1a
cmpq $0x0, 0x30(%rsp)
je 0xa4f66
movq 0x30(%rsp), %rdi
movq 0x58(%rsp), %rsi
movb 0x57(%rsp), %al
movq 0x48(%rsp), %r8
xorl %edx, %edx
andb $0x1, %al
movzbl %al, %ecx
callq 0xa5140
movl %eax, 0x24(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0xa4f94
cmpq $0x0, 0x28(%rsp)
je 0xa4f94
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rdx
movq 0x48(%rsp), %rcx
leaq 0x7a5(%rip), %rsi       # 0xa5730
callq 0x866f0
movl %eax, 0x24(%rsp)
movq 0x30(%rsp), %rdi
callq 0x770a0
movq 0x28(%rsp), %rdi
callq 0x86cc0
movq 0x40(%rsp), %rdi
callq 0x24cf0
movl 0x24(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax,%rax)