// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/editscript.c
// Function: gt_editscript_new_with_sequences
GtEditscript *gt_editscript_new_with_sequences(const GtEncseq *encseq,
                                               GtMultieoplist *multieops,
                                               GtUword start,
                                               GtReadmode dir)
{
  GtUword vlen, idx, meopidx, meoplen;
  GtEditscript *es;
  GtEditscriptBuilder es_b;
  GtMultieop meop;
  GtUchar cchar;

  gt_assert(encseq != NULL && multieops != NULL);
  es = gt_editscript_new(gt_encseq_alphabet(encseq));
  gt_editscript_builder_reset(&es_b, es);

  vlen = 0;

  meoplen = gt_multieoplist_get_num_entries(multieops);

  for (idx = meoplen; idx != 0; idx--) {
    meop = gt_multieoplist_get_entry(multieops, idx - 1);
    for (meopidx = 0; meopidx < meop.steps; meopidx++) {
      switch (meop.type) {
        case Match:
          vlen++;
          gt_editscript_builder_add_match(&es_b);
          break;
        case Replacement:
        case Mismatch:
          cchar = gt_encseq_get_encoded_char(encseq, start + vlen, dir);
          vlen++;
          gt_editscript_builder_add_mismatch(&es_b, cchar);
          break;
        case Insertion:
          cchar = gt_encseq_get_encoded_char(encseq, start + vlen, dir);
          vlen++;
          gt_editscript_builder_add_insertion(&es_b, cchar);
          break;
        case Deletion:
          gt_editscript_builder_add_deletion(&es_b);
          break;
        default:
          break;
      }
    }
  }
  if (es->num_elems != 0) {
    es->space = gt_realloc(es->space,
                           sizeof (*(es->space)) * (es_b.fillpos.cur_word + 1));
    es->size = es_b.fillpos.cur_word + 1;
  }
  else {
    es->size = 0;
    gt_free(es->space);
    es->space = NULL;
  }
  return(es);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, 0x4(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
je 0xce69c
movq %rsi, %r15
testq %rsi, %rsi
je 0xce69c
movq 0x8(%rsp), %rdi
callq 0x754dd
movq %rax, %rdi
callq 0xce410
leaq 0x30(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq %rax, %rsi
callq 0xce6d4
movq %r15, %rdi
callq 0x101b46
xorl %ebp, %ebp
leaq 0x24d22d(%rip), %r14    # 0x31b7b0
leaq 0x30(%rsp), %rbx
movq %r15, 0x20(%rsp)
subq $0x1, %rax
jb 0xce639
movq %r15, %rdi
movq %rax, 0x28(%rsp)
movq %rax, %rsi
callq 0x101b4b
movl %eax, %r15d
movq %rdx, %r13
movl %eax, %r12d
subq $0x1, %r13
jb 0xce62a
cmpl $0x4, %r15d
ja 0xce5b0
movslq (%r14,%r12,4), %rax
addq %r14, %rax
jmpq *%rax
movq 0x10(%rsp), %rax
leaq (%rax,%rbp), %rsi
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %edx
callq 0x705e4
incq %rbp
movzbl %al, %esi
movq %rbx, %rdi
callq 0xce7e6
jmp 0xce5b0
movq 0x10(%rsp), %rax
leaq (%rax,%rbp), %rsi
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %edx
callq 0x705e4
incq %rbp
movzbl %al, %esi
movq %rbx, %rdi
callq 0xce8b7
jmp 0xce5b0
incq %rbp
movq %rbx, %rdi
callq 0xce76c
jmp 0xce5b0
movq %rbx, %rdi
callq 0xce988
jmp 0xce5b0
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rax
jmp 0xce58d
movq 0x18(%rsp), %rbx
cmpl $0x0, 0xc(%rbx)
je 0xce66d
movq (%rbx), %rdi
movl 0x38(%rsp), %esi
incl %esi
shlq $0x3, %rsi
leaq 0x24d260(%rip), %rdx    # 0x31b8b8
movl $0x140, %ecx            # imm = 0x140
callq 0x93472
movl 0x38(%rsp), %ecx
incl %ecx
movl %ecx, 0x8(%rbx)
jmp 0xce687
andl $0x0, 0x8(%rbx)
movq (%rbx), %rdi
leaq 0x24d23d(%rip), %rsi    # 0x31b8b8
movl $0x145, %edx            # imm = 0x145
callq 0x936f9
xorl %eax, %eax
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3698c5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x216966(%rip), %rsi    # 0x2e5013
leaq 0x24d27e(%rip), %rdx    # 0x31b932
leaq 0x24d29b(%rip), %rcx    # 0x31b956
leaq 0x24d1f6(%rip), %r8     # 0x31b8b8
movl $0x11b, %r9d            # imm = 0x11B
xorl %eax, %eax
callq 0x17a50
callq 0x17390