// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/snp_annotator_visitor.c
// Function: snp_annotator_classify_snp
static int snp_annotator_classify_snp(GtSNPAnnotatorVisitor *sav,
                                      GtFeatureNode *mRNA,
                                      GtFeatureNode *snp,
                                      GtUword variant_pos,
                                      GtUword variant_idx,
                                      char variant_char,
#ifndef NDEBUG
                                      GT_UNUSED char reference_char,
#endif
                                      GT_UNUSED GtError *err)
{
  int had_err = 0;
  char *mrnaseq;
  const char *variant_effect = NULL;
  gt_assert(mRNA && snp && sav);
  gt_log_log("processing variant char %c for SNP %s\n",
               variant_char, gt_feature_node_get_attribute(snp, "Dbxref"));
  mrnaseq = gt_hashmap_get(sav->rnaseqs, mRNA);
  gt_assert(mrnaseq);
  if (mrnaseq) {
    char codon[3],
         variant_codon[3];
    GtStr *effect_string;
    char oldamino,
         newamino;
    GT_UNUSED GtUword mrnalen;
    GtUword startpos = variant_pos / GT_CODON_LENGTH,
                  variantoffset = variant_pos % GT_CODON_LENGTH;
    mrnalen = strlen(mrnaseq);
    gt_assert(variant_pos < mrnalen);
    variant_codon[0] = codon[0] = mrnaseq[3*startpos];
    variant_codon[1] = codon[1] = mrnaseq[3*startpos+1];
    variant_codon[2] = codon[2] = mrnaseq[3*startpos+2];
    variant_codon[variantoffset] = variant_char;
#ifndef NDEBUG
    gt_assert(toupper(codon[variantoffset]) == toupper(reference_char));
#endif
    if (gt_trans_table_is_stop_codon(sav->tt, codon[0], codon[1], codon[2])) {
      if (gt_trans_table_is_stop_codon(sav->tt, variant_codon[0],
                                       variant_codon[1], variant_codon[2])) {
        variant_effect = gt_symbol(GT_SNP_SYNONYMOUS_STOP_EFFECT);
      } else {
        variant_effect = gt_symbol(GT_SNP_STOP_LOST_EFFECT);
      }
    } else {
      if (gt_trans_table_is_stop_codon(sav->tt, variant_codon[0],
                                       variant_codon[1], variant_codon[2])) {
        variant_effect = gt_symbol(GT_SNP_NONSENSE_EFFECT);
      } else {
        had_err = gt_trans_table_translate_codon(sav->tt, codon[0], codon[1],
                                                 codon[2], &oldamino, err);
        if (!had_err) {
          had_err = gt_trans_table_translate_codon(sav->tt, variant_codon[0],
                                                   variant_codon[1],
                                                   variant_codon[2],
                                                   &newamino, err);
        }
        if (!had_err) {
          if (newamino == oldamino) {
            variant_effect = gt_symbol(GT_SNP_SYNONYMOUS_AMINO_EFFECT);
          } else {
            variant_effect = gt_symbol(GT_SNP_MISSENSE_EFFECT);
          }
        }
      }
    }
    if (!had_err) {
      const char *var_attrib;
      gt_assert(variant_effect != NULL);
      if ((var_attrib = gt_feature_node_get_attribute(snp,
                                                      GT_GVF_VARIANT_EFFECT))) {
        effect_string = gt_str_new_cstr(var_attrib);
        gt_str_append_cstr(effect_string, ",");
        gt_str_append_cstr(effect_string, variant_effect);
      } else {
        effect_string = gt_str_new_cstr(variant_effect);
      }
      gt_str_append_cstr(effect_string, " ");
      gt_str_append_uword(effect_string, variant_idx);
      gt_str_append_cstr(effect_string, " ");
      gt_str_append_cstr(effect_string, gt_feature_node_get_type(mRNA));
      gt_str_append_cstr(effect_string, " ");
      gt_str_append_cstr(effect_string,
                         gt_feature_node_get_attribute(mRNA, GT_GFF_ID));
      gt_feature_node_set_attribute(snp, GT_GVF_VARIANT_EFFECT,
                                    gt_str_get(effect_string));
      gt_str_reset(effect_string);
      gt_str_delete(effect_string);
    }
  }

  return had_err;
}

// Assembly:
subq $0x98, %rsp
movb %r9b, %al
movq 0xa8(%rsp), %r9
movb 0xa0(%rsp), %r9b
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movb %al, 0x6f(%rsp)
movl $0x0, 0x68(%rsp)
movq $0x0, 0x58(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0x1d9b52
cmpq $0x0, 0x80(%rsp)
je 0x1d9b52
cmpq $0x0, 0x90(%rsp)
jne 0x1d9b8a
movq 0x462447(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33c4b0(%rip), %rsi    # 0x516013
leaq 0x38c1a8(%rip), %rdx    # 0x565d12
leaq 0x38c1b4(%rip), %rcx    # 0x565d25
leaq 0x38c0f1(%rip), %r8     # 0x565c69
movl $0x5a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9b8c
movsbl 0x6f(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x80(%rsp), %rdi
leaq 0x379675(%rip), %rsi    # 0x553219
callq 0x16c040
movl 0x1c(%rsp), %esi
movq %rax, %rdx
leaq 0x38c189(%rip), %rdi    # 0x565d40
movb $0x0, %al
callq 0xe7740
movq 0x90(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x88(%rsp), %rsi
callq 0xe0f20
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x1d9c1c
movq 0x4623b5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33c41e(%rip), %rsi    # 0x516013
leaq 0x38c16b(%rip), %rdx    # 0x565d67
leaq 0x38c122(%rip), %rcx    # 0x565d25
leaq 0x38c05f(%rip), %r8     # 0x565c69
movl $0x5e, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9c1e
cmpq $0x0, 0x60(%rsp)
je 0x1da04b
movq 0x78(%rsp), %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, 0x28(%rsp)
movq 0x60(%rsp), %rdi
callq 0x192b0
movq %rax, 0x38(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x38(%rsp), %rax
jb 0x1d9ca5
movq 0x46232c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33c395(%rip), %rsi    # 0x516013
leaq 0x38c0ea(%rip), %rdx    # 0x565d6f
leaq 0x38c099(%rip), %rcx    # 0x565d25
leaq 0x38bfd6(%rip), %r8     # 0x565c69
movl $0x69, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9ca7
movq 0x60(%rsp), %rax
imulq $0x3, 0x30(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x55(%rsp)
movb %al, 0x52(%rsp)
movq 0x60(%rsp), %rax
imulq $0x3, 0x30(%rsp), %rcx
movb 0x1(%rax,%rcx), %al
movb %al, 0x56(%rsp)
movb %al, 0x53(%rsp)
movq 0x60(%rsp), %rax
imulq $0x3, 0x30(%rsp), %rcx
movb 0x2(%rax,%rcx), %al
movb %al, 0x57(%rsp)
movb %al, 0x54(%rsp)
movb 0x6f(%rsp), %cl
movq 0x28(%rsp), %rax
movb %cl, 0x52(%rsp,%rax)
movq 0x28(%rsp), %rax
movsbl 0x55(%rsp,%rax), %edi
callq 0x19dd0
movl %eax, 0x18(%rsp)
movsbl 0xa0(%rsp), %edi
callq 0x19dd0
movl %eax, %ecx
movl 0x18(%rsp), %eax
cmpl %ecx, %eax
je 0x1d9d5a
movq 0x462277(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33c2e0(%rip), %rsi    # 0x516013
leaq 0x38c04b(%rip), %rdx    # 0x565d85
leaq 0x38bfe4(%rip), %rcx    # 0x565d25
leaq 0x38bf21(%rip), %r8     # 0x565c69
movl $0x6f, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9d5c
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdi
movb 0x55(%rsp), %cl
movb 0x56(%rsp), %al
movsbl %cl, %esi
movsbl %al, %edx
movsbl 0x57(%rsp), %ecx
callq 0x1245e0
testb $0x1, %al
jne 0x1d9d86
jmp 0x1d9dd9
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdi
movb 0x52(%rsp), %cl
movb 0x53(%rsp), %al
movsbl %cl, %esi
movsbl %al, %edx
movsbl 0x54(%rsp), %ecx
callq 0x1245e0
testb $0x1, %al
jne 0x1d9db0
jmp 0x1d9dc3
leaq 0x38c007(%rip), %rdi    # 0x565dbe
callq 0x120930
movq %rax, 0x58(%rsp)
jmp 0x1d9dd4
leaq 0x38c00a(%rip), %rdi    # 0x565dd4
callq 0x120930
movq %rax, 0x58(%rsp)
jmp 0x1d9ecd
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdi
movb 0x52(%rsp), %cl
movb 0x53(%rsp), %al
movsbl %cl, %esi
movsbl %al, %edx
movsbl 0x54(%rsp), %ecx
callq 0x1245e0
testb $0x1, %al
jne 0x1d9e03
jmp 0x1d9e19
leaq 0x38bfd4(%rip), %rdi    # 0x565dde
callq 0x120930
movq %rax, 0x58(%rsp)
jmp 0x1d9ecb
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdi
movb 0x55(%rsp), %dl
movb 0x56(%rsp), %cl
movb 0x57(%rsp), %al
movq 0xa8(%rsp), %r9
leaq 0x47(%rsp), %r8
movsbl %dl, %esi
movsbl %cl, %edx
movsbl %al, %ecx
callq 0x1240c0
movl %eax, 0x68(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x1d9e8e
movq 0x90(%rsp), %rax
movq 0x28(%rax), %rdi
movb 0x52(%rsp), %dl
movb 0x53(%rsp), %cl
movb 0x54(%rsp), %al
movq 0xa8(%rsp), %r9
leaq 0x46(%rsp), %r8
movsbl %dl, %esi
movsbl %cl, %edx
movsbl %al, %ecx
callq 0x1240c0
movl %eax, 0x68(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x1d9ec9
movsbl 0x46(%rsp), %eax
movsbl 0x47(%rsp), %ecx
cmpl %ecx, %eax
jne 0x1d9eb6
leaq 0x38bf40(%rip), %rdi    # 0x565dea
callq 0x120930
movq %rax, 0x58(%rsp)
jmp 0x1d9ec7
leaq 0x38bf40(%rip), %rdi    # 0x565dfd
callq 0x120930
movq %rax, 0x58(%rsp)
jmp 0x1d9ec9
jmp 0x1d9ecb
jmp 0x1d9ecd
cmpl $0x0, 0x68(%rsp)
jne 0x1da049
jmp 0x1d9eda
cmpq $0x0, 0x58(%rsp)
jne 0x1d9f1a
movq 0x4620b7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33c120(%rip), %rsi    # 0x516013
leaq 0x38bf25(%rip), %rdx    # 0x565e1f
leaq 0x38be24(%rip), %rcx    # 0x565d25
leaq 0x38bd61(%rip), %r8     # 0x565c69
movl $0x90, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d9f1c
movq 0x80(%rsp), %rdi
leaq 0x3793e2(%rip), %rsi    # 0x55330d
callq 0x16c040
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x1d9f6c
movq 0x20(%rsp), %rdi
callq 0x11d510
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x39979d(%rip), %rsi    # 0x5736f3
callq 0x11d550
movq 0x48(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x11d550
jmp 0x1d9f7b
movq 0x58(%rsp), %rdi
callq 0x11d510
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x3bb4f8(%rip), %rsi    # 0x59547f
callq 0x11d550
movq 0x48(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x11d930
movq 0x48(%rsp), %rdi
leaq 0x3bb4d8(%rip), %rsi    # 0x59547f
callq 0x11d550
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
movq 0x88(%rsp), %rdi
callq 0x16d430
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x11d550
movq 0x48(%rsp), %rdi
leaq 0x3bb4a5(%rip), %rsi    # 0x59547f
callq 0x11d550
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x88(%rsp), %rdi
leaq 0x3d5ab5(%rip), %rsi    # 0x5afaad
callq 0x16c040
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x11d550
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
callq 0x11dee0
movq 0x10(%rsp), %rdi
movq %rax, %rdx
leaq 0x3792dd(%rip), %rsi    # 0x55330d
callq 0x16d660
movq 0x48(%rsp), %rdi
callq 0x11e110
movq 0x48(%rsp), %rdi
callq 0x11f560
jmp 0x1da04b
movl 0x68(%rsp), %eax
addq $0x98, %rsp
retq
nopw (%rax,%rax)