// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/editscript.c
// Function: gt_editscript_get_target_subseq_len
GtUword gt_editscript_get_target_subseq_len(const GtEditscript *editscript,
                                            GtUword srcfrom,
                                            GtUword srclen)
{
  GtEditscriptPos pos;
  GtBitsequence elem;
  GtUword upos = 0,
          vlength = 0;
  uint32_t served = 0;

  gt_assert(editscript != NULL);
  editscript_pos_reset(&pos);
  if (editscript->num_elems != 0) {
    elem = editscript_space_get_next(editscript, &pos);
    served++;
    while (upos < srcfrom + srclen &&
           served < editscript->num_elems) {
      GtBitsequence matchlen = editscript_space_get_length(editscript, &pos,
                                                           &served);
      /* add matches */
      if (upos + matchlen > srcfrom) {
        vlength += matchlen;
        /* remove overhang in front */
        if (upos < srcfrom)
          vlength -= srcfrom - upos;
        /* remove overhang at end */
        if (srcfrom + srclen < upos + matchlen)
          vlength -= (upos + matchlen) - (srcfrom + srclen);
      }
      upos += matchlen;
      if (elem == GT_EDITSCRIPT_MISDEL_SYM(editscript)) {
        elem = editscript_space_get_next(editscript, &pos);
        served++;
        while ((elem <= (GtBitsequence) editscript->del) &&
               upos < srcfrom + srclen &&
               served <= editscript->num_elems) {
          if (elem < (GtBitsequence) editscript->del && upos >= srcfrom)
            vlength++;
          upos++;
          elem = editscript_space_get_next(editscript, &pos);
          served++;
        }
      }
      else {
        gt_assert(elem == GT_EDITSCRIPT_INS_SYM(editscript));
        elem = editscript_space_get_next(editscript, &pos);
        served++;
        while (elem <= (GtBitsequence) editscript->del &&
               upos < srcfrom + srclen &&
               served <= editscript->num_elems) {
          gt_assert(elem != (GtBitsequence) editscript->del &&
                    "insertion can not be deletion symbol");
          /* count insertions only within range, not in front */
          if (upos > srcfrom)
            vlength++;
          elem = editscript_space_get_next(editscript, &pos);
          served++;
        }
      }
    }
  }
  if (upos < srcfrom + srclen) {
    vlength += editscript->trailing_matches;
    /* remove overhang in front */
    if (upos < srcfrom)
      vlength -= srcfrom - upos;
    /* remove overhang at end */
    if (srcfrom + srclen < upos + editscript->trailing_matches)
      vlength -= (upos + editscript->trailing_matches) - (srcfrom + srclen);
  }
  return vlength;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x15b39d
movq 0x4e0c34(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bac9d(%rip), %rsi    # 0x516013
leaq 0x3f28ca(%rip), %rdx    # 0x54dc47
leaq 0x3f27ec(%rip), %rcx    # 0x54db70
leaq 0x3f268d(%rip), %r8     # 0x54da18
movl $0x1c9, %r9d            # imm = 0x1C9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15b39f
leaq 0x38(%rsp), %rdi
callq 0x15ad60
movq 0x50(%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x15b710
movq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x30(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x28(%rsp), %rcx
movq 0x48(%rsp), %rdx
addq 0x40(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xf(%rsp)
jae 0x15b404
movl 0x1c(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0xc(%rcx), %eax
setb %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x15b411
jmp 0x15b70e
movq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x1c(%rsp), %rdx
callq 0x15ae90
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
addq 0x10(%rsp), %rax
cmpq 0x48(%rsp), %rax
jbe 0x15b4ac
movq 0x10(%rsp), %rax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x15b46d
movq 0x48(%rsp), %rcx
subq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
addq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
addq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jae 0x15b4aa
movq 0x28(%rsp), %rcx
addq 0x10(%rsp), %rcx
movq 0x48(%rsp), %rax
addq 0x40(%rsp), %rax
subq %rax, %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x20(%rsp)
jmp 0x15b4ac
movq 0x10(%rsp), %rax
addq 0x28(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x15b5ab
movq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x30(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rcx
movq 0x50(%rsp), %rax
movzbl 0x14(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xe(%rsp)
ja 0x15b53d
movq 0x28(%rsp), %rcx
movq 0x48(%rsp), %rdx
addq 0x40(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xe(%rsp)
jae 0x15b53d
movl 0x1c(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0xc(%rcx), %eax
setbe %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x15b547
jmp 0x15b5a6
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
cmpq %rcx, %rax
jae 0x15b574
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jb 0x15b574
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x30(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x15b4f5
jmp 0x15b709
jmp 0x15b5ad
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x2, %rcx
cmpq %rcx, %rax
je 0x15b5fc
movq 0x4e09d5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3baa3e(%rip), %rsi    # 0x516013
leaq 0x3f25b8(%rip), %rdx    # 0x54db94
leaq 0x3f258d(%rip), %rcx    # 0x54db70
leaq 0x3f242e(%rip), %r8     # 0x54da18
movl $0x1eb, %r9d            # imm = 0x1EB
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15b5fe
movq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x30(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rcx
movq 0x50(%rsp), %rax
movzbl 0x14(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xd(%rsp)
ja 0x15b665
movq 0x28(%rsp), %rcx
movq 0x48(%rsp), %rdx
addq 0x40(%rsp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0xd(%rsp)
jae 0x15b665
movl 0x1c(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0xc(%rcx), %eax
setbe %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x15b672
jmp 0x15b707
jmp 0x15b674
movq 0x30(%rsp), %rax
movq 0x50(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
cmpq %rcx, %rax
je 0x15b68f
movb $0x1, %al
testb $0x1, %al
jne 0x15b6c7
jmp 0x15b68f
movq 0x4e090a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3ba973(%rip), %rsi    # 0x516013
leaq 0x3f253c(%rip), %rdx    # 0x54dbe3
leaq 0x3f24c2(%rip), %rcx    # 0x54db70
leaq 0x3f2363(%rip), %r8     # 0x54da18
movl $0x1f2, %r9d            # imm = 0x1F2
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15b6c9
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jbe 0x15b6e3
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x30(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x15b61d
jmp 0x15b709
jmp 0x15b3d7
jmp 0x15b710
movq 0x28(%rsp), %rax
movq 0x48(%rsp), %rcx
addq 0x40(%rsp), %rcx
cmpq %rcx, %rax
jae 0x15b7a8
movq 0x50(%rsp), %rax
movl 0x10(%rax), %eax
addq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x48(%rsp), %rax
jae 0x15b75d
movq 0x48(%rsp), %rcx
subq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
addq 0x40(%rsp), %rax
movq 0x28(%rsp), %rcx
movq 0x50(%rsp), %rdx
movl 0x10(%rdx), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x15b7a6
movq 0x28(%rsp), %rcx
movq 0x50(%rsp), %rax
movl 0x10(%rax), %eax
addq %rax, %rcx
movq 0x48(%rsp), %rax
addq 0x40(%rsp), %rax
subq %rax, %rcx
movq 0x20(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x20(%rsp)
jmp 0x15b7a8
movq 0x20(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)