// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/sfx-bentsedg.c
// Function: gt_threaded_stream_sortallbuckets
void gt_threaded_stream_sortallbuckets(GtSuffixsortspace *suffixsortspace,
                       const GtEncseq *encseq,
                       GtReadmode readmode,
                       const GtBcktab *bcktab,
                       GtCodetype mincode,
                       GtCodetype maxcode,
                       GtUword sumofwidth,
                       unsigned int numofchars,
                       unsigned int prefixlength,
                       unsigned int sortmaxdepth,
                       const Sfxstrategy *sfxstrategy,
                       GtProcessunsortedsuffixrange processunsortedsuffixrange,
                       void *processunsortedsuffixrangeinfo,
                       GtLogger *logger)
{
  GtBentsedgIterator *bs_it;
  GtBentsedgSynchronizer *bs_sync;
  unsigned int tp;
  bool haserr = false;
  GtBentsedg_stream_thread_info *th_tab;
  GtSuffixsortspace **sssp_tab;

  gt_assert(gt_jobs > 1U);
  th_tab = gt_malloc(sizeof *th_tab * gt_jobs);
  sssp_tab = gt_malloc(sizeof *sssp_tab * gt_jobs);
  bs_it = gt_BentsedgIterator_new(mincode,maxcode,sumofwidth,numofchars,bcktab);
  bs_sync = gt_bendsedgSynchronizer_new();
  for (tp = 0; !haserr && tp < gt_jobs; tp++)
  {
    th_tab[tp].thread_num = tp;
    th_tab[tp].prefixlength = prefixlength;
    if (tp == 0)
    {
      sssp_tab[tp] = suffixsortspace;
    } else
    {
      sssp_tab[tp] = gt_suffixsortspace_clone(suffixsortspace,tp,logger);
    }
    th_tab[tp].bsr = bentsedgresources_new(sssp_tab[tp],
                                           encseq,
                                           readmode,
                                           prefixlength,
                                           bcktab,
                                           sortmaxdepth,
                                           sfxstrategy,
                                           false);
    th_tab[tp].bsr->processunsortedsuffixrange
      = processunsortedsuffixrange;
    th_tab[tp].bsr->processunsortedsuffixrangeinfo
      = processunsortedsuffixrangeinfo;
    th_tab[tp].bs_it = bs_it;
    th_tab[tp].bs_sync = bs_sync;
    th_tab[tp].thread
      = gt_thread_new (gt_bentsedg_stream_thread_caller,th_tab + tp,NULL);
    if (th_tab[tp].thread == NULL)
    {
      haserr = true;
    }
  }
  for (tp = 0; tp < gt_jobs; tp++)
  {
    if (!haserr)
    {
      gt_thread_join(th_tab[tp].thread);
    }
    gt_thread_delete(th_tab[tp].thread);
  }
  for (tp = 0; tp < gt_jobs; tp++)
  {
    bentsedgresources_delete(th_tab[tp].bsr, logger);
  }
  gt_suffixsortspace_delete_cloned(sssp_tab,gt_jobs);
  gt_BentsedgIterator_delete(bs_it);
  gt_bendsedgSynchronizer_delete(bs_sync);
  gt_free(sssp_tab);
  gt_free(th_tab);
  gt_assert(!haserr);
}

// Assembly:
subq $0x78, %rsp
movq 0xb8(%rsp), %rax
movq 0xb0(%rsp), %rax
movq 0xa8(%rsp), %rax
movq 0xa0(%rsp), %rax
movl 0x98(%rsp), %eax
movl 0x90(%rsp), %eax
movl 0x88(%rsp), %eax
movq 0x80(%rsp), %rax
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl %edx, 0x64(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movb $0x0, 0x33(%rsp)
leaq 0x38954e(%rip), %rax    # 0x63d378
cmpl $0x1, (%rax)
ja 0x2b3e67
movq 0x38816a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2621d3(%rip), %rsi    # 0x516013
leaq 0x2d4742(%rip), %rdx    # 0x588589
leaq 0x2d4748(%rip), %rcx    # 0x588596
leaq 0x2d471b(%rip), %r8     # 0x588570
movl $0x7d8, %r9d            # imm = 0x7D8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2b3e69
leaq 0x389508(%rip), %rax    # 0x63d378
movl (%rax), %eax
imulq $0x28, %rax, %rdi
leaq 0x2d46f3(%rip), %rsi    # 0x588570
movl $0x7d9, %edx            # imm = 0x7D9
callq 0xe80f0
movq %rax, 0x28(%rsp)
leaq 0x3894e5(%rip), %rax    # 0x63d378
movl (%rax), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x2d46ce(%rip), %rsi    # 0x588570
movl $0x7da, %edx            # imm = 0x7DA
callq 0xe80f0
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x80(%rsp), %rdx
movl 0x88(%rsp), %ecx
movq 0x58(%rsp), %r8
callq 0x2b4200
movq %rax, 0x40(%rsp)
callq 0x2b42c0
movq %rax, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
xorl %eax, %eax
testb $0x1, 0x33(%rsp)
movb %al, 0x1f(%rsp)
jne 0x2b3f0c
movl 0x34(%rsp), %eax
leaq 0x389475(%rip), %rcx    # 0x63d378
cmpl (%rcx), %eax
setb %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x2b3f19
jmp 0x2b40bc
movl 0x34(%rsp), %ecx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl 0x90(%rsp), %ecx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
cmpl $0x0, 0x34(%rsp)
jne 0x2b3f65
movq 0x70(%rsp), %rdx
movq 0x20(%rsp), %rax
movl 0x34(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x2b3f8b
movq 0x70(%rsp), %rdi
movl 0x34(%rsp), %esi
movq 0xb8(%rsp), %rdx
callq 0x2e97b0
movq %rax, %rdx
movq 0x20(%rsp), %rax
movl 0x34(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
movl 0x34(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movq 0x68(%rsp), %rsi
movl 0x64(%rsp), %edx
movl 0x90(%rsp), %ecx
movq 0x58(%rsp), %r8
movl 0x98(%rsp), %r9d
movq 0xa0(%rsp), %rax
xorl %r10d, %r10d
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x2b19a0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq 0xa8(%rsp), %rcx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq (%rax), %rax
movq %rcx, 0x50(%rax)
movq 0xb0(%rsp), %rcx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq (%rax), %rax
movq %rcx, 0x58(%rax)
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movq 0x28(%rsp), %rsi
movl 0x34(%rsp), %eax
imulq $0x28, %rax, %rax
addq %rax, %rsi
leaq 0x2b2(%rip), %rdi       # 0x2b4320
xorl %eax, %eax
movl %eax, %edx
callq 0x120b50
movq %rax, %rcx
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x20(%rax)
jne 0x2b40aa
movb $0x1, 0x33(%rsp)
jmp 0x2b40ac
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x2b3eeb
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
leaq 0x3892a9(%rip), %rcx    # 0x63d378
cmpl (%rcx), %eax
jae 0x2b4119
testb $0x1, 0x33(%rsp)
jne 0x2b40f3
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdi
callq 0x120ca0
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdi
callq 0x121310
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x2b40c4
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
leaq 0x38924c(%rip), %rcx    # 0x63d378
cmpl (%rcx), %eax
jae 0x2b415d
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq 0xb8(%rsp), %rsi
callq 0x2b39f0
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x2b4121
movq 0x20(%rsp), %rdi
leaq 0x38920f(%rip), %rax    # 0x63d378
movl (%rax), %esi
callq 0x2ea5c0
movq 0x40(%rsp), %rdi
callq 0x2b4410
movq 0x38(%rsp), %rdi
callq 0x2b44a0
movq 0x20(%rsp), %rdi
leaq 0x2d43e0(%rip), %rsi    # 0x588570
movl $0x80c, %edx            # imm = 0x80C
callq 0xe88c0
movq 0x28(%rsp), %rdi
leaq 0x2d43ca(%rip), %rsi    # 0x588570
movl $0x80d, %edx            # imm = 0x80D
callq 0xe88c0
testb $0x1, 0x33(%rsp)
je 0x2b41ef
movq 0x387de2(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x261e4b(%rip), %rsi    # 0x516013
leaq 0x2d43e9(%rip), %rdx    # 0x5885b8
leaq 0x2d43c0(%rip), %rcx    # 0x588596
leaq 0x2d4393(%rip), %r8     # 0x588570
movl $0x80e, %r9d            # imm = 0x80E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2b41f1
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)