// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-spmfind.c
// Function: combine_terminal_with_wset
static void combine_terminal_with_wset(GtUword seqnum,
    GtUword seqstartpos, GtUword seqlen, GtUword w_left,
    GtUword lcp, GtBUstate_spm *state)
{
  GtUword j, suffix_readnum = seqnum;
  bool suffixseq_direct = true;

  GT_READJOINER_CORRECT_REVCOMPL(suffix_readnum, state->first_revcompl,
      state->nofreads, suffixseq_direct);

#ifdef GT_READJOINER_STATISTICS
  (state->nof_terminals)++;
  (state->nof_terminals_in_subtree)++;
  if (w_left < state->w_nextfree)
  {
    (state->nof_combinable_terminals)++;
    gt_disc_distri_add(state->w_per_terminal, state->w_nextfree - w_left);
    state->nof_t_w_combinations += state->w_nextfree - w_left;
  }
#endif
  for (j = w_left; j < state->w_nextfree; j++)
  {
    bool prefixseq_direct = true;
    WholereadInfo *w = state->w_set + j;
    GtUword prefix_readnum = w->seqnum;
    GT_READJOINER_CORRECT_REVCOMPL(prefix_readnum, state->first_revcompl,
        state->nofreads, prefixseq_direct);
    if (!state->elimtrans ||
        !gt_blindtrie_retrieve(w->blindtrie, state->totallength -
          (seqstartpos + seqlen - lcp), seqstartpos))
    {
      /* irreducible SPM */
      if (GT_READJOINER_IS_CORRECT_REVCOMPL_CASE(suffix_readnum,
            suffixseq_direct, prefix_readnum, prefixseq_direct))
      {
#ifdef GT_READJOINER_DEBUG
        gt_log_log(""GT_WU" %s "GT_WU" %s "GT_WU"\n", suffix_readnum,
                   suffixseq_direct ? "+" : "-", prefix_readnum,
                   prefixseq_direct ? "+" : "-", lcp);
#endif
        state->proc(suffix_readnum, prefix_readnum, lcp, suffixseq_direct,
            prefixseq_direct, state->procdata);
        (state->nofvalidspm)++;
#ifdef GT_READJOINER_STATISTICS
        (state->nof_overlaps_in_subtree)++;
#endif
      }
#ifdef GT_READJOINER_STATISTICS
      else
      {
        (state->nof_wrong_direction)++;
      }
#endif
    }
    else
    {
      /* transitive */
      if (prefix_readnum == suffix_readnum)
        (state->nof_transitive_withrc)++;
      else
        (state->nof_transitive_other)++;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %rbx
movq %r8, 0x28(%rsp)
movq %rcx, %rbp
movq %rsi, 0x20(%rsp)
movq 0x58(%r9), %rax
decq %rax
movq %rdi, 0x10(%rsp)
movq %rax, 0x18(%rsp)
cmpq %rdi, %rax
jae 0x17d12c
movq 0x50(%rbx), %rax
decq %rax
subq %rdi, %rax
movq %rax, 0x10(%rsp)
jb 0x17d2b1
cmpq %rdi, 0x18(%rsp)
setb 0xf(%rsp)
addq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rax
subq %rdx, %rax
movq %rax, 0x38(%rsp)
leaq 0xc0(%rbx), %rax
movq %rax, 0x40(%rsp)
movq %rbp, %r15
shlq $0x4, %r15
orq $0x8, %r15
movq %rdi, 0x30(%rsp)
cmpq 0x80(%rbx), %rbp
jae 0x17d26a
movq 0x58(%rbx), %r13
movq 0x78(%rbx), %rax
movq -0x8(%rax,%r15), %r14
decq %r13
movq %r14, %r12
cmpq %r14, %r13
jae 0x17d199
movq 0x50(%rbx), %r12
decq %r12
subq %r14, %r12
jb 0x17d279
cmpb $0x1, 0x28(%rbx)
jne 0x17d1d8
movq (%rax,%r15), %rdi
movq 0x40(%rbx), %rsi
addq 0x38(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x195a32
movq 0x30(%rsp), %rdi
testb %al, %al
je 0x17d1d8
xorl %eax, %eax
cmpq 0x10(%rsp), %r12
setne %al
leaq (%rbx,%rax,8), %rax
addq $0xc8, %rax
jmp 0x17d25b
cmpq %rdi, 0x18(%rsp)
jb 0x17d1e4
cmpq %r14, %r13
jae 0x17d223
cmpq %r14, %r13
setb %al
cmpq %rdi, 0x18(%rsp)
setb %cl
testb %al, %cl
jne 0x17d1fd
cmpq %r12, 0x10(%rsp)
je 0x17d223
cmpq %rdi, 0x18(%rsp)
jb 0x17d210
cmpq 0x10(%rsp), %r12
jbe 0x17d210
cmpq %r14, %r13
jb 0x17d223
cmpq 0x10(%rsp), %r12
setb %al
cmpq %r14, %r13
jb 0x17d25e
andb 0xf(%rsp), %al
je 0x17d25e
xorl %r8d, %r8d
cmpq %r14, %r13
setae %r8b
xorl %ecx, %ecx
cmpq %rdi, 0x18(%rsp)
setae %cl
movq 0xb8(%rbx), %r9
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq 0x28(%rsp), %rdx
callq *0xb0(%rbx)
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rax
incq (%rax)
incq %rbp
addq $0x10, %r15
jmp 0x17d164
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2bace8(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x167d89(%rip), %rsi    # 0x2e5013
leaq 0x1d16c0(%rip), %rdx    # 0x34e951
leaq 0x1d169e(%rip), %rcx    # 0x34e936
leaq 0x1d15cd(%rip), %r8     # 0x34e86c
movl $0x162, %r9d            # imm = 0x162
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2bacb0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x167d51(%rip), %rsi    # 0x2e5013
leaq 0x1d1643(%rip), %rdx    # 0x34e90c
leaq 0x1d1666(%rip), %rcx    # 0x34e936
leaq 0x1d1595(%rip), %r8     # 0x34e86c
movl $0x150, %r9d            # imm = 0x150
jmp 0x17d2a5