// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/cds_visitor.c
// Function: extract_cds_if_necessary
static int extract_cds_if_necessary(GtFeatureNode *fn, void *data,
                                    GtError *err)
{
  GtCDSVisitor *v = (GtCDSVisitor*) data;
  GtRange range;
  char *outsequence;
  int had_err = 0;

  gt_error_check(err);
  gt_assert(fn);

  if (gt_feature_node_has_type(fn, gt_ft_exon) &&
      (gt_feature_node_get_strand(fn) == GT_STRAND_FORWARD ||
       gt_feature_node_get_strand(fn) == GT_STRAND_REVERSE)) {
    range = gt_genome_node_get_range((GtGenomeNode*) fn);
    gt_assert(v->region_mapping);
    had_err = gt_region_mapping_get_sequence(v->region_mapping, &outsequence,
                                   gt_genome_node_get_seqid((GtGenomeNode*) fn),
                                   range.start, range.end, err);
    if (!had_err) {
      gt_assert(range.start && range.end); /* 1-based coordinates */
      gt_splicedseq_add(v->splicedseq, range.start, range.end, outsequence);
      gt_free(outsequence);
    }
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testq %rdx, %rdx
je 0xc21e2
movq %r14, %rdi
callq 0xc103
testb %al, %al
jne 0xc22d2
testq %r15, %r15
je 0xc22a8
leaq 0x23a2c(%rip), %rsi     # 0xe5c1e
movq %r15, %rdi
callq 0x1987b
xorl %ebp, %ebp
testb %al, %al
je 0xc2297
movq %r15, %rdi
callq 0x18f89
testl %eax, %eax
je 0xc221d
movq %r15, %rdi
callq 0x18f89
cmpl $0x1, %eax
jne 0xc2297
movq %r15, %rdi
callq 0x1c3c4
movq 0x28(%rbx), %rbp
testq %rbp, %rbp
je 0xc22fc
movq %rax, %r12
movq %rdx, %r13
movq %r15, %rdi
callq 0x1c31a
movq %rsp, %rsi
movq %rbp, %rdi
movq %rax, %rdx
movq %r12, %rcx
movq %r13, %r8
movq %r14, %r9
callq 0x890d4
movl %eax, %ebp
testl %eax, %eax
jne 0xc2297
testq %r12, %r12
je 0xc2326
testq %r13, %r13
je 0xc2326
movq 0x20(%rbx), %rdi
movq (%rsp), %rcx
movq %r12, %rsi
movq %r13, %rdx
callq 0xc467b
movq (%rsp), %rdi
leaq 0x32148(%rip), %rsi     # 0xf43d5
pushq $0x4e
popq %rdx
callq 0xd249
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6bd09(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7dad(%rip), %rsi      # 0xca066
leaq 0x1b3e6(%rip), %rdx     # 0xdd6a6
leaq 0x32196(%rip), %rcx     # 0xf445d
leaq 0x32107(%rip), %r8      # 0xf43d5
pushq $0x41
jmp 0xc234e
movq 0x6bcdf(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7d83(%rip), %rsi      # 0xca066
leaq 0x836f(%rip), %rdx      # 0xca659
leaq 0x3216c(%rip), %rcx     # 0xf445d
leaq 0x320dd(%rip), %r8      # 0xf43d5
pushq $0x40
jmp 0xc234e
movq 0x6bcb5(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7d59(%rip), %rsi      # 0xca066
leaq 0x32162(%rip), %rdx     # 0xf4476
leaq 0x32142(%rip), %rcx     # 0xf445d
leaq 0x320b3(%rip), %r8      # 0xf43d5
pushq $0x47
jmp 0xc234e
movq 0x6bc8b(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7d2f(%rip), %rsi      # 0xca066
leaq 0x3214a(%rip), %rdx     # 0xf4488
leaq 0x32118(%rip), %rcx     # 0xf445d
leaq 0x32089(%rip), %r8      # 0xf43d5
pushq $0x4c
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300