// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/test-mtrieins.c
// Function: gt_test_trieins
int gt_test_trieins(bool onlyins,const char *indexname,GtError *err)
{
  Suffixarray suffixarray;
  bool haserr = false;
  GtUword totallength = 0;

  gt_error_check(err);
  if (streamsuffixarray(&suffixarray,
                        SARR_ESQTAB,
                        indexname,
                        NULL,
                        err) != 0)
  {
    haserr = true;
  } else
  {
    totallength = gt_encseq_total_length(suffixarray.encseq);
  }
  if (!haserr)
  {
    Mergertrierep trierep;
    const GtUchar *characters;

    trierep.encseqreadinfo = gt_malloc(sizeof *trierep.encseqreadinfo);
    trierep.encseqreadinfo->encseqptr = suffixarray.encseq;
    trierep.encseqreadinfo->readmode = suffixarray.readmode;
    characters
      = gt_alphabet_characters(gt_encseq_alphabet(suffixarray.encseq));
    gt_mergertrie_initnodetable(&trierep,totallength,1U);
    maketrie(&trierep,characters,totallength);
    if (onlyins)
    {
#ifdef WITHTRIEIDENT
#ifdef WITHTRIESHOW
      showtrie(&trierep,characters);
#endif
      checktrie(&trierep,totallength+1,totallength,err);
#endif
    } else
    {
#ifdef WITHTRIEIDENT
#ifdef WITHTRIESHOW
      mergertrie_showallnoderelations(trierep.root);
#endif
#endif
      successivelydeletesmallest(&trierep,totallength,characters,err);
    }
    gt_mergertrie_delete(&trierep);
  }
  gt_freesuffixarray(&suffixarray);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %r14d
testq %rdx, %rdx
je 0x1b479f
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0x1b48a1
xorl %ebx, %ebx
leaq 0x48(%rsp), %rdi
pushq $0x1
popq %rsi
movq %r12, %rdx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x14d283
movl %eax, %ebp
testl %eax, %eax
jne 0x1b4854
movq 0x48(%rsp), %rdi
callq 0x7055e
movq %rax, %r15
leaq 0x1a8225(%rip), %rsi    # 0x35c9f9
pushq $0x10
popq %rdi
pushq $0x63
popq %rdx
callq 0x93160
leaq 0x18(%rsp), %r12
movq %rax, (%r12)
movq 0x48(%rsp), %rdi
movq %rdi, (%rax)
movl 0x90(%rsp), %ecx
movl %ecx, 0x8(%rax)
callq 0x754dd
movq %rax, %rdi
callq 0x56d14
pushq $0x1
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c0fd8
leaq 0x8(%rsp), %r13
andl $0x0, (%r13)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
cmpq %r15, %rax
ja 0x1b4845
movq 0x28(%rsp), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x2c0a88
movq 0x10(%rsp), %rax
incq %rax
jmp 0x1b4821
testb %r14b, %r14b
je 0x1b4876
leaq 0x18(%rsp), %rdi
callq 0x2c1035
leaq 0x48(%rsp), %rdi
callq 0x14d148
negl %ebp
sbbl %ebx, %ebx
movl %ebx, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %r14
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x1b484a
cmpq $0x0, 0x10(%rax)
je 0x1b484a
movq %r14, %rdi
callq 0x2c0ef7
movq %rax, %rdi
movq %r14, %rsi
callq 0x2c0f47
jmp 0x1b487b
movq 0x2836c0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x130761(%rip), %rsi    # 0x2e5013
leaq 0x130906(%rip), %rdx    # 0x2e51bf
leaq 0x1a8129(%rip), %rcx    # 0x35c9e9
leaq 0x1a8132(%rip), %r8     # 0x35c9f9
pushq $0x52
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
nop