// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/snp_annotator_visitor.c
// Function: gt_snp_annotator_visitor_prepare_gene
static int gt_snp_annotator_visitor_prepare_gene(GtSNPAnnotatorVisitor *sav,
                                                 GtError *err)
{
  GtFeatureNodeIterator *fni,
                        *mrnafni;
  GtFeatureNode *curnode,
                *last_mRNA = NULL;
  GtStr *mrnaseq,
        *seqid;
  int had_err = 0;

  mrnaseq = gt_str_new();
  seqid = gt_genome_node_get_seqid((GtGenomeNode*) sav->gene);
  fni = gt_feature_node_iterator_new(sav->gene);
  while (!had_err && (curnode = gt_feature_node_iterator_next(fni))) {
    if (gt_feature_node_get_type(curnode) == sav->mRNA_type) {
      GtFeatureNode *curnode2;
      if (last_mRNA) {
        char *mrna_charseq = gt_calloc(gt_str_length(mrnaseq)+1, sizeof (char));
        (void) strncpy(mrna_charseq, gt_str_get(mrnaseq),
                       gt_str_length(mrnaseq));
        if (gt_feature_node_get_strand(sav->gene) == GT_STRAND_REVERSE) {
          had_err = gt_reverse_complement(mrna_charseq, gt_str_length(mrnaseq),
                                          err);
        }
        if (!had_err) {
          gt_hashmap_add(sav->rnaseqs, last_mRNA, mrna_charseq);
          last_mRNA = curnode;
          gt_str_reset(mrnaseq);
        }
      } else last_mRNA = curnode;
      if (!had_err) {
        mrnafni = gt_feature_node_iterator_new(curnode);
        while (!had_err && (curnode2 =
                                      gt_feature_node_iterator_next(mrnafni))) {
          if (gt_feature_node_get_type(curnode2) == sav->CDS_type) {
            char *tmp;
            GtRange rng = gt_genome_node_get_range((GtGenomeNode*) curnode2);
            had_err = gt_region_mapping_get_sequence(sav->rmap, &tmp, seqid,
                                                     rng.start, rng.end, err);
            if (!had_err) {
              gt_str_append_cstr_nt(mrnaseq, tmp, gt_range_length(&rng));
              gt_free(tmp);
            }
          }
        }
        gt_feature_node_iterator_delete(mrnafni);
      }
    }
  }
  if (!had_err && last_mRNA) {
    char *mrna_charseq = gt_calloc(gt_str_length(mrnaseq)+1, sizeof (char));
    (void) strncpy(mrna_charseq, gt_str_get(mrnaseq), gt_str_length(mrnaseq));
    if (gt_feature_node_get_strand(sav->gene) == GT_STRAND_REVERSE) {
      had_err = gt_reverse_complement(mrna_charseq, gt_str_length(mrnaseq),
                                      err);
    }
    if (!had_err) {
      gt_hashmap_add(sav->rnaseqs, last_mRNA, mrna_charseq);
    }
  }
  gt_feature_node_iterator_delete(fni);
  gt_str_delete(mrnaseq);
  return had_err;
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq $0x0, 0x98(%rsp)
movl $0x0, 0x84(%rsp)
callq 0x11d4a0
movq %rax, 0x90(%rsp)
movq 0xc0(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x171b70
movq %rax, 0x88(%rsp)
movq 0xc0(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x170b00
movq %rax, 0xb0(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x84(%rsp)
movb %al, 0x4f(%rsp)
jne 0x1d973d
movq 0xb0(%rsp), %rdi
callq 0x170e30
movq %rax, 0xa0(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x1d974a
jmp 0x1d99b4
movq 0xa0(%rsp), %rdi
callq 0x16d430
movq 0xc0(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x1d99af
cmpq $0x0, 0x98(%rsp)
je 0x1d9872
movq 0x90(%rsp), %rdi
callq 0x11dfa0
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
leaq 0x38c4d1(%rip), %rdx    # 0x565c69
movl $0x138, %ecx            # imm = 0x138
callq 0xe83c0
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x90(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x40(%rsp)
movq 0x90(%rsp), %rdi
callq 0x11dfa0
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq %rax, %rdx
callq 0x19330
movq 0xc0(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x16cc70
cmpl $0x1, %eax
jne 0x1d982b
movq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x90(%rsp), %rdi
callq 0x11dfa0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
movq 0xb8(%rsp), %rdx
callq 0x1cb4f0
movl %eax, 0x84(%rsp)
cmpl $0x0, 0x84(%rsp)
jne 0x1d9870
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x98(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0xe0fc0
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x90(%rsp), %rdi
callq 0x11e110
jmp 0x1d9882
movq 0xa0(%rsp), %rax
movq %rax, 0x98(%rsp)
cmpl $0x0, 0x84(%rsp)
jne 0x1d99ad
movq 0xa0(%rsp), %rdi
callq 0x170b00
movq %rax, 0xa8(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x84(%rsp)
movb %al, 0x2f(%rsp)
jne 0x1d98d2
movq 0xa8(%rsp), %rdi
callq 0x170e30
movq %rax, 0x78(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0x2f(%rsp)
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x1d98df
jmp 0x1d99a0
movq 0x78(%rsp), %rdi
callq 0x16d430
movq 0xc0(%rsp), %rcx
cmpq 0x40(%rcx), %rax
jne 0x1d999b
movq 0x78(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x58(%rsp)
movq %rdx, 0x60(%rsp)
movq 0xc0(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x88(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %r8
movq 0xb8(%rsp), %r9
leaq 0x68(%rsp), %rsi
callq 0x1c8040
movl %eax, 0x84(%rsp)
cmpl $0x0, 0x84(%rsp)
jne 0x1d9999
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x107320
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
callq 0x11d830
movq 0x68(%rsp), %rdi
leaq 0x38c2da(%rip), %rsi    # 0x565c69
movl $0x150, %edx            # imm = 0x150
callq 0xe88c0
jmp 0x1d999b
jmp 0x1d98a5
movq 0xa8(%rsp), %rdi
callq 0x170f50
jmp 0x1d99af
jmp 0x1d970d
cmpl $0x0, 0x84(%rsp)
jne 0x1d9aac
cmpq $0x0, 0x98(%rsp)
je 0x1d9aac
movq 0x90(%rsp), %rdi
callq 0x11dfa0
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
leaq 0x38c278(%rip), %rdx    # 0x565c69
movl $0x159, %ecx            # imm = 0x159
callq 0xe83c0
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x90(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x10(%rsp)
movq 0x90(%rsp), %rdi
callq 0x11dfa0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x19330
movq 0xc0(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x16cc70
cmpl $0x1, %eax
jne 0x1d9a82
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x90(%rsp), %rdi
callq 0x11dfa0
movq (%rsp), %rdi
movq %rax, %rsi
movq 0xb8(%rsp), %rdx
callq 0x1cb4f0
movl %eax, 0x84(%rsp)
cmpl $0x0, 0x84(%rsp)
jne 0x1d9aaa
movq 0xc0(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x98(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0xe0fc0
jmp 0x1d9aac
movq 0xb0(%rsp), %rdi
callq 0x170f50
movq 0x90(%rsp), %rdi
callq 0x11f560
movl 0x84(%rsp), %eax
addq $0xc8, %rsp
retq
nopw %cs:(%rax,%rax)