// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/match/sfx-bentsedg.c
// Function: gt_bentsedg_stream_thread_caller
static void *gt_bentsedg_stream_thread_caller(void *data)
{
  GtBentsedg_stream_thread_info *thinfo
    = (GtBentsedg_stream_thread_info *) data;

  while (true)
  {
    GtBucketspecification bucketspec;
    GtUword bucketnumber;

    gt_mutex_lock(thinfo->bs_it->mutex);
    if (!gt_BentsedgIterator_next(&bucketspec,thinfo->bs_it))
    {
      gt_mutex_unlock(thinfo->bs_it->mutex);
      break;
    }
    bucketnumber = thinfo->bs_it->bucketnumber++;
    gt_mutex_unlock(thinfo->bs_it->mutex);
    if (bucketspec.nonspecialsinbucket > 1UL)
    {
      gt_sort_bentleysedgewick(thinfo->bsr,bucketspec.left,
                               bucketspec.nonspecialsinbucket,
                               (GtUword) thinfo->prefixlength);
    }
    gt_mutex_lock(thinfo->bs_sync->mutex);
    gt_bendsedgSynchronizer_process(thinfo->bs_sync,bucketnumber);
    gt_mutex_unlock(thinfo->bs_sync->mutex);
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x38(%rax), %rdi
callq 0x11c907
movq 0x10(%rbx), %r12
movq 0x18(%r12), %rdx
movq 0x28(%r12), %rcx
cmpq %rcx, %rdx
ja 0x1e524d
movq %rsp, %r14
leaq 0x1d0659(%rip), %r15    # 0x3b5720
movq (%r12), %r8
movq 0x10(%r12), %rsi
movl 0x30(%r12), %r9d
movq %r14, %rdi
callq 0x18be28
movl %eax, 0x30(%r12)
incq 0x18(%r12)
movq 0x10(%rbx), %rax
movq 0x8(%rax), %r12
movq 0x38(%rax), %rdi
leaq 0x1(%r12), %rbp
movq %rbp, 0x8(%rax)
callq 0x11c922
movq 0x8(%rsp), %rdx
cmpq $0x2, %rdx
jb 0x1e511b
movq (%rbx), %rdi
movq (%rsp), %rsi
movl 0x8(%rbx), %ecx
callq 0x1e3417
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x11c907
movq 0x18(%rbx), %r13
testq %r13, %r13
je 0x1e526d
cmpq %r12, 0x8(%r13)
jne 0x1e5192
movq %rbp, 0x8(%r13)
movq (%r13), %rdi
callq 0x1e4cec
testb %al, %al
jne 0x1e521c
movq (%r13), %rdi
callq 0x1e4cce
cmpq 0x8(%r13), %rax
jne 0x1e521c
movq (%r13), %rdi
testq %rdi, %rdi
je 0x1e5268
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x1e5268
incq %rax
decq %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x8(%r13)
jne 0x1e5154
jmp 0x1e521c
jae 0x1e5277
movq (%r13), %r13
testq %r13, %r13
je 0x1e5272
movq (%r13), %rsi
movq 0x8(%r13), %rdx
cmpq %rsi, %rdx
jae 0x1e51b8
movq 0x10(%r13), %rax
jmp 0x1e51dd
leaq (%rsi,%rsi), %rax
movq %rax, (%r13)
movq 0x10(%r13), %rdi
shlq $0x4, %rsi
movq %r15, %rdx
movl $0x741, %ecx            # imm = 0x741
callq 0x104461
movq %rax, 0x10(%r13)
movq 0x8(%r13), %rdx
leaq (%rax,%rdx,8), %rcx
testq %rdx, %rdx
jle 0x1e51ff
movq -0x8(%rcx), %rdx
cmpq %r12, %rdx
jae 0x1e51fb
movq %rdx, (%rcx)
addq $-0x8, %rcx
cmpq %rax, %rcx
ja 0x1e51e6
movq 0x8(%r13), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x8(%r13)
cmpq %rax, %rcx
jb 0x1e527c
leaq (%rax,%rdx,8), %rax
addq $0x8, %rax
cmpq %rax, %rcx
jae 0x1e527c
movq %r12, (%rcx)
movq 0x18(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x11c922
movq 0x10(%rbx), %rax
movq 0x38(%rax), %rdi
callq 0x11c907
movq 0x10(%rbx), %r12
movq 0x18(%r12), %rdx
movq 0x28(%r12), %rcx
cmpq %rcx, %rdx
jbe 0x1e50c7
movq 0x38(%r12), %rdi
callq 0x11c922
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x75c06
callq 0x75c3f
callq 0x75bcd
callq 0x75b5b
callq 0x75b94