// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/snp_annotator_visitor.c
// Function: snp_annotator_visitor_feature_node
static int snp_annotator_visitor_feature_node(GtNodeVisitor *nv,
                                              GtFeatureNode *fn,
                                              GtError *err)
{
  int had_err = 0;
  GtSNPAnnotatorVisitor *sav;
  GtFeatureNodeIterator *fni,
                        *mrnafni;
  GtFeatureNode *curnode,
                *curnode2;
  GtRange snp_rng;
  gt_error_check(err);
  sav = snp_annotator_visitor_cast(nv);

  /* ignore non-nodes */
  if (!fn) return 0;

  /* only process SNPs */
  if (!(gt_feature_node_get_type(fn) == sav->SNV_type ||
        gt_feature_node_get_type(fn) == sav->SNP_type)) {
    return 0;
  }

  fni = gt_feature_node_iterator_new_direct(sav->gene);
  snp_rng = gt_genome_node_get_range((GtGenomeNode*) fn);
  while (!had_err && (curnode = gt_feature_node_iterator_next(fni))) {
    if (gt_feature_node_get_type(curnode) == sav->mRNA_type) {
      GtStrand mrna_strand = gt_feature_node_get_strand(curnode);
#ifndef NDEBUG
      const char *refstr;
#endif
      GtUword mrnasnppos = 0;
      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) {
          GtRange cds_rng = gt_genome_node_get_range((GtGenomeNode*) curnode2);
          if (gt_range_overlap(&snp_rng, &cds_rng)) {
            char *mRNA,
                 origchar;
            char *variantchars, *variantptr = NULL;
            GT_UNUSED char *refchars, *refptr = NULL;
            mRNA = (char*) gt_hashmap_get(sav->rnaseqs, curnode);
            gt_assert(mRNA);
            gt_assert(snp_rng.start >= cds_rng.start);
            mrnasnppos += (snp_rng.start - cds_rng.start);
            if (mrna_strand == GT_STRAND_REVERSE)
              mrnasnppos = strlen(mRNA) - mrnasnppos - 1;
            gt_assert(mrnasnppos < strlen(mRNA));
            origchar = mRNA[mrnasnppos];
#ifndef NDEBUG
            refstr = refptr = gt_cstr_dup(gt_feature_node_get_attribute(fn,
                                                         GT_GVF_REFERENCE_SEQ));
            if (!had_err && refstr) {
              if (gt_feature_node_get_strand(curnode) == GT_STRAND_REVERSE) {
                int rval = gt_complement(&origchar, origchar, err);
                gt_assert(rval == 0);
              }
              gt_assert(toupper(origchar) == toupper(refstr[0]));
            }
#endif
            variantchars = variantptr = gt_cstr_dup(
                         gt_feature_node_get_attribute(fn, GT_GVF_VARIANT_SEQ));
            if (!had_err && variantchars) {
              GtUword i = 0;

              while (!had_err &&
                              (*variantchars != ';' && *variantchars != '\0')) {
                if (*variantchars != ',' && *variantchars != origchar) {
                  char variantchar = *variantchars;
#ifndef NDEBUG
                  char refchar = refstr ? refstr[0] : '-';  /* XXX */
                  if (!had_err && mrna_strand == GT_STRAND_REVERSE)
                    had_err = gt_complement(&refchar, refchar, err);
#endif
                  if (!had_err && mrna_strand == GT_STRAND_REVERSE)
                    had_err = gt_complement(&variantchar, variantchar, err);
                  if (!had_err) {
                    had_err = snp_annotator_classify_snp(sav, curnode, fn,
                                                         mrnasnppos,
                                                         i++,
                                                         variantchar,
#ifndef NDEBUG
                                                         refchar,
#endif
                                                         err);
                  }
                } else if (*variantchars == origchar) {
                  i++;
                }
                variantchars++;
              }
              gt_free(variantptr);
              gt_free(refptr);
            }
          } else {
            mrnasnppos += gt_range_length(&cds_rng);
          }
        }
      }
      gt_feature_node_iterator_delete(mrnafni);
    }
  }
  gt_feature_node_iterator_delete(fni);

  return had_err;
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
movq %rdx, 0xe8(%rsp)
movl $0x0, 0xe4(%rsp)
cmpq $0x0, 0xe8(%rsp)
je 0x1d8db0
movq 0xe8(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1d8d78
jmp 0x1d8db0
movq 0x463221(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33d28a(%rip), %rsi    # 0x516013
leaq 0x33d42f(%rip), %rdx    # 0x5161bf
leaq 0x38cef7(%rip), %rcx    # 0x565c8e
leaq 0x38cecb(%rip), %r8     # 0x565c69
movl $0xb5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d8db2
callq 0x1d8c60
movq %rax, %rdi
movq 0xf8(%rsp), %rsi
callq 0x1b2350
movq %rax, 0xd8(%rsp)
cmpq $0x0, 0xf0(%rsp)
jne 0x1d8dea
movl $0x0, 0x104(%rsp)
jmp 0x1d94b0
movq 0xf0(%rsp), %rdi
callq 0x16d430
movq 0xd8(%rsp), %rcx
cmpq 0x48(%rcx), %rax
je 0x1d8e30
movq 0xf0(%rsp), %rdi
callq 0x16d430
movq 0xd8(%rsp), %rcx
cmpq 0x50(%rcx), %rax
je 0x1d8e30
movl $0x0, 0x104(%rsp)
jmp 0x1d94b0
movq 0xd8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x170ce0
movq %rax, 0xd0(%rsp)
movq 0xf0(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x98(%rsp)
movq %rdx, 0xa0(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0xb0(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xe4(%rsp)
movb %al, 0x2d(%rsp)
jne 0x1d8eb6
movq 0xd0(%rsp), %rdi
callq 0x170e30
movq %rax, 0xc0(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0x2d(%rsp)
movb 0x2d(%rsp), %al
testb $0x1, %al
jne 0x1d8ec3
jmp 0x1d9495
movq 0xc0(%rsp), %rdi
callq 0x16d430
movq 0xd8(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jne 0x1d9490
movq 0xc0(%rsp), %rdi
callq 0x16cc70
movl %eax, 0x94(%rsp)
movq $0x0, 0x80(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x170b00
movq %rax, 0xc8(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xe4(%rsp)
movb %al, 0x2c(%rsp)
jne 0x1d8f47
movq 0xc8(%rsp), %rdi
callq 0x170e30
movq %rax, 0xb8(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0x2c(%rsp)
movb 0x2c(%rsp), %al
testb $0x1, %al
jne 0x1d8f54
jmp 0x1d9483
movq 0xb8(%rsp), %rdi
callq 0x16d430
movq 0xd8(%rsp), %rcx
cmpq 0x40(%rcx), %rax
jne 0x1d947e
movq 0xb8(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x70(%rsp)
movq %rdx, 0x78(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x107390
testb $0x1, %al
jne 0x1d8fa5
jmp 0x1d9462
movq $0x0, 0x50(%rsp)
movq $0x0, 0x40(%rsp)
movq 0xd8(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0xc0(%rsp), %rsi
callq 0xe0f20
movq %rax, 0x68(%rsp)
cmpq $0x0, 0x68(%rsp)
jne 0x1d9015
movq 0x462fbc(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33d025(%rip), %rsi    # 0x516013
leaq 0x373e3d(%rip), %rdx    # 0x54ce32
leaq 0x38cc92(%rip), %rcx    # 0x565c8e
leaq 0x38cc66(%rip), %r8     # 0x565c69
movl $0xd4, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9017
jmp 0x1d9019
movq 0xa8(%rsp), %rax
cmpq 0x70(%rsp), %rax
jae 0x1d9060
movq 0x462f71(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33cfda(%rip), %rsi    # 0x516013
leaq 0x38cc71(%rip), %rdx    # 0x565cb1
leaq 0x38cc47(%rip), %rcx    # 0x565c8e
leaq 0x38cc1b(%rip), %r8     # 0x565c69
movl $0xd5, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9062
movq 0xa8(%rsp), %rax
subq 0x70(%rsp), %rax
addq 0x80(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpl $0x1, 0x94(%rsp)
jne 0x1d90a7
movq 0x68(%rsp), %rdi
callq 0x192b0
subq 0x80(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x1d90a9
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x68(%rsp), %rdi
callq 0x192b0
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jb 0x1d9105
movq 0x462ecc(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33cf35(%rip), %rsi    # 0x516013
leaq 0x38cbeb(%rip), %rdx    # 0x565cd0
leaq 0x38cba2(%rip), %rcx    # 0x565c8e
leaq 0x38cb76(%rip), %r8     # 0x565c69
movl $0xd9, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9107
movq 0x68(%rsp), %rax
movq 0x80(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x67(%rsp)
movq 0xf0(%rsp), %rdi
leaq 0x37a1bc(%rip), %rsi    # 0x5532e6
callq 0x16c040
movq %rax, %rdi
callq 0xa2db0
movq %rax, 0x40(%rsp)
movq %rax, 0x88(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x1d9239
cmpq $0x0, 0x88(%rsp)
je 0x1d9239
movq 0xc0(%rsp), %rdi
callq 0x16cc70
cmpl $0x1, %eax
jne 0x1d91d3
movb 0x67(%rsp), %al
movq 0xe8(%rsp), %rdx
leaq 0x67(%rsp), %rdi
movsbl %al, %esi
callq 0x481260
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
je 0x1d91cf
movq 0x462e02(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33ce6b(%rip), %rsi    # 0x516013
leaq 0x376ab0(%rip), %rdx    # 0x54fc5f
leaq 0x38cad8(%rip), %rcx    # 0x565c8e
leaq 0x38caac(%rip), %r8     # 0x565c69
movl $0xe1, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d91d1
jmp 0x1d91d3
jmp 0x1d91d5
movsbl 0x67(%rsp), %edi
callq 0x19dd0
movl %eax, 0x1c(%rsp)
movq 0x88(%rsp), %rax
movsbl (%rax), %edi
callq 0x19dd0
movl %eax, %ecx
movl 0x1c(%rsp), %eax
cmpl %ecx, %eax
je 0x1d9235
movq 0x462d9c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33ce05(%rip), %rsi    # 0x516013
leaq 0x38cad5(%rip), %rdx    # 0x565cea
leaq 0x38ca72(%rip), %rcx    # 0x565c8e
leaq 0x38ca46(%rip), %r8     # 0x565c69
movl $0xe3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9237
jmp 0x1d9239
movq 0xf0(%rsp), %rdi
leaq 0x37a0ac(%rip), %rsi    # 0x5532f4
callq 0x16c040
movq %rax, %rdi
callq 0xa2db0
movq %rax, 0x50(%rsp)
movq %rax, 0x58(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x1d9460
cmpq $0x0, 0x58(%rsp)
je 0x1d9460
movq $0x0, 0x30(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xe4(%rsp)
movb %al, 0x1b(%rsp)
jne 0x1d92bf
movq 0x58(%rsp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3b, %ecx
movb %al, 0x1a(%rsp)
je 0x1d92b7
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x1a(%rsp)
movb 0x1a(%rsp), %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
testb $0x1, %al
jne 0x1d92cc
jmp 0x1d9434
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x1d9400
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
movsbl 0x67(%rsp), %ecx
cmpl %ecx, %eax
je 0x1d9400
movq 0x58(%rsp), %rax
movb (%rax), %al
movb %al, 0x2f(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0x1d9319
movq 0x88(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0x14(%rsp)
jmp 0x1d9324
movl $0x2d, %eax
movl %eax, 0x14(%rsp)
jmp 0x1d9324
movl 0x14(%rsp), %eax
movb %al, 0x2e(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x1d9360
cmpl $0x1, 0x94(%rsp)
jne 0x1d9360
movb 0x2e(%rsp), %al
movq 0xe8(%rsp), %rdx
leaq 0x2e(%rsp), %rdi
movsbl %al, %esi
callq 0x481260
movl %eax, 0xe4(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x1d9394
cmpl $0x1, 0x94(%rsp)
jne 0x1d9394
movb 0x2f(%rsp), %al
movq 0xe8(%rsp), %rdx
leaq 0x2f(%rsp), %rdi
movsbl %al, %esi
callq 0x481260
movl %eax, 0xe4(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x1d93fe
movq 0xd8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0xf0(%rsp), %rdx
movq 0x80(%rsp), %rcx
movq 0x30(%rsp), %r8
movq %r8, %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movb 0x2f(%rsp), %r9b
movb 0x2e(%rsp), %r10b
movq 0xe8(%rsp), %rax
movsbl %r9b, %r9d
movsbl %r10b, %r10d
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1d9ae0
movl %eax, 0xe4(%rsp)
jmp 0x1d9421
movq 0x58(%rsp), %rax
movsbl (%rax), %eax
movsbl 0x67(%rsp), %ecx
cmpl %ecx, %eax
jne 0x1d941f
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x1d9421
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x1d9282
movq 0x50(%rsp), %rdi
leaq 0x38c829(%rip), %rsi    # 0x565c69
movl $0x105, %edx            # imm = 0x105
callq 0xe88c0
movq 0x40(%rsp), %rdi
leaq 0x38c813(%rip), %rsi    # 0x565c69
movl $0x106, %edx            # imm = 0x106
callq 0xe88c0
jmp 0x1d947c
leaq 0x70(%rsp), %rdi
callq 0x107320
addq 0x80(%rsp), %rax
movq %rax, 0x80(%rsp)
jmp 0x1d947e
jmp 0x1d8f17
movq 0xc8(%rsp), %rdi
callq 0x170f50
jmp 0x1d8e86
movq 0xd0(%rsp), %rdi
callq 0x170f50
movl 0xe4(%rsp), %eax
movl %eax, 0x104(%rsp)
movl 0x104(%rsp), %eax
addq $0x108, %rsp            # imm = 0x108
retq
nop