// File: /workspace/github_cpp_makefile_star2_O3/AlgoLab[P]bwt-lcp-parallel/bwt_lcp.cpp
// Function: compute_partial_BWT(unsigned char, unsigned int, 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 compute_partial_BWT(
    const strlen_t k, const strnum_t m,
    const fnames_t& S_tpl,
    const fnames_t& B_tpl
) {
  const fnames_t N_tpl[] = {
    template_generator("supportfile-N0_%d.tmp", 0, ALPHSIZE),
    template_generator("supportfile-N1_%d.tmp", 0, ALPHSIZE),
  };
  { // B0 (and N0)
    copy_file(S_tpl[0], B_tpl[0]);
    multi_strnum_writer_t N0(N_tpl[0]);
    for (strnum_t i = 0; i < m; ++i) {
      N0.write(0, i);
    }
  }
  { // B1...Bk
    for (strlen_t l = 1; l <= k; ++l) {
      {
        enc_fasta_reader_t Bl1(B_tpl[l-1]);
        multi_strnum_reader_t Nl1(N_tpl[(l + 1) % 2]);
        multi_strnum_writer_t Nl(N_tpl[l % 2]);
        for (strnum_t i = 0; i < m; ++i) {
          Nl.write(Bl1.read(), Nl1.read());
        }
      }
      {
        enc_fasta_rnd_reader_t Sl(S_tpl[l], m);
        multi_strnum_reader_t Nl(N_tpl[l % 2]);
        enc_fasta_writer_t Bl(B_tpl[l]);
        for (strnum_t i = 0; i < m; ++i) {
          const strnum_t Nli = Nl.read();
          const enc_nucl_t SlNli = Sl.read(Nli);
          Bl.write(SlNli);
        }
      }
    }
  }
  // Cleaning
  remove_files(N_tpl[0]);
  remove_files(N_tpl[1]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rcx, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movl %esi, %r13d
movl %edi, 0xc(%rsp)
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x67f7(%rip), %rsi      # 0x9060
leaq 0x6805(%rip), %rdx      # 0x9075
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x711e
leaq 0xb0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl $0x6, %ecx
callq 0x26cc
leaq 0xc8(%rsp), %r14
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x67c3(%rip), %rsi      # 0x9076
leaq 0x67d1(%rip), %rdx      # 0x908b
leaq 0x78(%rsp), %rdi
callq 0x711e
leaq 0x78(%rsp), %rsi
movq %r14, %rdi
xorl %edx, %edx
movl $0x6, %ecx
callq 0x26cc
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x28f2
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x2260
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x2909
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2260
movq 0x30(%rsp), %rax
movq (%rax), %rdi
movq 0x38(%rsp), %r15
movq (%r15), %rsi
callq 0x274d
leaq 0x6767(%rip), %rdx      # 0x908c
leaq 0x40(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5828
testl %r13d, %r13d
je 0x2968
xorl %ebp, %ebp
leaq 0x78(%rsp), %rbx
movq 0x60(%rsp), %rax
movl %ebp, 0x78(%rsp)
movq (%rax), %rcx
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2070
incl %ebp
cmpl %ebp, %r13d
jne 0x2943
movl %r13d, 0x8(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x6cc0
leaq 0x40(%rsp), %rdi
callq 0x578c
cmpb $0x0, 0xc(%rsp)
je 0x2bf4
movl 0x8(%rsp), %eax
movq %rax, 0xe0(%rsp)
movb $0x1, %r13b
leaq 0x66ed(%rip), %r14      # 0x908f
leaq 0x40(%rsp), %rbx
movq (%r15), %rax
movzbl %r13b, %r13d
movl %r13d, %ecx
shll $0x5, %ecx
leaq (%rax,%rcx), %rsi
addq $-0x20, %rsi
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
callq 0x5878
movl %r13d, %ebp
andb $0x1, %bpl
movl %ebp, %eax
xorb $0x1, %al
movzbl %al, %eax
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax,8), %rsi
addq $0xb0, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x58c2
movzbl %bpl, %eax
leaq (%rax,%rax,2), %rax
leaq (%rsp,%rax,8), %rbp
addq $0xb0, %rbp
leaq 0x78(%rsp), %rdi
movq %rbp, %rsi
leaq 0x6679(%rip), %rdx      # 0x908c
callq 0x5828
movl 0x8(%rsp), %eax
movl %eax, %r14d
testl %eax, %eax
je 0x2a83
movzbl 0x25(%rsp), %r15d
leaq 0x10(%rsp), %rdi
callq 0x75b0
movq %rbx, %rdi
callq 0x76a2
movl 0x70(%rsp), %r12d
movq 0x68(%rsp), %rcx
movl $0x4, %esi
movl $0x1, %edx
leaq 0x70(%rsp), %rdi
callq 0x22e0
movq 0x98(%rsp), %rax
movl %r12d, 0x2c(%rsp)
movq (%rax,%r15,8), %rcx
movl $0x4, %esi
movl $0x1, %edx
leaq 0x2c(%rsp), %rdi
callq 0x2070
decl %r14d
jne 0x2a23
leaq 0x98(%rsp), %rdi
callq 0x6cc0
leaq 0x78(%rsp), %rdi
callq 0x578c
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x2aa9
callq 0x2240
movq %rbx, %rdi
callq 0x578c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
movq 0x38(%rsp), %r15
leaq 0x70(%rsp), %r12
leaq 0x65c5(%rip), %r14      # 0x908f
je 0x2ad1
callq 0x2240
movl %r13d, %esi
shll $0x5, %esi
movq 0x30(%rsp), %rax
addq (%rax), %rsi
leaq 0x78(%rsp), %rdi
movq 0xe0(%rsp), %rdx
callq 0x5932
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x58c2
movq (%r15), %rax
movl %r13d, %ecx
shll $0x5, %ecx
movq (%rax,%rcx), %rdi
leaq 0x6579(%rip), %rsi      # 0x908c
callq 0x22a0
movq %rax, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movb $0x0, 0x1c(%rsp)
movl 0x8(%rsp), %eax
movl %eax, %r14d
testl %eax, %eax
je 0x2bb4
movq %rbx, %rdi
callq 0x76a2
movl 0x70(%rsp), %ebp
movq 0x68(%rsp), %rcx
movl $0x4, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x22e0
movl %ebp, %eax
shrl %eax
movq 0x80(%rsp), %rcx
movb (%rcx,%rax), %dl
notb %bpl
shlb $0x2, %bpl
andb $0x4, %bpl
movl %ebp, %ecx
shrb %cl, %dl
andb $0xf, %dl
movb 0x1c(%rsp), %al
shlb $0x4, %al
orb %dl, %al
movb %al, 0x1c(%rsp)
movl 0x18(%rsp), %ecx
incl %ecx
movl %ecx, 0x18(%rsp)
cmpl $0x2, %ecx
jne 0x2baf
movzbl %al, %edi
movq 0x10(%rsp), %rsi
callq 0x20b0
movl $0x0, 0x18(%rsp)
movb $0x0, 0x1c(%rsp)
decl %r14d
jne 0x2b35
leaq 0x10(%rsp), %rdi
callq 0x59ba
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x2bcd
callq 0x2240
movq %rbx, %rdi
callq 0x578c
leaq 0x78(%rsp), %rdi
callq 0x59fc
incb %r13b
cmpb 0xc(%rsp), %r13b
leaq 0x64a1(%rip), %r14      # 0x908f
jbe 0x29a7
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
cmpq %r14, %rbx
je 0x2c17
movq (%rbx), %rdi
callq 0x2400
addq $0x20, %rbx
jmp 0x2c04
movq 0xc8(%rsp), %rbx
movq 0xd0(%rsp), %r14
cmpq %r14, %rbx
je 0x2c3a
movq (%rbx), %rdi
callq 0x2400
addq $0x20, %rbx
jmp 0x2c27
movl $0x18, %ebx
leaq (%rsp,%rbx), %rdi
addq $0xb0, %rdi
callq 0x578c
addq $-0x18, %rbx
cmpq $-0x18, %rbx
jne 0x2c3f
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2cd8
jmp 0x2cd8
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0x2c93
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x2260
jmp 0x2c93
jmp 0x2c90
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x2caa
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2260
leaq 0xb0(%rsp), %r15
cmpq %r14, %r15
je 0x2d5d
addq $-0x18, %r14
movq %r14, %rdi
callq 0x578c
cmpq %r15, %r14
jne 0x2cbb
jmp 0x2d5d
jmp 0x2cd8
movq %rax, %rbx
jmp 0x2cfe
movq %rax, %rbx
jmp 0x2d3d
movq %rax, %rbx
jmp 0x2d2e
movq %rax, %rbx
jmp 0x2d24
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x59ba
leaq 0x40(%rsp), %rdi
callq 0x5916
leaq 0x78(%rsp), %rdi
callq 0x59fc
jmp 0x2d3d
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x6cc0
leaq 0x78(%rsp), %rdi
callq 0x578c
leaq 0x40(%rsp), %rdi
callq 0x5916
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2d3d
callq 0x2240
movl $0x18, %r14d
leaq (%rsp,%r14), %rdi
addq $0xb0, %rdi
callq 0x578c
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x2d43
movq %rbx, %rdi
callq 0x23d0