// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/alignment.c
// Function: gt_alignment_eval_generic
GtUword gt_alignment_eval_generic(bool mapped,bool downcase,
                                  const GtAlignment *alignment)
{
  GtUword i, j, idx_u = 0, idx_v = 0, sumcost = 0, meoplen;
  GtMultieop meop;

  gt_assert(alignment != NULL && (!mapped || !downcase));
#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:
        sumcost += meop.steps;
        idx_u += meop.steps;
        idx_v += meop.steps;
        break;
      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 (GT_ISSPECIAL(a) || GT_ISSPECIAL(b) || a != b)
            {
              sumcost++;
            }
          } else
          {
            if (downcase)
            {
              a = tolower((int) a);
              b = tolower((int) b);
            }
            if (a != b)
            {
              sumcost++;
            }
          }
          idx_u++;
          idx_v++;
        }
        break;
      case Deletion:
        sumcost += meop.steps;
        idx_u += meop.steps;
        break;
      case Insertion:
        sumcost += meop.steps;
        idx_v += meop.steps;
        break;
    }
  }
  return sumcost;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r14d
movl %edi, 0xc(%rsp)
testb %r14b, %dil
jne 0xb550e
movq %rdx, %rbx
testq %rdx, %rdx
je 0xb550e
movq %rbx, %rdi
callq 0xb5574
testb %al, %al
je 0xb553c
movq 0x30(%rbx), %rdi
callq 0x101b46
movq %rax, %r12
xorl %edi, %edi
xorl %r8d, %r8d
xorl %r9d, %r9d
movq %rbx, 0x18(%rsp)
movq %r9, (%rsp)
movq %r8, 0x10(%rsp)
subq $0x1, %r12
jb 0xb54fc
movq %rdi, %r15
movq 0x30(%rbx), %rdi
movq %r12, %rsi
callq 0x101b4b
movq %r15, %rdi
cmpl $0x4, %eax
ja 0xb53f5
movq %rdx, %r13
movl %eax, %eax
leaq 0x25fada(%rip), %rcx    # 0x314efc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq %r13, %rdi
addq %r13, (%rsp)
jmp 0xb53f5
xorl %r15d, %r15d
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %r8
movq (%rsp), %r9
cmpq %r15, %r13
je 0xb54d2
movq 0x20(%rbx), %rax
addq %r9, %rax
movb (%r15,%rax), %bpl
movq 0x28(%rbx), %rax
addq %r8, %rax
movb (%r15,%rax), %al
testb %sil, %sil
je 0xb5480
cmpb $-0x2, %bpl
setae %cl
cmpb $-0x2, %al
setae %dl
orb %cl, %dl
cmpb %al, %bpl
setne %al
orb %dl, %al
jmp 0xb54c4
testb %r14b, %r14b
je 0xb54be
movq %rdi, 0x20(%rsp)
movzbl %bpl, %edi
movl %r14d, %ebx
movzbl %al, %r14d
callq 0x17a80
movl %eax, %ebp
movl %r14d, %edi
movl %ebx, %r14d
movq 0x18(%rsp), %rbx
callq 0x17a80
movq (%rsp), %r9
movq 0x10(%rsp), %r8
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
cmpb %al, %bpl
setne %al
movzbl %al, %eax
addq %rax, %rdi
incq %r15
jmp 0xb5444
addq %r13, %r9
jmp 0xb54f4
addq %r13, %rdi
movq (%rsp), %r9
addq %r13, %r9
movq 0x10(%rsp), %r8
jmp 0xb54f4
addq %r13, %rdi
movq 0x10(%rsp), %r8
movq (%rsp), %r9
addq %r13, %r8
jmp 0xb53ec
movq %rdi, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x382a53(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22faf4(%rip), %rsi    # 0x2e5013
leaq 0x25fc25(%rip), %rdx    # 0x31514b
leaq 0x25fc4a(%rip), %rcx    # 0x315177
leaq 0x25f9dc(%rip), %r8     # 0x314f10
movl $0xcd, %r9d
jmp 0xb5568
movq 0x382a25(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x22fac6(%rip), %rsi    # 0x2e5013
leaq 0x25fc3d(%rip), %rdx    # 0x315191
leaq 0x25fc1c(%rip), %rcx    # 0x315177
leaq 0x25f9ae(%rip), %r8     # 0x314f10
movl $0xcf, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390