// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/alignment.c
// Function: gt_alignment_eval_generic_with_score
static GtWord gt_alignment_eval_generic_with_score(bool mapped,
                                            bool downcase,
                                            const GtUchar *characters,
                                            const GtAlignment *alignment,
                                            const GtScoreMatrix *scorematrix,
                                            GtWord matchscore,
                                            GtWord mismatchscore,
                                            GtWord gapscore)
{
  GtUword i, j, idx_u = 0, idx_v = 0, meoplen;
  GtWord sumscore = 0;
  GtMultieop meop;

  gt_assert(alignment != NULL && (!mapped || !downcase));
  if (gt_alignment_get_length(alignment) == 0)
  {
    return 0;
  }
#ifndef NDEBUG
  gt_assert(gt_alignment_is_valid(alignment));
#endif

  meoplen = gt_multieoplist_get_num_entries(alignment->eops);
  for (i = meoplen; i > 0; i--) {
    meop = gt_multieoplist_get_entry(alignment->eops, i - 1);
    switch (meop.type) {
      case Mismatch:
      case Match:
      case Replacement:
        for (j = 0; j < meop.steps; j++) {
          GtUchar a = alignment->u[idx_u],
                  b = alignment->v[idx_v];
          if (mapped)
          {
            if (scorematrix != NULL)
            {
              sumscore += gt_score_matrix_get_score(scorematrix, a, b);
            } else
            {
              sumscore += (GT_ISSPECIAL(a) || GT_ISSPECIAL(b) ||
                           characters[a] != characters[b]) ? mismatchscore
                                                           : matchscore;
            }
          }
          else
          {
            if (downcase)
            {
              a = tolower((int) a);
              b = tolower((int) b);
            }
            sumscore += ((a != b) ? mismatchscore : matchscore);
          }
          idx_u++;
          idx_v++;
        }
        break;
      case Deletion:
        sumscore += gapscore * meop.steps;
        idx_u += meop.steps;
        break;
      case Insertion:
        sumscore += gapscore * meop.steps;
        idx_v += meop.steps;
        break;
    }
  }
  return sumscore;
}

// Assembly:
subq $0xa8, %rsp
movb %sil, %al
movb %dil, %sil
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rdi
andb $0x1, %sil
movb %sil, 0x9f(%rsp)
andb $0x1, %al
movb %al, 0x9e(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq %r9, 0x78(%rsp)
movq $0x0, 0x60(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x48(%rsp)
cmpq $0x0, 0x88(%rsp)
je 0x12aab9
testb $0x1, 0x9f(%rsp)
je 0x12aaf1
testb $0x1, 0x9e(%rsp)
je 0x12aaf1
movq 0x5114e0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3eb549(%rip), %rsi    # 0x516013
leaq 0x41c5b2(%rip), %rdx    # 0x547083
leaq 0x41c80f(%rip), %rcx    # 0x5472e7
leaq 0x41c369(%rip), %r8     # 0x546e48
movl $0x115, %r9d            # imm = 0x115
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x12aaf3
movq 0x88(%rsp), %rdi
callq 0x12a1b0
cmpq $0x0, %rax
jne 0x12ab17
movq $0x0, 0xa0(%rsp)
jmp 0x12adda
jmp 0x12ab19
movq 0x88(%rsp), %rdi
callq 0x12a910
testb $0x1, %al
jne 0x12ab62
movq 0x51146f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3eb4d8(%rip), %rsi    # 0x516013
leaq 0x41c587(%rip), %rdx    # 0x5470c9
leaq 0x41c79e(%rip), %rcx    # 0x5472e7
leaq 0x41c2f8(%rip), %r8     # 0x546e48
movl $0x11b, %r9d            # imm = 0x11B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x12ab64
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x1b0390
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, 0x70(%rsp)
jbe 0x12adcd
movq 0x88(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x70(%rsp), %rsi
decq %rsi
callq 0x1b03a0
movl %eax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movups 0x20(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movl 0x30(%rsp), %eax
movl %eax, 0x18(%rsp)
subl $0x3, %eax
jb 0x12abec
jmp 0x12abcb
movl 0x18(%rsp), %eax
subl $0x3, %eax
je 0x12ad68
jmp 0x12abda
movl 0x18(%rsp), %eax
subl $0x4, %eax
je 0x12ad91
jmp 0x12adb8
movq $0x0, 0x68(%rsp)
movq 0x68(%rsp), %rax
cmpq 0x38(%rsp), %rax
jae 0x12ad66
movq 0x88(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x60(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x1f(%rsp)
movq 0x88(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x58(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0x1e(%rsp)
testb $0x1, 0x9f(%rsp)
je 0x12acdb
cmpq $0x0, 0x80(%rsp)
je 0x12ac73
movq 0x80(%rsp), %rdi
movzbl 0x1f(%rsp), %esi
movzbl 0x1e(%rsp), %edx
callq 0x10f680
cltq
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x12acd9
movzbl 0x1f(%rsp), %eax
cmpl $0xfe, %eax
jge 0x12acb1
movzbl 0x1e(%rsp), %eax
cmpl $0xfe, %eax
jge 0x12acb1
movq 0x90(%rsp), %rax
movzbl 0x1f(%rsp), %ecx
movzbl (%rax,%rcx), %eax
movq 0x90(%rsp), %rcx
movzbl 0x1e(%rsp), %edx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x12acc0
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x12acca
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x12ad37
testb $0x1, 0x9e(%rsp)
je 0x12ad01
movzbl 0x1f(%rsp), %edi
callq 0x19a20
movb %al, 0x1f(%rsp)
movzbl 0x1e(%rsp), %edi
callq 0x19a20
movb %al, 0x1e(%rsp)
movzbl 0x1f(%rsp), %eax
movzbl 0x1e(%rsp), %ecx
cmpl %ecx, %eax
je 0x12ad1e
movq 0xb0(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x12ad28
movq 0x78(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x12abf5
jmp 0x12adb8
movq 0xb8(%rsp), %rax
imulq 0x38(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rax
addq 0x60(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x12adb8
movq 0xb8(%rsp), %rax
imulq 0x38(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x38(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
jmp 0x12adba
movq 0x70(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x12ab84
movq 0x48(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
addq $0xa8, %rsp
retq
nopw (%rax,%rax)