// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/merger-trie.c
// Function: gt_mergertrie_insertsuffix
void gt_mergertrie_insertsuffix(Mergertrierep *trierep,
                             Mergertrienode *node,
                             Suffixinfo *suffixinfo)
{
  if (trierep->root == NULL)
  {
    trierep->root = mtrie_makeroot(trierep,suffixinfo);
  } else
  {
    GtUword currentdepth, lcpvalue, totallength;
    Mergertrienode *currentnode, *newleaf, *newbranch, *succ;
    Nodepair np;
    GtUchar cc;
    Encseqreadinfo *eri = trierep->encseqreadinfo + suffixinfo->idx;

    gt_assert(!MTRIE_ISLEAF(node));
    currentnode = node;
    currentdepth = node->depth;
    totallength = gt_encseq_total_length(eri->encseqptr);
    while (true)
    {
      if (suffixinfo->startpos + currentdepth >= totallength)
      {
        cc = (GtUchar) GT_SEPARATOR;
      } else
      {
        /* Random access */
        cc = gt_encseq_get_encoded_char(eri->encseqptr,
                                            suffixinfo->startpos + currentdepth,
                                            eri->readmode);
      }
      gt_assert(currentnode != NULL);
      gt_assert(!MTRIE_ISLEAF(currentnode));
      if (!hassuccessor(trierep,&np,currentdepth,currentnode,cc,
                        suffixinfo->idx))
      {
        newleaf = mtrie_makenewleaf(trierep,suffixinfo);
        newleaf->rightsibling = np.current;
        SHOWNODERELATIONS(newleaf);
        if (np.previous == NULL)
        {
          SETFIRSTCHILD(currentnode,newleaf);
          SHOWNODERELATIONS(currentnode);
        } else
        {
          np.previous->rightsibling = newleaf;
          SHOWNODERELATIONS(np.previous);
        }
        return;
      }
      succ = np.current;
      if MTRIE_ISLEAF(succ)
      {
        lcpvalue = getlcp(eri->encseqptr,
                          eri->readmode,
                          suffixinfo->startpos + currentdepth + 1,
                          gt_encseq_total_length(eri->encseqptr) - 1,
                          trierep->encseqreadinfo[succ->suffixinfo.idx].
                                encseqptr,
                          trierep->encseqreadinfo[succ->suffixinfo.idx].
                                readmode,
                          succ->suffixinfo.startpos + currentdepth + 1,
                          gt_encseq_total_length(
                              trierep->encseqreadinfo[succ->suffixinfo.idx].
                                        encseqptr) - 1);
        newbranch = mtrie_makenewbranch(trierep,
                                  suffixinfo,
                                  currentdepth + lcpvalue + 1,
                                  succ);
        if (np.previous == NULL)
        {
          SETFIRSTCHILD(currentnode,newbranch);
          SHOWNODERELATIONS(currentnode);
        } else
        {
          np.previous->rightsibling = newbranch;
          SHOWNODERELATIONS(np.previous);
        }
        return;
      }
      lcpvalue = getlcp(eri->encseqptr,
                        eri->readmode,
                        suffixinfo->startpos + currentdepth + 1,
                        gt_encseq_total_length(eri->encseqptr) - 1,
                        trierep->encseqreadinfo[succ->suffixinfo.idx].encseqptr,
                        trierep->encseqreadinfo[succ->suffixinfo.idx].readmode,
                        succ->suffixinfo.startpos + currentdepth + 1,
                        succ->suffixinfo.startpos + succ->depth - 1);
      if (currentdepth + lcpvalue + 1 < succ->depth)
      {
        newbranch = mtrie_makenewbranch(trierep,
                                  suffixinfo,
                                  currentdepth + lcpvalue + 1,
                                  succ);
        if (np.previous == NULL)
        {
          SETFIRSTCHILD(currentnode,newbranch);
          SHOWNODERELATIONS(currentnode);
        } else
        {
          np.previous->rightsibling = newbranch;
          SHOWNODERELATIONS(np.previous);
        }
        return;
      }
      currentnode = succ;
      currentdepth = currentnode->depth;
    }
  }
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
movq 0xd0(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x4d2107
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0x4d26e0
movq %rax, %rcx
movq 0xd0(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x4d26c9
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq 0xc0(%rsp), %rcx
movl (%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x68(%rsp)
movq 0xc8(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x4d216f
movq 0x169e62(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x43ecb(%rip), %rsi     # 0x516013
leaq 0xe7b2a(%rip), %rdx     # 0x5b9c79
leaq 0xe7b37(%rip), %rcx     # 0x5b9c8d
leaq 0xe7b4b(%rip), %r8      # 0x5b9ca8
movl $0x1f4, %r9d            # imm = 0x1F4
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d2171
movq 0xc8(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xc8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0xb8(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0xa9d00
movq %rax, 0xa8(%rsp)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
addq 0xb8(%rsp), %rax
cmpq 0xa8(%rsp), %rax
jb 0x4d21cf
movb $-0x1, 0x77(%rsp)
jmp 0x4d21fc
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rsi
addq 0xb8(%rsp), %rsi
movq 0x68(%rsp), %rax
movl 0x8(%rax), %edx
callq 0xa9da0
movb %al, 0x77(%rsp)
jmp 0x4d21fe
cmpq $0x0, 0xa0(%rsp)
jne 0x4d2241
movq 0x169d90(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x43df9(%rip), %rsi     # 0x516013
leaq 0xe7a9f(%rip), %rdx     # 0x5b9cc0
leaq 0xe7a65(%rip), %rcx     # 0x5b9c8d
leaq 0xe7a79(%rip), %r8      # 0x5b9ca8
movl $0x204, %r9d            # imm = 0x204
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d2243
jmp 0x4d2245
movq 0xa0(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x4d228c
movq 0x169d45(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x43dae(%rip), %rsi     # 0x516013
leaq 0xe7a68(%rip), %rdx     # 0x5b9cd4
leaq 0xe7a1a(%rip), %rcx     # 0x5b9c8d
leaq 0xe7a2e(%rip), %r8      # 0x5b9ca8
movl $0x205, %r9d            # imm = 0x205
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d228e
movq 0xd0(%rsp), %rdi
movq 0xb8(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movb 0x77(%rsp), %al
movq 0xc0(%rsp), %rsi
movl (%rsi), %r9d
leaq 0x78(%rsp), %rsi
movzbl %al, %r8d
callq 0x4d2780
testb $0x1, %al
jne 0x4d234f
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0x4d2870
movq %rax, 0x98(%rsp)
movq 0x80(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x18(%rax)
cmpq $0x0, 0x78(%rsp)
jne 0x4d2339
movq 0x98(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x98(%rsp)
je 0x4d2337
movq 0xa0(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4d234a
movq 0x98(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x4d26c9
movq 0x80(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x4d250e
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x3c(%rsp)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
addq 0xb8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0xa9d00
subq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movl (%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movl (%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, 0x5c(%rsp)
movq 0x88(%rsp), %rax
movq 0x8(%rax), %rax
addq 0xb8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq 0x88(%rsp), %rcx
movl (%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xa9d00
movq 0x30(%rsp), %rdi
movl 0x3c(%rsp), %esi
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movl 0x5c(%rsp), %r9d
movq 0x60(%rsp), %r10
subq $0x1, %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x4d28d0
movq %rax, 0xb0(%rsp)
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq 0xb0(%rsp), %rdx
addq $0x1, %rdx
movq 0x88(%rsp), %rcx
callq 0x4d29c0
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x4d24f8
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x90(%rsp)
je 0x4d24f6
movq 0xa0(%rsp), %rcx
movq 0x90(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4d2509
movq 0x90(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x4d26c9
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x24(%rsp)
movq 0xc0(%rsp), %rax
movq 0x8(%rax), %rax
addq 0xb8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rdi
callq 0xa9d00
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %esi
movq 0x28(%rsp), %rdx
movq %rax, %rcx
subq $0x1, %rcx
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq 0x88(%rsp), %r8
movl (%r8), %r8d
shlq $0x4, %r8
addq %r8, %rax
movq (%rax), %r8
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq 0x88(%rsp), %r9
movl (%r9), %r9d
shlq $0x4, %r9
addq %r9, %rax
movl 0x8(%rax), %r9d
movq 0x88(%rsp), %rax
movq 0x8(%rax), %r10
addq 0xb8(%rsp), %r10
addq $0x1, %r10
movq 0x88(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x88(%rsp), %r11
addq 0x28(%r11), %rax
subq $0x1, %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x4d28d0
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rax
addq 0xb0(%rsp), %rax
addq $0x1, %rax
movq 0x88(%rsp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x4d26a0
movq 0xd0(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
addq 0xb0(%rsp), %rdx
addq $0x1, %rdx
movq 0x88(%rsp), %rcx
callq 0x4d29c0
movq %rax, 0x90(%rsp)
cmpq $0x0, 0x78(%rsp)
jne 0x4d268d
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x90(%rsp)
je 0x4d268b
movq 0xa0(%rsp), %rcx
movq 0x90(%rsp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4d269e
movq 0x90(%rsp), %rcx
movq 0x78(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x4d26c9
movq 0x88(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0xb8(%rsp)
jmp 0x4d21aa
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)