// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/sfx-bltrie.c
// Function: blindtrie_insertatsplitnode
static void blindtrie_insertatsplitnode(GtBlindtrie *blindtrie,
                                        GtBlindtriesnodeptr oldnode,
                                        GtBlindtriesymbol mm_oldsuffix,
                                        GtUword lcp,
                                        GtBlindtriesymbol mm_newsuffix,
                                        GtUword currentstartpos,
                                        GtUword
                                           currenttwobitencodingstoppos)
{
  GtBlindtriesnodeptr newleaf, newnode, previousnode, currentnode;

  gt_assert(GT_ISUNIQUEINT(mm_oldsuffix) ||
            GT_ISUNIQUEINT(mm_newsuffix) ||
            mm_oldsuffix != mm_newsuffix ||
            blindtrie_isleaf(blindtrie,oldnode) ||
            blindtrie_getdepth(blindtrie,oldnode) == lcp);

  /* insert a new node before node oldnode if necessary */
  if (blindtrie_isleaf(blindtrie,oldnode))
  {
    gt_assert(lcp > 0);
  }
  if (blindtrie_isleaf(blindtrie,oldnode) ||
      blindtrie_getdepth(blindtrie,oldnode) > lcp)
  {
    newnode = blindtrie_newnode(blindtrie);
    blindtrie_firstchar_set(blindtrie,newnode,
                            blindtrie_isleaf(blindtrie,oldnode),mm_oldsuffix);
    if (!blindtrie_isleaf(blindtrie,oldnode))
    {
      blindtrie_setdepth(blindtrie,newnode,
                         blindtrie_getdepth(blindtrie,oldnode));
      /* newnode inherits depth+children */
    }
    blindtrie_copy_either(blindtrie,newnode,oldnode);
    blindtrie_rightsibling_set(blindtrie,newnode,GT_BLINDTRIE_REFNULL);
    blindtrie_setleaf(blindtrie,oldnode,false);
    gt_assert(!GT_ISUNIQUEINT(blindtrie_firstchar_get(blindtrie,oldnode)));
    gt_assert(lcp > 0);
    blindtrie_setdepth(blindtrie,oldnode,lcp);
    /* oldnode has newnode as only child*/
    blindtrie_firstchild_set(blindtrie,oldnode,newnode);
  }
  gt_assert(blindtrie_isleaf(blindtrie,oldnode) ||
            blindtrie_getdepth(blindtrie,oldnode) == lcp);
  previousnode = GT_BLINDTRIE_REFNULL;
  currentnode = blindtrie_firstchild_get(blindtrie,oldnode);
  while (currentnode != GT_BLINDTRIE_REFNULL &&
         blindtrie_comparecharacters(blindtrie_firstchar_get(blindtrie,
                                                             currentnode),
                                     mm_newsuffix) < 0)
  {
    previousnode = currentnode;
    currentnode = blindtrie_rightsibling_get(blindtrie,currentnode);
  }
  /* insert new leaf with current suffix */
  /* search S[lcp] among the offsprings */
  newleaf = blindtrie_newleaf(blindtrie,currentstartpos,
                              currenttwobitencodingstoppos,mm_newsuffix,
                              currentnode);
  if (previousnode != GT_BLINDTRIE_REFNULL)
  {
    blindtrie_rightsibling_set(blindtrie,previousnode,newleaf);
  } else
  {
    blindtrie_firstchild_set(blindtrie,oldnode,newleaf);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r12
movq %r8, %r15
movq %rcx, %rbp
movq %rdx, %r13
movl %esi, %ebx
movq %rdi, %r14
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r8, %rax
orq %rdx, %rax
cmpq $0x100, %rax            # imm = 0x100
setae %al
cmpq %r8, %rdx
setne %cl
orb %al, %cl
jne 0x1f0965
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f04d3
testb %al, %al
jne 0x1f0965
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f0bac
cmpq %rbp, %rax
jne 0x1f0b7a
movq %r12, 0x8(%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f04d3
testq %rbp, %rbp
jne 0x1f0981
testb %al, %al
jne 0x1f0b5c
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f04d3
testb %al, %al
jne 0x1f09a2
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f0bac
cmpq %rbp, %rax
jbe 0x1f0ab8
movq %rbp, (%rsp)
movq %r14, %rdi
callq 0x1f0c43
movl %eax, %r12d
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f04d3
movzbl %al, %ebp
movq %r14, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1f0dd1
cmpq $0x100, %r13            # imm = 0x100
setb %al
orb %al, %bpl
je 0x1f0b61
movq 0x8(%r14), %rax
movl %r12d, %ebp
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
movq %r13, (%rax,%rcx,8)
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f04d3
testb %al, %al
jne 0x1f0a1a
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f0bac
movq %r14, %rdi
movl %r12d, %esi
movq %rax, %rdx
callq 0x1f0c93
movl 0x4(%r14), %eax
cmpl %r12d, %eax
jbe 0x1f0b66
cmpl %ebx, %eax
jbe 0x1f0b66
movq 0x8(%r14), %rax
shlq $0x3, %rbp
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
movl %ebx, %edx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
movq 0x8(%rax,%rdx), %rsi
movq %rsi, 0x8(%rax,%rcx)
movq 0x8(%r14), %rax
movl 0x10(%rax,%rdx), %edx
movl %edx, 0x10(%rax,%rcx)
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1f0dfc
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x1f0dd1
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f0e60
cmpq $0x100, %rax            # imm = 0x100
jae 0x1f0b6b
movq (%rsp), %rbp
testq %rbp, %rbp
je 0x1f0b70
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0x1f0c93
movq %r14, %rdi
movl %ebx, %esi
movl %r12d, %edx
callq 0x1f0cc1
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f04d3
testb %al, %al
jne 0x1f0ad9
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f0bac
cmpq %rbp, %rax
jne 0x1f0b75
movq %r14, %rdi
movl %ebx, %esi
callq 0x1f0b7f
movl %eax, %r12d
xorl %ebp, %ebp
testl %eax, %eax
je 0x1f0b0f
movq %r14, %rdi
movl %r12d, %esi
callq 0x1f0e60
cmpq %r15, %rax
jae 0x1f0b0f
movl %r12d, %ebp
movq %r14, %rdi
movl %r12d, %esi
callq 0x1f0c08
movl %eax, %r12d
jmp 0x1f0ae8
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
movl %r12d, %r8d
callq 0x1f0ced
movq %r14, %rdi
testl %ebp, %ebp
je 0x1f0b45
movl %ebp, %esi
movl %eax, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f0dfc
movl %ebx, %esi
movl %eax, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f0cc1
callq 0x783d0
callq 0x782b3
callq 0x782ec
callq 0x78397
callq 0x7835e
callq 0x78325
callq 0x7827a