// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movl %ecx, 0x7c(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0x15a3f9
cmpq $0x0, 0x88(%rsp)
jne 0x15a431
movq 0x4e1ba0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bbc09(%rip), %rsi    # 0x516013
leaq 0x3f3681(%rip), %rdx    # 0x54da92
leaq 0x3f369e(%rip), %rcx    # 0x54dab6
leaq 0x3f35f9(%rip), %r8     # 0x54da18
movl $0x11b, %r9d            # imm = 0x11B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x15a433
movq 0x90(%rsp), %rdi
callq 0xb0f00
movq %rax, %rdi
callq 0x15a240
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x15a670
movq $0x0, 0x70(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1b0390
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x15a5d8
movq 0x88(%rsp), %rdi
movq 0x68(%rsp), %rsi
subq $0x1, %rsi
callq 0x1b03a0
movl %eax, 0x10(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x15a5c3
movl 0x28(%rsp), %eax
movq %rax, 0x8(%rsp)
subq $0x4, %rax
ja 0x15a5ac
movq 0x8(%rsp), %rax
leaq 0x3f3418(%rip), %rcx    # 0x54d910
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x15a740
jmp 0x15a5ae
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
addq 0x70(%rsp), %rsi
movl 0x7c(%rsp), %edx
callq 0xa9da0
movb %al, 0x27(%rsp)
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
leaq 0x38(%rsp), %rdi
movzbl 0x27(%rsp), %esi
callq 0x15a7f0
jmp 0x15a5ae
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
addq 0x70(%rsp), %rsi
movl 0x7c(%rsp), %edx
callq 0xa9da0
movb %al, 0x27(%rsp)
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
leaq 0x38(%rsp), %rdi
movzbl 0x27(%rsp), %esi
callq 0x15a920
jmp 0x15a5ae
leaq 0x38(%rsp), %rdi
callq 0x15aa50
jmp 0x15a5ae
jmp 0x15a5ae
jmp 0x15a5b0
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x15a4c9
jmp 0x15a5c5
movq 0x68(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x15a481
movq 0x50(%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x15a627
movq 0x50(%rsp), %rax
movq (%rax), %rdi
movl 0x40(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
shlq $0x3, %rsi
leaq 0x3f3417(%rip), %rdx    # 0x54da18
movl $0x140, %ecx            # imm = 0x140
callq 0xe8540
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movl 0x40(%rsp), %ecx
addl $0x1, %ecx
movq 0x50(%rsp), %rax
movl %ecx, 0x8(%rax)
jmp 0x15a658
movq 0x50(%rsp), %rax
movl $0x0, 0x8(%rax)
movq 0x50(%rsp), %rax
movq (%rax), %rdi
leaq 0x3f33d6(%rip), %rsi    # 0x54da18
movl $0x145, %edx            # imm = 0x145
callq 0xe88c0
movq 0x50(%rsp), %rax
movq $0x0, (%rax)
movq 0x50(%rsp), %rax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)