// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/src/Parallel.cpp
// Function: ParallelSolver::Solve(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void ParallelSolver::Solve(string filename, string outScoreFile)
{
    GenericBnBSolver* S[thr_num];
    thread T[thr_num];
    mutex m; 
    
    for (int i = 0; i < thr_num; ++i)
    {
        S[i] = MakeSolver(t1, t2, d, k, dag, i, *this);
        T[i] = thread{&ParallelSolver::Callback, this, filename,outScoreFile, S[i]};
    }

    unique_lock<mutex> lock{m};
    thr_cond.wait(lock, [&] { return thr_val != thread::id{}; });

    for (int i = 0; i < thr_num; ++i)
    {
        T[i].join();
        delete S[i];
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, -0x60(%rbp)
movq %rsi, -0x58(%rbp)
movq %rdi, %r14
movl 0x88(%rdi), %r15d
movq %rsp, %rcx
leaq 0xf(,%r15,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq %rcx, %rsp
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
testq %r15, %r15
je 0x44a8d
leaq (,%r15,8), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x91d0
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
andq $0x0, -0x90(%rbp)
movaps %xmm0, -0xb0(%rbp)
leaq 0x128(%r14), %rax
movq %rax, -0x70(%rbp)
leaq 0xb0(%r14), %rax
movq %rax, -0x68(%rbp)
movq %r15, %rcx
xorl %r12d, %r12d
movq -0x50(%rbp), %r13
movq %rbx, -0x48(%rbp)
movq %rbx, %r15
movq %rcx, -0x40(%rbp)
movl %ecx, %eax
cltq
cmpq %rax, %r12
jge 0x44b9c
movq %r15, -0x78(%rbp)
movq %r12, %rbx
leaq -0xd0(%rbp), %r15
movq 0xa8(%r14), %r12
movq %r15, %rdi
movq -0x70(%rbp), %rsi
callq 0x9470
movsd 0x148(%r14), %xmm0
movzbl 0x150(%r14), %ecx
movq %r12, %rdi
movq -0x68(%rbp), %rsi
movq %r15, %rdx
movq %rbx, %r12
movl %r12d, %r8d
movq %r14, %r9
callq 0x44264
movq %rax, (%r13)
leaq -0xd0(%rbp), %rdi
callq 0x9708
leaq -0x2b9(%rip), %rax      # 0x44886
movq %rax, -0x38(%rbp)
andq $0x0, -0x30(%rbp)
movq %r14, -0x80(%rbp)
leaq -0x88(%rbp), %rbx
movq %rbx, %rdi
leaq -0x38(%rbp), %rsi
leaq -0x80(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %r8
movq %r13, %r9
callq 0x4591c
movq -0x78(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3f59c
movq %rbx, %rdi
callq 0x36ca4
incq %r12
movl 0x88(%r14), %eax
addq $0x8, %r15
addq $0x8, %r13
jmp 0x44ad3
leaq -0x38(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x459c2
leaq 0x50(%r14), %rbx
leaq -0x38(%rbp), %r15
movq -0x48(%rbp), %r12
movq 0x80(%r14), %rax
testq %rax, %rax
jne 0x44bd1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9100
jmp 0x44bb8
xorl %r15d, %r15d
movq %r12, %rbx
movslq 0x88(%r14), %rax
cmpq %rax, %r15
jge 0x44c07
movq %rbx, %rdi
callq 0x95f0
movq -0x50(%rbp), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x44bfe
movq (%rdi), %rax
callq *0x8(%rax)
incq %r15
addq $0x8, %rbx
jmp 0x44bd7
leaq -0x38(%rbp), %rdi
callq 0x459d8
movq -0x40(%rbp), %rbx
testl %ebx, %ebx
je 0x44c2f
addq $-0x8, %r12
shlq $0x3, %rbx
leaq (%r12,%rbx), %rdi
callq 0x36ca4
addq $-0x8, %rbx
jne 0x44c20
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x44c61
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x459d8
jmp 0x44c64
jmp 0x44c61
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x9708
jmp 0x44c64
movq %rax, %rbx
movq -0x40(%rbp), %r15
testl %r15d, %r15d
movq -0x48(%rbp), %r14
je 0x44c88
addq $-0x8, %r14
shlq $0x3, %r15
leaq (%r14,%r15), %rdi
callq 0x36ca4
addq $-0x8, %r15
jne 0x44c79
movq %rbx, %rdi
callq 0x9640