// File: /workspace/github_c_makefile_star2_O1/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 0x13e045
movq %rsi, %r15
testq %rsi, %rsi
je 0x13e045
movq 0x8(%rsp), %rdi
callq 0xf02da
movq %rax, %rdi
callq 0x13ddf8
leaq 0x30(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq %rax, %rsi
callq 0x13e04a
movq %r15, %rdi
callq 0x169f71
testq %rax, %rax
je 0x13dfda
movq %rax, %rsi
xorl %ebp, %ebp
leaq 0x24685d(%rip), %r14    # 0x384780
leaq 0x30(%rsp), %rbx
movq %r15, 0x20(%rsp)
decq %rsi
movq %r15, %rdi
movq %rsi, 0x28(%rsp)
callq 0x169f76
testq %rdx, %rdx
je 0x13dfc7
movl %eax, %r15d
movq %rdx, %r13
movl %eax, %r12d
cmpl $0x4, %r15d
ja 0x13dfc2
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 0xec1f8
incq %rbp
movzbl %al, %esi
jmp 0x13dfba
movq 0x10(%rsp), %rax
leaq (%rax,%rbp), %rsi
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %edx
callq 0xec1f8
incq %rbp
movzbl %al, %esi
movq %rbx, %rdi
callq 0x13e216
jmp 0x13dfc2
incq %rbp
movq %rbx, %rdi
callq 0x13e08c
jmp 0x13dfc2
movq 0x30(%rsp), %rax
movzbl 0x14(%rax), %esi
movq %rbx, %rdi
callq 0x13e0aa
decq %r13
jne 0x13df4f
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
movq 0x20(%rsp), %r15
jne 0x13df2d
movq 0x18(%rsp), %rbx
cmpl $0x0, 0xc(%rbx)
je 0x13e011
movq (%rbx), %rdi
movl 0x38(%rsp), %esi
incl %esi
shlq $0x3, %rsi
leaq 0x24688f(%rip), %rdx    # 0x384888
movl $0x140, %ecx            # imm = 0x140
callq 0x1094e6
movq %rax, (%rbx)
movl 0x38(%rsp), %eax
incl %eax
movl %eax, 0x8(%rbx)
jmp 0x13e033
movl $0x0, 0x8(%rbx)
movq (%rbx), %rdi
leaq 0x246866(%rip), %rsi    # 0x384888
movl $0x145, %edx            # imm = 0x145
callq 0x109670
movq $0x0, (%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x40682