// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/esa-merge.c
// Function: gt_emissionmergedesa_init
int gt_emissionmergedesa_init(Emissionmergedesa *emmesa,
                           const GtStrArray *indexnametab,
                           unsigned int demand,
                           GtLogger *logger,
                           GtError *err)
{
  unsigned int numofindexes;
  bool haserr = false;

  numofindexes = (unsigned int) gt_str_array_size(indexnametab);
  emmesa->buf.nextaccessidx = emmesa->buf.nextstoreidx = 0;
  emmesa->numofindexes = numofindexes;
  emmesa->numofentries = numofindexes;
  emmesa->ident = (uint64_t) numofindexes;
  emmesa->trierep.encseqreadinfo = NULL;
  emmesa->suffixarraytable = gt_malloc(sizeof *emmesa->suffixarraytable
                                       * numofindexes);
  emmesa->nextpostable = gt_malloc(sizeof *emmesa->nextpostable * numofindexes);
  if (inputthesequences(&emmesa->numofchars,
                        emmesa->nextpostable,
                        emmesa->suffixarraytable,
                        indexnametab,
                        demand,
                        logger,
                        err) != 0)
  {
    haserr = true;
  }
  if (!haserr && numofindexes > 1U)
  {
    unsigned int idx;

    emmesa->trierep.encseqreadinfo
      = gt_malloc(sizeof *emmesa->trierep.encseqreadinfo * numofindexes);
    for (idx = 0; idx < numofindexes; idx++)
    {
      emmesa->trierep.encseqreadinfo[idx].encseqptr
        = emmesa->suffixarraytable[idx].encseq;
      emmesa->trierep.encseqreadinfo[idx].readmode
        = emmesa->suffixarraytable[idx].readmode;
    }
    gt_mergertrie_initnodetable(&emmesa->trierep,(GtUword) numofindexes,
                             numofindexes);
    if (insertfirstsuffixes(&emmesa->trierep,
                           emmesa->nextpostable,
                           emmesa->suffixarraytable,
                           numofindexes,
                           err) != 0)
    {
      gt_free(emmesa->trierep.encseqreadinfo);
      emmesa->trierep.encseqreadinfo = NULL;
      haserr = true;
    }
  }
  if (haserr)
  {
    gt_free(emmesa->suffixarraytable);
    gt_free(emmesa->nextpostable);
  }
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbp
movq %rcx, 0x28(%rsp)
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r14
movq %rsi, %rdi
callq 0xae61c
andq $0x0, 0x18(%r14)
movl %eax, 0xc(%r14)
movl %eax, 0x8(%r14)
movq %rax, 0x20(%rsp)
movl %eax, %r15d
movq %r15, (%r14)
andq $0x0, 0x30028(%r14)
movq %r15, %rdi
shlq $0x8, %rdi
leaq 0xd1471(%rip), %rbx     # 0x3822bb
movq %rbx, %rsi
movl $0xf9, %edx
callq 0x93160
movq %rax, 0x30058(%r14)
movq %r15, 0x18(%rsp)
leaq (,%r15,8), %rdi
movq %rbx, %rsi
movl $0xfa, %edx
callq 0x93160
movq %rax, %r15
movq %rax, 0x10(%r14)
movq %r14, 0x8(%rsp)
movq 0x30058(%r14), %r14
testq %rbp, %rbp
je 0x2b0ea0
movq %rbp, %rdi
callq 0x89eb7
testb %al, %al
jne 0x2b1088
movq 0x8(%rsp), %rax
addq $0x30028, %rax          # imm = 0x30028
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
movq %r13, %rdi
callq 0xae61c
cmpq %rax, %rbx
jae 0x2b0f19
movq %r13, %rdi
movq %rbx, %rsi
callq 0xae386
movq %r14, %rdi
movl %r12d, %esi
movq %rax, %rdx
movq 0x28(%rsp), %rcx
movq %rbp, %r8
callq 0x14d283
testl %eax, %eax
jne 0x2b1045
testq %rbx, %rbx
jne 0x2b0f08
movq (%r14), %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x56c8e
movq 0x8(%rsp), %rcx
movl %eax, 0x30060(%rcx)
andq $0x0, (%r15,%rbx,8)
incq %rbx
addq $0x100, %r14            # imm = 0x100
jmp 0x2b0eb2
xorl %eax, %eax
movq 0x20(%rsp), %r14
cmpl $0x2, %r14d
jb 0x2b1079
movq 0x18(%rsp), %rbx
shlq $0x4, %rbx
leaq 0xd1381(%rip), %rsi     # 0x3822bb
movq %rbx, %rdi
movl $0x10a, %edx            # imm = 0x10A
callq 0x93160
movq 0x8(%rsp), %rcx
movq %rax, 0x30028(%rcx)
movq 0x30058(%rcx), %rcx
xorl %edx, %edx
movq %rbp, %r13
cmpq %rdx, %rbx
je 0x2b0f7f
movq (%rcx), %rsi
movq %rsi, (%rax,%rdx)
movl 0x48(%rcx), %esi
movl %esi, 0x8(%rax,%rdx)
addq $0x10, %rdx
addq $0x100, %rcx            # imm = 0x100
jmp 0x2b0f5f
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rbp
movq %rbp, %rsi
movl %r14d, %edx
callq 0x2c0fd8
movq 0x8(%rsp), %rax
movq 0x10(%rax), %r12
movq 0x30058(%rax), %rbx
testq %r13, %r13
je 0x2b0fb9
movq %r13, %rdi
callq 0x89eb7
testb %al, %al
jne 0x2b10b2
addq $0xa0, %rbx
xorl %r14d, %r14d
leaq 0x30(%rsp), %r15
cmpq %r14, %rbp
je 0x2b100a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2b0d4c
testl %eax, %eax
je 0x2b100e
incq (%r12,%r14,8)
movq 0x30(%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x30038(%rax), %rcx
movq 0x10(%rsp), %rdi
movl %r14d, %esi
callq 0x2b0dd6
incq %r14
addq $0x100, %rbx            # imm = 0x100
jmp 0x2b0fc8
xorl %eax, %eax
jmp 0x2b1079
leaq 0xd12f9(%rip), %rsi     # 0x38230e
leaq 0xd129f(%rip), %rbx     # 0x3822bb
pushq $0x64
popq %rcx
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x89dbb
movq 0x10(%rsp), %r14
movq (%r14), %rdi
movq %rbx, %rsi
movl $0x11a, %edx            # imm = 0x11A
callq 0x936f9
andq $0x0, (%r14)
movq 0x8(%rsp), %r14
movq 0x30058(%r14), %rdi
leaq 0xd1263(%rip), %rbx     # 0x3822bb
movq %rbx, %rsi
movl $0x121, %edx            # imm = 0x121
callq 0x936f9
movq 0x10(%r14), %rdi
movq %rbx, %rsi
movl $0x122, %edx            # imm = 0x122
callq 0x936f9
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x186ed9(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x33f7a(%rip), %rsi     # 0x2e5013
leaq 0x3411f(%rip), %rdx     # 0x2e51bf
leaq 0xd12ec(%rip), %rcx     # 0x382393
leaq 0xd120d(%rip), %r8      # 0x3822bb
pushq $0x3a
jmp 0x2b10da
movq 0x186eaf(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x33f50(%rip), %rsi     # 0x2e5013
leaq 0x340f5(%rip), %rdx     # 0x2e51bf
leaq 0xd12d4(%rip), %rcx     # 0x3823a5
leaq 0xd11e3(%rip), %r8      # 0x3822bb
pushq $0x5b
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390