// File: AlgoLab[P]bwt-lcp-parallel/bwt_lcp.cpp
// Function: base_env_t::base_env_t(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&, mmap_swriter_t<unsigned char, 4194304ul>&)
base_env_t(
      const strlen_t _k,
      const strnum_t _m,
      const fnames_t& _IX_names,
      lcp_writer_t& _LCP
  )
    : k(_k),
      m(_m),
      IX_names(_IX_names),
      LCP(_LCP),
      p(0),
      midpoints{new luint_t[concurrency_level]},
      E(static_cast<luint_t>(_m)*(_k+1), false)
  {
    const luint_t tot = static_cast<luint_t>(m)*(k+1);
    const luint_t step =
      atleast1(tot/concurrency_level + ((tot%concurrency_level)>(concurrency_level/2) ? 1 : 0));
    for (luint_t i = 0, pos = step; i<concurrency_level-1; ++i, pos += step) {
      midpoints[i] = pos;
    }
    midpoints[concurrency_level-1] = tot;

    E[tot-1] = true;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movb -0x9(%rbp), %al
movb %al, (%rdi)
movl -0x10(%rbp), %eax
movl %eax, 0x4(%rdi)
movq -0x18(%rbp), %rax
movq %rax, 0x8(%rdi)
movq -0x20(%rbp), %rax
movq %rax, 0x10(%rdi)
addq $0x18, %rdi
movq %rdi, -0x80(%rbp)
callq 0x8b90
movq -0x78(%rbp), %rax
movb $0x0, 0x30(%rax)
addq $0x38, %rax
movq %rax, -0x70(%rbp)
movl 0x1d902(%rip), %eax     # 0x272a8
movl %eax, %edi
shlq $0x3, %rdi
callq 0x3030
movq %rax, -0x68(%rbp)
jmp 0x99b7
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %rdx
movq %rdx, (%rcx)
addq $0x40, %rax
movq %rax, -0x98(%rbp)
movl -0x10(%rbp), %eax
movzbl -0x9(%rbp), %ecx
incl %ecx
imulq %rcx, %rax
movq %rax, -0x90(%rbp)
movb $0x0, -0x2d(%rbp)
leaq -0x2e(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0xb230
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rcx
leaq -0x2d(%rbp), %rdx
callq 0xb250
jmp 0x9a19
leaq -0x2e(%rbp), %rdi
callq 0xb2d0
movq -0x78(%rbp), %rdi
addq $0x68, %rdi
callq 0xb2f0
movq -0x78(%rbp), %rcx
movl 0x4(%rcx), %eax
movzbl (%rcx), %ecx
incl %ecx
imulq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x1d85b(%rip), %ecx     # 0x272a8
movl %ecx, %edx
movl %edx, -0xa4(%rbp)
xorl %edx, %edx
divq %rcx
movq %rax, %rdi
movl -0xa4(%rbp), %eax
shrl %eax
subq %rdx, %rax
adcq $0x0, %rdi
callq 0xb310
movq %rax, -0xa0(%rbp)
jmp 0x9a7a
movq -0xa0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl 0x1d809(%rip), %ecx     # 0x272a8
subl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x9b19
movq -0x78(%rbp), %rax
movq -0x50(%rbp), %rdx
movq 0x38(%rax), %rax
movq -0x48(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x9a95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x9b7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2e(%rbp), %rdi
callq 0xb2d0
jmp 0x9b7e
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0xb340
jmp 0x9b7e
movq -0x78(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq 0x38(%rdi), %rax
movl 0x1d77d(%rip), %ecx     # 0x272a8
decl %ecx
movq %rdx, (%rax,%rcx,8)
addq $0x40, %rdi
movq -0x38(%rbp), %rsi
decq %rsi
callq 0x90b0
movq %rdx, -0xb8(%rbp)
movq %rax, -0xb0(%rbp)
jmp 0x9b51
movq -0xb8(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
leaq -0x60(%rbp), %rdi
movl $0x1, %esi
callq 0x9440
addq $0xc0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x9510
movq -0x28(%rbp), %rdi
callq 0x3480