// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/editscript.c
// Function: gt_editscript_get_sub_sequence_v
GtUword gt_editscript_get_sub_sequence_v(const GtEditscript *editscript,
                                         const GtEncseq *encseq,
                                         GtUword start,
                                         GtReadmode dir,
                                         GtUword vfrompos,
                                         GtUword vtopos,
                                         GtUchar *buffer)
{
  GtEditscriptPos pos;
  GtBitsequence elem = 0;
  GtUword vidx = 0,
          uidx,
          bufidx = 0;
  uint32_t j, elems_served = 0,
           matchcount;

  editscript_pos_reset(&pos);

  gt_assert(encseq != NULL && editscript != NULL);

  uidx = start;

  if (editscript->num_elems != 0) {
    bool mismatch_or_deletion;
    elem = editscript_space_get_next(editscript, &pos);
    elems_served++;
    while (elems_served < editscript->num_elems && vidx <= vtopos) {
      gt_assert(elem <= GT_EDITSCRIPT_INS_SYM(editscript));
      matchcount = (uint32_t) editscript_space_get_length(editscript, &pos,
                                                          &elems_served);
      for (j = 0; vidx <= vtopos && j < matchcount; ++j) {
        if (vidx >= vfrompos) {
          buffer[bufidx++] =
            gt_encseq_get_encoded_char(encseq, uidx, dir);
        }
        vidx++;
        uidx++;
      }
      mismatch_or_deletion = elem == GT_EDITSCRIPT_MISDEL_SYM(editscript);
      while (elems_served < editscript->num_elems && vidx <= vtopos) {
        elem = editscript_space_get_next(editscript, &pos);
        elems_served++;
        if (elem > (GtBitsequence) editscript->del) {
          break;
        }
        if (elem < (GtBitsequence) editscript->del) {
          if (vidx >= vfrompos) {
            buffer[bufidx++] =
              (elem == (GtBitsequence) editscript->del - 1) ?
              (GtUchar) GT_WILDCARD :
              (GtUchar) elem;
          }
          vidx++;
        }
        if (mismatch_or_deletion) uidx++;
      }
    }
  }
  for (j = 0;
       vidx <= vtopos && j < (uint32_t) editscript->trailing_matches;
       ++j) {
    if (vidx >= vfrompos) {
      buffer[bufidx++] = gt_encseq_get_encoded_char(encseq, uidx, dir);
    }
    vidx++;
    uidx++;
  }
  gt_assert(vidx == vtopos + 1);
  gt_assert(bufidx == vtopos - vfrompos + 1);
  return(bufidx);
}

// Assembly:
subq $0x78, %rsp
movq 0x80(%rsp), %rax
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movl %ecx, 0x5c(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x18(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x15ad60
cmpq $0x0, 0x68(%rsp)
je 0x15bde6
cmpq $0x0, 0x70(%rsp)
jne 0x15be1e
movq 0x4e01b3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3ba21c(%rip), %rsi    # 0x516013
leaq 0x3f1e37(%rip), %rdx    # 0x54dc35
leaq 0x3f1f00(%rip), %rcx    # 0x54dd05
leaq 0x3f1c0c(%rip), %r8     # 0x54da18
movl $0x274, %r9d            # imm = 0x274
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15be20
movq 0x60(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x70(%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x15c0b6
movq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x38(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %ecx
movq 0x70(%rsp), %rdx
xorl %eax, %eax
cmpl 0xc(%rdx), %ecx
movb %al, 0x12(%rsp)
jae 0x15be7d
movq 0x30(%rsp), %rax
cmpq 0x48(%rsp), %rax
setbe %al
movb %al, 0x12(%rsp)
movb 0x12(%rsp), %al
testb $0x1, %al
jne 0x15be8a
jmp 0x15c0b4
jmp 0x15be8c
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x2, %rcx
cmpq %rcx, %rax
jbe 0x15bedb
movq 0x4e00f6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3ba15f(%rip), %rsi    # 0x516013
leaq 0x3f1e05(%rip), %rdx    # 0x54dcc0
leaq 0x3f1e43(%rip), %rcx    # 0x54dd05
leaq 0x3f1b4f(%rip), %r8     # 0x54da18
movl $0x27d, %r9d            # imm = 0x27D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15bedd
movq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x15ae90
movl %eax, 0x14(%rsp)
movl $0x0, 0x1c(%rsp)
movq 0x30(%rsp), %rcx
xorl %eax, %eax
cmpq 0x48(%rsp), %rcx
movb %al, 0x11(%rsp)
ja 0x15bf1e
movl 0x1c(%rsp), %eax
cmpl 0x14(%rsp), %eax
setb %al
movb %al, 0x11(%rsp)
movb 0x11(%rsp), %al
testb $0x1, %al
jne 0x15bf28
jmp 0x15bf91
movq 0x30(%rsp), %rax
cmpq 0x50(%rsp), %rax
jb 0x15bf65
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl 0x5c(%rsp), %edx
callq 0xa9da0
movb %al, %dl
movq 0x80(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x20(%rsp)
movb %dl, (%rax,%rcx)
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x15befd
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
addq $0x1, %rcx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, 0x13(%rsp)
movl 0x18(%rsp), %ecx
movq 0x70(%rsp), %rdx
xorl %eax, %eax
cmpl 0xc(%rdx), %ecx
movb %al, 0x10(%rsp)
jae 0x15bfd4
movq 0x30(%rsp), %rax
cmpq 0x48(%rsp), %rax
setbe %al
movb %al, 0x10(%rsp)
movb 0x10(%rsp), %al
testb $0x1, %al
jne 0x15bfe1
jmp 0x15c0af
movq 0x70(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x15ad80
movq %rax, 0x38(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
cmpq %rcx, %rax
jbe 0x15c018
jmp 0x15c0af
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
cmpq %rcx, %rax
jae 0x15c095
movq 0x30(%rsp), %rax
cmpq 0x50(%rsp), %rax
jb 0x15c087
movq 0x38(%rsp), %rax
movq 0x70(%rsp), %rcx
movzbl 0x14(%rcx), %ecx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x15c059
movl $0xfe, %eax
movl %eax, 0xc(%rsp)
jmp 0x15c065
movq 0x38(%rsp), %rax
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movb %al, %dl
movq 0x80(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x20(%rsp)
movb %dl, (%rax,%rcx)
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
testb $0x1, 0x13(%rsp)
je 0x15c0aa
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x15bfaf
jmp 0x15be58
jmp 0x15c0b6
movl $0x0, 0x1c(%rsp)
movq 0x30(%rsp), %rcx
xorl %eax, %eax
cmpq 0x48(%rsp), %rcx
movb %al, 0xb(%rsp)
ja 0x15c0e3
movl 0x1c(%rsp), %eax
movq 0x70(%rsp), %rcx
cmpl 0x10(%rcx), %eax
setb %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x15c0ed
jmp 0x15c156
movq 0x30(%rsp), %rax
cmpq 0x50(%rsp), %rax
jb 0x15c12a
movq 0x68(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl 0x5c(%rsp), %edx
callq 0xa9da0
movb %al, %dl
movq 0x80(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x20(%rsp)
movb %dl, (%rax,%rcx)
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x15c0be
jmp 0x15c158
movq 0x30(%rsp), %rax
movq 0x48(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x15c1a3
movq 0x4dfe2e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b9e97(%rip), %rsi    # 0x516013
leaq 0x3f1ba3(%rip), %rdx    # 0x54dd26
leaq 0x3f1b7b(%rip), %rcx    # 0x54dd05
leaq 0x3f1887(%rip), %r8     # 0x54da18
movl $0x2a5, %r9d            # imm = 0x2A5
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15c1a5
jmp 0x15c1a7
movq 0x20(%rsp), %rax
movq 0x48(%rsp), %rcx
subq 0x50(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x15c1f7
movq 0x4dfdda(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b9e43(%rip), %rsi    # 0x516013
leaq 0x3f1b62(%rip), %rdx    # 0x54dd39
leaq 0x3f1b27(%rip), %rcx    # 0x54dd05
leaq 0x3f1833(%rip), %r8     # 0x54da18
movl $0x2a6, %r9d            # imm = 0x2A6
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15c1f9
movq 0x20(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)