// File: /workspace/github_c_makefile_star2_O1/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
movl $0x0, 0xc(%rsp)
testq %rdi, %rdi
je 0x13e592
movq %rsi, %rbx
movq %rdi, %r14
movabsq $0x4000000000, %rax     # imm = 0x4000000000
movq %rax, 0x4(%rsp)
xorl %eax, %eax
movq %rax, (%r8)
movq %rax, (%rcx)
movq %rax, (%rdx)
movq %rax, (%rsi)
movl 0xc(%rdi), %r12d
testl %r12d, %r12d
je 0x13e57c
movq %rdx, 0x28(%rsp)
movq %rcx, 0x30(%rsp)
movq %r8, 0x38(%rsp)
movl 0x4(%rsp), %edx
movl 0x8(%rsp), %eax
movq (%r14), %r13
movq (%r13,%rdx,8), %rsi
movl %eax, %ecx
negb %cl
shlq %cl, %rsi
movzbl 0x15(%r14), %r15d
cmpl %r15d, %eax
jae 0x13e423
incl %edx
movl %edx, 0x4(%rsp)
movq (%r13,%rdx,8), %rdx
movl %eax, %ecx
shrq %cl, %rdx
orq %rdx, %rsi
addl $0x40, %eax
subl %r15d, %eax
movl %r15d, %ecx
negl %ecx
shrq %cl, %rsi
movl %eax, 0x8(%rsp)
movzbl 0x14(%r14), %ecx
movq %rsi, 0x20(%rsp)
movzbl %sil, %eax
movq %rcx, 0x18(%rsp)
cmpl %ecx, %eax
jbe 0x13e597
leaq 0xc(%rsp), %rbp
movl $0x1, (%rbp)
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
movq %rbp, %rdx
callq 0x13e5a1
movq %rbx, 0x10(%rsp)
movq %rax, (%rbx)
movl (%rbp), %esi
cmpl %r12d, %esi
jae 0x13e572
movl $0x40, %ebp
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
cmpl $0x0, 0x8(%rsp)
jne 0x13e4bd
incl 0x4(%rsp)
movl $0x40, 0x8(%rsp)
movl 0x4(%rsp), %r8d
movl 0x8(%rsp), %eax
movq (%r13,%r8,8), %rdi
movl %eax, %ecx
negb %cl
shlq %cl, %rdi
cmpl %r15d, %eax
jae 0x13e4ef
incl %r8d
movl %r8d, 0x4(%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, 0x8(%rsp)
incl %esi
movl %esi, 0xc(%rsp)
cmpq %rbx, %rdi
jne 0x13e51c
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x13e5a1
movb $0x1, %dl
jmp 0x13e537
cmpq 0x40(%rsp), %rdi
jne 0x13e54e
movq %r14, %rdi
leaq 0x4(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x13e5a1
xorl %edx, %edx
movq 0x10(%rsp), %rcx
addq %rax, (%rcx)
movl 0xc(%rsp), %esi
cmpl %r12d, %esi
jb 0x13e4aa
jmp 0x13e572
movl $0x1, %eax
testb $0x1, %dl
je 0x13e56b
movq 0x38(%rsp), %rcx
cmpq 0x18(%rsp), %rdi
je 0x13e53c
movq 0x28(%rsp), %rcx
jmp 0x13e53c
movq 0x30(%rsp), %rcx
jmp 0x13e53c
cmpl %r12d, %esi
movq 0x10(%rsp), %rbx
jne 0x13e59c
movl 0x10(%r14), %eax
addq %rax, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x408f5
callq 0x40883
callq 0x408bc