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

  gt_error_check(err);
  gt_assert(fn);

  had_err = extract_spliced_seq(fn, v, err);
  if (!had_err && gt_splicedseq_length(v->splicedseq) > 2) {
    GtArray *orfs;

    if (gt_feature_node_get_strand(fn) == GT_STRAND_REVERSE) {
      if (gt_splicedseq_reverse(v->splicedseq, err))
        return -1;
    }

    orfs = determine_ORFs_for_all_three_frames(v->splicedseq, v->start_codon,
                                               v->final_stop_codon,
                                               v->generic_start_codons);
    if (!orfs)
      had_err = -1;
    if (!had_err)
      create_CDS_features_for_longest_ORF(orfs, v, fn);
    gt_array_delete(orfs);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
testq %rdx, %rdx
je 0xc1995
movq %r15, %rdi
callq 0xc103
testb %al, %al
jne 0xc20c7
testq %rbx, %rbx
je 0xc206d
movq %r15, %rdi
callq 0xc103
testb %al, %al
je 0xc199e
movq 0x6c649(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x86ed(%rip), %rsi      # 0xca066
leaq 0x8cd9(%rip), %rdx      # 0xca659
leaq 0x32ab4(%rip), %rcx     # 0xf443b
leaq 0x32a47(%rip), %r8      # 0xf43d5
pushq $0x57
jmp 0xc20c3
testq %rbx, %rbx
je 0xc206d
testq %r14, %r14
je 0xc209b
movq 0x20(%r14), %rdi
callq 0xc4a44
leaq 0x802(%rip), %rdx       # 0xc21b9
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x1ae00
movl %eax, %ebp
testl %eax, %eax
jne 0xc2059
movq 0x20(%r14), %rdi
callq 0xc493c
xorl %ebp, %ebp
cmpq $0x3, %rax
jb 0xc2059
movq %rbx, %rdi
callq 0x18f89
cmpl $0x1, %eax
jne 0xc1a09
movq 0x20(%r14), %rdi
movq %r15, %rsi
callq 0xc4980
testl %eax, %eax
je 0xc1a09
pushq $-0x1
popq %rbp
jmp 0xc2059
movq %rbx, 0x48(%rsp)
movq 0x20(%r14), %r15
testq %r15, %r15
je 0xc20ff
movb 0x38(%r14), %al
movb %al, 0x4(%rsp)
movb 0x39(%r14), %al
movb %al, 0x30(%rsp)
movb 0x3a(%r14), %bl
movq %r15, %rdi
callq 0xc4760
movq %rax, %r12
movq %r15, %rdi
callq 0xc493c
xorl %r13d, %r13d
movq %r12, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x83627
movq %rax, %r15
callq 0x13d5c
movq %rax, 0x10(%rsp)
movq %rax, 0x50(%rsp)
callq 0x13d5c
movq %rax, 0x20(%rsp)
movq %rax, 0x58(%rsp)
callq 0x13d5c
movq %rax, %r12
movq %rax, 0x60(%rsp)
movl $0x0, %ebp
movl $0x0, %eax
testb %bl, %bl
je 0xc1aa3
callq 0x13d5c
movq %rax, %r13
callq 0x13d5c
movq %rax, %rbp
callq 0x13d5c
movq %r12, 0x88(%rsp)
movq %r13, 0x8(%rsp)
movq %r13, 0x70(%rsp)
movq %rbp, 0x40(%rsp)
movq %rbp, 0x78(%rsp)
movq %rax, 0x38(%rsp)
movq %rax, 0x80(%rsp)
testq %r15, %r15
je 0xc2129
movq %r15, 0x90(%rsp)
movq %r15, %rdi
callq 0x86e46
movq %rax, %r15
leaq 0x3(%rsp), %rbp
leaq 0x2c(%rsp), %r12
leaq 0x2(%rsp), %r13
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x87371
testl %eax, %eax
jne 0xc1b41
movl 0x2c(%rsp), %eax
movq 0x50(%rsp,%rax,8), %rdi
movsbl 0x3(%rsp), %esi
callq 0x140b1
testb %bl, %bl
je 0xc1af7
movl 0x2c(%rsp), %eax
movq 0x70(%rsp,%rax,8), %rdi
movzbl 0x2(%rsp), %esi
shll $0x5, %esi
addl $0x2d, %esi
callq 0x140b1
jmp 0xc1af7
cmpl $-0x2, %eax
jne 0xc1b5a
xorl %ebx, %ebx
movq 0x48(%rsp), %r12
movq 0x88(%rsp), %rbp
jmp 0xc1c9b
pushq $0x10
popq %rdi
callq 0x4b380
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x143d2
movq %rax, %rbp
movq %r12, %rdi
callq 0x14461
movq %rax, %r13
testb %bl, %bl
je 0xc1b92
movq 0x8(%rsp), %rdi
callq 0x143d2
jmp 0xc1b94
xorl %eax, %eax
subq $0x20, %rsp
movq %rax, 0x10(%rsp)
movzbl 0x50(%rsp), %eax
movq %rax, 0x50(%rsp)
movl %eax, (%rsp)
andl $0x0, 0x8(%rsp)
movzbl 0x24(%rsp), %r9d
leaq 0x7a0(%rip), %rdi       # 0xc235c
xorl %r12d, %r12d
movq 0x38(%rsp), %rsi
xorl %edx, %edx
movq %rbp, %rcx
movq %r13, %r8
movl %r9d, 0x24(%rsp)
callq 0xc80d4
addq $0x20, %rsp
movq 0x20(%rsp), %rbp
movq %rbp, %rdi
callq 0x143d2
movq %rax, %r13
movq %rbp, %rdi
callq 0x14461
movq %rax, %rbp
testb %bl, %bl
je 0xc1c06
movq 0x40(%rsp), %rdi
callq 0x143d2
movq %rax, %r12
subq $0x8, %rsp
leaq 0x74b(%rip), %rdi       # 0xc235c
pushq $0x1
popq %rdx
movq 0x20(%rsp), %rsi
movq %r13, %rcx
movq %rbp, %r8
movl 0xc(%rsp), %r9d
pushq %r12
pushq $0x0
pushq 0x48(%rsp)
callq 0xc80d4
addq $0x20, %rsp
movq 0x88(%rsp), %rbp
movq %rbp, %rdi
callq 0x143d2
movq %rax, %r12
movq %rbp, %rdi
callq 0x14461
movq %rax, %r13
testb %bl, %bl
je 0xc1c63
movq 0x38(%rsp), %rdi
callq 0x143d2
jmp 0xc1c65
xorl %eax, %eax
subq $0x8, %rsp
leaq 0x6ec(%rip), %rdi       # 0xc235c
pushq $0x2
popq %rdx
movq 0x20(%rsp), %rbx
movq %rbx, %rsi
movq %r12, %rcx
movq %r13, %r8
movl 0xc(%rsp), %r9d
pushq %rax
pushq $0x0
pushq 0x48(%rsp)
callq 0xc80d4
addq $0x20, %rsp
movq 0x48(%rsp), %r12
movq 0x38(%rsp), %rdi
callq 0x152db
movq 0x40(%rsp), %rdi
callq 0x152db
movq 0x8(%rsp), %rdi
callq 0x152db
movq %rbp, %rdi
callq 0x152db
movq 0x20(%rsp), %rdi
callq 0x152db
movq 0x10(%rsp), %rdi
callq 0x152db
movq %r15, %rdi
callq 0x874ce
movq 0x90(%rsp), %rdi
callq 0x83360
xorl %ebp, %ebp
testq %rbx, %rbx
sete %r15b
je 0xc204c
movq %rbx, %rdi
callq 0x4b988
testq %rax, %rax
je 0xc204c
movq %rbx, %rdi
callq 0x5dbb8
movq %rbx, %rdi
callq 0x4b4dc
movq %rax, %rdi
callq 0x5d05e
imull $0x3, 0x10(%r14), %ecx
cmpq %rcx, %rax
jb 0xc204c
movb %r15b, 0x38(%rsp)
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
callq 0x4b4dc
movups (%rax), %xmm0
leaq 0x50(%rsp), %r15
movaps %xmm0, (%r15)
movq %r12, %rdi
callq 0x18f89
movl %eax, %ebx
movq %r15, %rdi
callq 0x5d05e
cmpq $0x2, %rax
jbe 0xc2188
movq 0x20(%r14), %rdi
testl %ebx, %ebx
leaq 0x58(%rsp), %rcx
movq %rcx, %rax
cmoveq %r15, %rax
movq (%rax), %rsi
movl %ebx, 0x20(%rsp)
movq %r15, %rbx
cmoveq %rcx, %rbx
callq 0xc4891
movq %rax, %r15
movq 0x20(%r14), %rdi
addq 0x30(%r14), %r15
movq (%rbx), %rsi
movl 0x20(%rsp), %ebx
callq 0xc4891
movq %rax, %r13
addq 0x30(%r14), %r13
pushq $0x8
popq %rdi
callq 0x4b380
movq %rax, 0x10(%rsp)
movq %r12, %rdi
callq 0x1c31a
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x18f89
leaq 0xc3f9(%rip), %rsi      # 0xce1cf
movq 0x8(%rsp), %rdi
movq %r15, %rdx
movq %r13, %rcx
movl %eax, %r8d
callq 0x18cbb
movq %rax, %r15
leaq 0x70(%rsp), %rax
movq %r15, (%rax)
movq 0x18(%r14), %rsi
movq %r15, %rdi
callq 0x188ae
movq %r15, %rdi
xorl %esi, %esi
callq 0x18944
movq %r15, 0x8(%rsp)
movq %r15, %rdi
callq 0x199db
xorl %ecx, %ecx
testl %ebx, %ebx
sete %cl
leaq 0x58(%rsp), %rax
movq -0x8(%rax), %rsi
movq (%rax), %rax
movq %rax, %r13
cmoveq %rsi, %r13
leaq -0x1(,%rcx,2), %r15
movq %r15, 0x40(%rsp)
xorl %ecx, %ecx
cmpq %rax, %r13
setb %cl
xorl %edx, %edx
cmpq %rsi, %r13
seta %dl
testl %ebx, %ebx
cmovel %ecx, %edx
cmpb $0x1, %dl
jne 0xc1f71
movq 0x20(%r14), %rdi
movq %r13, %rsi
callq 0xc4768
testb %al, %al
je 0xc1f5f
movq 0x70(%rsp), %r15
movq 0x20(%r14), %rdi
movq %r13, %rsi
callq 0xc4891
addq 0x30(%r14), %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0x1a43f
movq 0x70(%rsp), %rdi
callq 0x1c420
movq 0x70(%rsp), %rsi
movq %r12, %rdi
callq 0x19245
movq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x4b801
testl %ebx, %ebx
je 0xc1ec8
leaq -0x1(%r13), %rsi
movq %rsi, 0x58(%rsp)
jmp 0xc1ed1
leaq 0x1(%r13), %rsi
movq %rsi, 0x50(%rsp)
movq 0x20(%r14), %rdi
callq 0xc4891
movq %rax, %r15
addq 0x30(%r14), %r15
testl %ebx, %ebx
movq 0x20(%r14), %rdi
leaq 0x50(%rsp), %rax
leaq 0x58(%rsp), %rcx
cmoveq %rcx, %rax
movq (%rax), %rsi
callq 0xc4891
movq %rax, %rbx
addq 0x30(%r14), %rbx
movq %r12, %rdi
callq 0x1c31a
movq %rax, %r12
movq 0x48(%rsp), %rdi
callq 0x18f89
movq %r12, %rdi
movq 0x48(%rsp), %r12
leaq 0xc2a7(%rip), %rsi      # 0xce1cf
movq %r15, %rdx
movq %rbx, %rcx
movl 0x20(%rsp), %ebx
movl %eax, %r8d
callq 0x18cbb
movq %rax, 0x70(%rsp)
movq 0x18(%r14), %rsi
movq %rax, %rdi
callq 0x188ae
movq 0x70(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x19a6c
movq 0x40(%rsp), %r15
addq %r15, %r13
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rax
jmp 0xc1e3e
testl %ebx, %ebx
movl %ebx, %r13d
leaq 0x70(%rsp), %rbx
movq (%rbx), %r15
movq 0x20(%r14), %rdi
cmoveq %rax, %rsi
callq 0xc4891
addq 0x30(%r14), %rax
movq %r15, %rdi
movq 0x10(%rsp), %r15
movq %rax, %rsi
callq 0x1a43f
movq (%rbx), %rsi
movq %r12, %rdi
callq 0x19245
pushq $0x8
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4b801
cmpl $0x1, %r13d
jne 0xc1fc6
movq %r15, %rdi
callq 0x4b6dd
testq %r15, %r15
je 0xc2157
movq %r15, %rdi
callq 0x4b988
testq %rax, %rax
je 0xc2157
xorl %r12d, %r12d
pushq $0x3
popq %r13
xorl %ebx, %ebx
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x4b988
movq %r15, %rdi
cmpq %rax, %rbx
jae 0xc203d
movq %rbx, %rsi
callq 0x4b48e
movq (%rax), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x18944
movq %r15, %rdi
movq 0x10(%rsp), %r15
callq 0x1c420
movl %r14d, %ecx
subq %rcx, %rax
xorl %edx, %edx
divq %r13
movl %edx, %r14d
xorl $0x3, %r14d
testq %rdx, %rdx
cmovel %r12d, %r14d
incq %rbx
jmp 0xc1fec
callq 0x4c19d
movq 0x18(%rsp), %rbx
movb 0x38(%rsp), %r15b
movb %r15b, %bpl
negl %ebp
movq %rbx, %rdi
callq 0x4c19d
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6bf44(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7fe8(%rip), %rsi      # 0xca066
leaq 0x1b621(%rip), %rdx     # 0xdd6a6
leaq 0x3239a(%rip), %rcx     # 0xf4426
leaq 0x32342(%rip), %r8      # 0xf43d5
movl $0x112, %r9d            # imm = 0x112
jmp 0xc20f3
movq 0x6bf16(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7fba(%rip), %rsi      # 0xca066
leaq 0x3239c(%rip), %rdx     # 0xf444f
leaq 0x32381(%rip), %rcx     # 0xf443b
leaq 0x32314(%rip), %r8      # 0xf43d5
pushq $0x58
popq %r9
jmp 0xc20f3
movq 0x6beea(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7f8e(%rip), %rsi      # 0xca066
leaq 0x857a(%rip), %rdx      # 0xca659
leaq 0x32340(%rip), %rcx     # 0xf4426
leaq 0x322e8(%rip), %r8      # 0xf43d5
movl $0x111, %r9d            # imm = 0x111
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x6beb2(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7f56(%rip), %rsi      # 0xca066
leaq 0xdf23(%rip), %rdx      # 0xd003a
leaq 0x32383(%rip), %rcx     # 0xf44a1
leaq 0x322b0(%rip), %r8      # 0xf43d5
pushq $0x77
jmp 0xc20c3
movq 0x6be88(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7f2c(%rip), %rsi      # 0xca066
leaq 0x222ec(%rip), %rdx     # 0xe442d
leaq 0x32359(%rip), %rcx     # 0xf44a1
leaq 0x32286(%rip), %r8      # 0xf43d5
movl $0x83, %r9d
jmp 0xc20f3
movq 0x6be5a(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7efe(%rip), %rsi      # 0xca066
leaq 0x323a4(%rip), %rdx     # 0xf4513
leaq 0x323c9(%rip), %rcx     # 0xf453f
leaq 0x32258(%rip), %r8      # 0xf43d5
movl $0xb1, %r9d
jmp 0xc20f3
movq 0x6be29(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7ecd(%rip), %rsi      # 0xca066
leaq 0x3233c(%rip), %rdx     # 0xf44dc
leaq 0x32350(%rip), %rcx     # 0xf44f7
leaq 0x32227(%rip), %r8      # 0xf43d5
movl $0xc4, %r9d
jmp 0xc20f3