// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movb $0x1, 0x1b(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x15aada
movq 0x4e14f7(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bb560(%rip), %rsi    # 0x516013
leaq 0x3f318d(%rip), %rdx    # 0x54dc47
leaq 0x3f3016(%rip), %rcx    # 0x54dad7
leaq 0x3f2f50(%rip), %r8     # 0x54da18
movl $0x156, %r9d            # imm = 0x156
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15aadc
leaq 0x8(%rsp), %rdi
callq 0x15ad60
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
movq 0x28(%rsp), %rax
movq $0x0, (%rax)
movq 0x30(%rsp), %rax
movq $0x0, (%rax)
movq 0x38(%rsp), %rax
movq $0x0, (%rax)
movq 0x40(%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x15ad45
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movzbl 0x14(%rax), %eax
movq 0x10(%rsp), %rcx
movzbl %cl, %ecx
cmpl %ecx, %eax
jl 0x15ab86
movq 0x4e144b(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bb4b4(%rip), %rsi    # 0x516013
leaq 0x3f2f89(%rip), %rdx    # 0x54daef
leaq 0x3f2f6a(%rip), %rcx    # 0x54dad7
leaq 0x3f2ea4(%rip), %r8     # 0x54da18
movl $0x15c, %r9d            # imm = 0x15C
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15ab88
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x15abb1
movb $0x1, 0x1b(%rsp)
jmp 0x15abcf
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x2, %rcx
cmpq %rcx, %rax
jne 0x15abcd
movb $0x0, 0x1b(%rsp)
jmp 0x15abcf
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x1c(%rsp), %rdx
callq 0x15ae90
movq %rax, %rcx
movq 0x38(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movl 0x1c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x15acf9
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x15ac65
movb $0x1, 0x1b(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x1c(%rsp), %rdx
callq 0x15ae90
movq %rax, %rcx
movq 0x38(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x15acf4
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x2, %rcx
cmpq %rcx, %rax
jne 0x15aca5
movb $0x0, 0x1b(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x1c(%rsp), %rdx
callq 0x15ae90
movq %rax, %rcx
movq 0x38(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x15acf2
testb $0x1, 0x1b(%rsp)
je 0x15ace1
movq 0x10(%rsp), %rax
movq 0x40(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
cmpq %rcx, %rax
jne 0x15acd0
movq 0x20(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x15acdf
movq 0x30(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x15acf0
movq 0x28(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x15acf2
jmp 0x15acf4
jmp 0x15abf1
jmp 0x15acfb
movl 0x1c(%rsp), %eax
movq 0x40(%rsp), %rcx
cmpl 0xc(%rcx), %eax
je 0x15ad41
movq 0x4e1290(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bb2f9(%rip), %rsi    # 0x516013
leaq 0x3f2def(%rip), %rdx    # 0x54db10
leaq 0x3f2daf(%rip), %rcx    # 0x54dad7
leaq 0x3f2ce9(%rip), %r8     # 0x54da18
movl $0x17d, %r9d            # imm = 0x17D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15ad43
jmp 0x15ad45
movq 0x40(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
movq 0x38(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
addq $0x48, %rsp
retq
nop