// File: /workspace/github_cpp_makefile_star2_O3/AlgoLab[P]bwt-lcp-parallel/bwt_lcp.cpp
// Function: worker_Qp(std::atomic<unsigned long>&, unsigned char, unsigned int, std::vector<std::array<unsigned long, 6ul>, std::allocator<std::array<unsigned long, 6ul>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
void worker_Qp(std::atomic<luint_t>& shared_l,
               const strlen_t k, const strnum_t m,
               const occ_countv_t& occv,
               const fnames_t& B_tpl,
               const fnames_t& prevQ_tpl,
               const fnames_t& currQ_tpl
               ) {
  luint_t l;
  while ((l = shared_l.fetch_add(1)) <= k) {
    assert(l <= k);
    enc_fasta_reader_t Bl1(B_tpl[l]);
    plain_fasta_reader_t Ql1(prevQ_tpl[l-1]);
    create_empty_file<enc_nucl_t>(currQ_tpl[l], m);
    mmap_writer_t<enc_nucl_t, ALPHSIZE> Ql(currQ_tpl[l]);
    luint_t cumsum = 0;
    for (enc_nucl_t sigma = 0; sigma < ALPHSIZE; ++sigma) {
      Ql.seek(sigma, cumsum);
      cumsum += occv[l][sigma];
    }
    for (strnum_t i = 0; i < m; ++i) {
      const enc_nucl_t Ql1i = Ql1.read();
      const enc_nucl_t Bl1i = Bl1.read();
      Ql.write(Bl1i, Ql1i);
    }
    remove_file(prevQ_tpl[l-1]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x40(%rsp)
movl %edx, 0xc(%rsp)
movl %esi, %eax
movl $0x1, %ebx
movq %rdi, 0x38(%rsp)
lock
xaddq %rbx, (%rdi)
movq %rax, 0x30(%rsp)
cmpq %rax, %rbx
ja 0x3739
movq %rcx, %r15
movl 0xc(%rsp), %eax
movq %rax, 0x28(%rsp)
leaq 0x60(%rsp), %r13
movq %rbx, %r12
shlq $0x5, %r12
movq 0x40(%rsp), %rax
movq (%rax), %rsi
addq %r12, %rsi
leaq 0x48(%rsp), %rdi
leaq 0x5a65(%rip), %r14      # 0x908f
movq %r14, %rdx
callq 0x5878
leaq -0x1(%rbx), %rbp
shlq $0x5, %rbp
movq 0x10(%rsp), %rax
movq (%rax), %rsi
addq %rbp, %rsi
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0x6052
movq 0x130(%rsp), %r14
movq (%r14), %rdi
addq %r12, %rdi
movq 0x28(%rsp), %rsi
callq 0x60c6
addq (%r14), %r12
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x5bfc
shlq $0x4, %rbx
leaq (%rbx,%rbx,2), %r14
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %r13, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x5dc6
movq (%r15), %rax
addq %r14, %rax
addq (%rax,%r12,8), %rbx
incq %r12
cmpq $0x6, %r12
jne 0x3687
movl 0xc(%rsp), %eax
movl %eax, %r12d
testl %eax, %eax
je 0x36e8
movb 0x20(%rsp), %r14b
movq 0x18(%rsp), %rdi
callq 0x2420
movb %al, 0x20(%rsp)
movzbl 0x5d(%rsp), %ebx
leaq 0x48(%rsp), %rdi
callq 0x75b0
movzbl %r14b, %edx
movq %r13, %rdi
movl %ebx, %esi
callq 0x5f12
decl %r12d
jne 0x36b3
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax,%rbp), %rdi
callq 0x2400
movq %r13, %rdi
callq 0x6006
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3710
callq 0x2240
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x371f
callq 0x2240
movl $0x1, %ebx
movq 0x38(%rsp), %rax
lock
xaddq %rbx, (%rax)
cmpq 0x30(%rsp), %rbx
jbe 0x360c
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3773
jmp 0x3752
movq %rax, %rbx
jmp 0x3764
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x6006
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3773
callq 0x2240
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x3782
callq 0x2240
movq %rbx, %rdi
callq 0x23d0