// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movb %sil, %al
movb %dil, %cl
andb $0x1, %cl
movb %cl, 0x77(%rsp)
andb $0x1, %al
movb %al, 0x76(%rsp)
movq %rdx, 0x68(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x12a68d
testb $0x1, 0x77(%rsp)
je 0x12a6c5
testb $0x1, 0x76(%rsp)
je 0x12a6c5
movq 0x51190c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3eb975(%rip), %rsi    # 0x516013
leaq 0x41c9de(%rip), %rdx    # 0x547083
leaq 0x41ca03(%rip), %rcx    # 0x5470af
leaq 0x41c795(%rip), %r8     # 0x546e48
movl $0xcd, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x12a6c7
jmp 0x12a6c9
movq 0x68(%rsp), %rdi
callq 0x12a910
testb $0x1, %al
jne 0x12a70f
movq 0x5118c2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3eb92b(%rip), %rsi    # 0x516013
leaq 0x41c9da(%rip), %rdx    # 0x5470c9
leaq 0x41c9b9(%rip), %rcx    # 0x5470af
leaq 0x41c74b(%rip), %r8     # 0x546e48
movl $0xcf, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x12a711
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x1b0390
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpq $0x0, 0x60(%rsp)
jbe 0x12a900
movq 0x68(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x60(%rsp), %rsi
decq %rsi
callq 0x1b03a0
movl %eax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
movups 0x10(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movq %rax, (%rsp)
subq $0x4, %rax
ja 0x12a8eb
movq (%rsp), %rax
leaq 0x41c6b4(%rip), %rcx    # 0x546e34
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x28(%rsp), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x28(%rsp), %rax
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x28(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x12a8eb
movq $0x0, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x28(%rsp), %rax
jae 0x12a8ab
movq 0x68(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x50(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0xf(%rsp)
movq 0x68(%rsp), %rax
movq 0x28(%rax), %rax
movq 0x48(%rsp), %rcx
movb (%rax,%rcx), %al
movb %al, 0xe(%rsp)
testb $0x1, 0x77(%rsp)
je 0x12a83b
movzbl 0xf(%rsp), %eax
cmpl $0xfe, %eax
jge 0x12a82b
movzbl 0xe(%rsp), %eax
cmpl $0xfe, %eax
jge 0x12a82b
movzbl 0xf(%rsp), %eax
movzbl 0xe(%rsp), %ecx
cmpl %ecx, %eax
je 0x12a839
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x12a87c
testb $0x1, 0x76(%rsp)
je 0x12a85e
movzbl 0xf(%rsp), %edi
callq 0x19a20
movb %al, 0xf(%rsp)
movzbl 0xe(%rsp), %edi
callq 0x19a20
movb %al, 0xe(%rsp)
movzbl 0xf(%rsp), %eax
movzbl 0xe(%rsp), %ecx
cmpl %ecx, %eax
je 0x12a87a
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x12a87c
movq 0x50(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x12a7c4
jmp 0x12a8eb
movq 0x28(%rsp), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x28(%rsp), %rax
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x12a8eb
movq 0x28(%rsp), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x28(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x12a8ed
movq 0x60(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x12a72e
movq 0x40(%rsp), %rax
addq $0x78, %rsp
retq
nopw (%rax,%rax)