// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/editscript.c
// Function: gt_editscript_get_stats
void gt_editscript_get_stats(const GtEditscript *editscript,
                             GtUword *match,
                             GtUword *mismatch,
                             GtUword *insertion,
                             GtUword *deletion)
{
  uint32_t elems_served = 0;
  bool misdel = true; /* shut up scan-build */
  GtBitsequence elem;
  GtEditscriptPos getpos;

  gt_assert(editscript != NULL);

  editscript_pos_reset(&getpos);
  *match = *mismatch = *insertion = *deletion = 0;
  if (editscript->num_elems != 0) {
    elem = editscript_space_get_next(editscript, &getpos);
    gt_assert(editscript->del < (uint8_t) elem);
    elems_served++;
    if (elem == GT_EDITSCRIPT_MISDEL_SYM(editscript)) {
      misdel = true;
    }
    else if (elem == GT_EDITSCRIPT_INS_SYM(editscript)) {
      misdel = false;
    }
    (*match) += editscript_space_get_length(editscript, &getpos, &elems_served);
    while (elems_served < editscript->num_elems) {
      elem = editscript_space_get_next(editscript, &getpos);
      elems_served++;
      if (elem == GT_EDITSCRIPT_MISDEL_SYM(editscript)) {
        misdel = true;
        (*match) += editscript_space_get_length(editscript, &getpos,
                                                &elems_served);
      }
      else if (elem == GT_EDITSCRIPT_INS_SYM(editscript)) {
        misdel = false;
        (*match) += editscript_space_get_length(editscript, &getpos,
                                                &elems_served);
      }
      else {
        if (misdel) {
          if (elem == (GtBitsequence) editscript->del)
            (*deletion)++;
          else
            (*mismatch)++;
        }
        else
          (*insertion)++;
      }
    }
    gt_assert(elems_served == editscript->num_elems);
  }
  (*match) += editscript->trailing_matches;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rdi, %rdi
je 0x137e98
movq %rsi, %rbx
movq %rdi, %r14
movl $0x0, 0x8(%rsp)
xorl %eax, %eax
movq %rax, (%r8)
movq %rax, (%rcx)
movq %rax, (%rdx)
movq %rax, (%rsi)
movl 0xc(%rdi), %r12d
testl %r12d, %r12d
je 0x137e7f
movq %rcx, 0x30(%rsp)
movq (%r14), %r13
movq (%r13), %rsi
movzbl 0x15(%r14), %r15d
movl $0x40, %ebp
movl $0x40, %eax
cmpl $0x41, %r15d
jb 0x137d19
movl $0x1, 0x8(%rsp)
movl $0x80, %eax
movq %rdx, 0x28(%rsp)
movq %r8, 0x38(%rsp)
subl %r15d, %eax
movl %r15d, %ecx
negl %ecx
shrq %cl, %rsi
movl %eax, 0xc(%rsp)
movzbl 0x14(%r14), %ecx
movq %rsi, 0x20(%rsp)
movzbl %sil, %eax
movq %rcx, 0x18(%rsp)
cmpl %ecx, %eax
jbe 0x137e9d
leaq 0x4(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x137ea7
movq %rbx, 0x10(%rsp)
movq %rax, (%rbx)
leaq 0x4(%rsp), %rax
movl (%rax), %esi
cmpl %r12d, %esi
jae 0x137e72
subl %r15d, %ebp
movq 0x18(%rsp), %rax
leaq 0x1(%rax), %rbx
leaq 0x2(%rax), %rcx
movq 0x20(%rsp), %rdx
cmpq %rbx, %rdx
sete %al
movq %rcx, 0x40(%rsp)
cmpq %rcx, %rdx
setne %dl
orb %al, %dl
movl 0x8(%rsp), %r8d
movl 0xc(%rsp), %eax
testl %eax, %eax
jne 0x137dbf
incl %r8d
movl %r8d, 0x8(%rsp)
movl $0x40, %eax
movl %r8d, %ecx
movq (%r13,%rcx,8), %rdi
movl %eax, %ecx
negb %cl
shlq %cl, %rdi
cmpl %r15d, %eax
jae 0x137deb
incl %r8d
movl %r8d, 0x8(%rsp)
movq (%r13,%r8,8), %r8
movl %eax, %ecx
shrq %cl, %r8
orq %r8, %rdi
addl $0x40, %eax
subl %r15d, %eax
movl %ebp, %ecx
shrq %cl, %rdi
movl %eax, 0xc(%rsp)
incl %esi
movl %esi, 0x4(%rsp)
cmpq %rbx, %rdi
jne 0x137e18
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
callq 0x137ea7
movb $0x1, %dl
jmp 0x137e33
cmpq 0x40(%rsp), %rdi
jne 0x137e4a
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
callq 0x137ea7
xorl %edx, %edx
movq 0x10(%rsp), %rcx
addq %rax, (%rcx)
movl 0x4(%rsp), %esi
cmpl %r12d, %esi
jb 0x137da5
jmp 0x137e72
movl $0x1, %eax
testb $0x1, %dl
je 0x137e69
movq 0x38(%rsp), %rcx
cmpq 0x18(%rsp), %rdi
je 0x137e65
movq 0x28(%rsp), %rcx
movb $0x1, %dl
jmp 0x137e38
xorl %edx, %edx
movq 0x30(%rsp), %rcx
jmp 0x137e38
cmpl %r12d, %esi
jne 0x137ea2
movq 0x10(%rsp), %rbx
movq (%rbx), %rax
movl 0x10(%r14), %ecx
addq %rax, %rcx
movq %rcx, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3fd9a
callq 0x3fd28
callq 0x3fd61