// File: /workspace/github_cpp_makefile_star2_O1/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 $0x98, %rsp
movq %rdx, -0x88(%rbp)
movq %rsi, -0x80(%rbp)
movq %rdi, %r14
movl 0x88(%rdi), %ebx
movq %rsp, %rcx
leaq 0xf(,%rbx,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq %rcx, %rsp
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
testq %rbx, %rbx
je 0x4bcbd
leaq (,%rbx,8), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x91c0
movq %rbx, -0x48(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movq $0x0, -0xa0(%rbp)
cmpl $0x0, 0x88(%r14)
movq %r15, -0x30(%rbp)
jle 0x4bdf0
leaq 0xb0(%r14), %rax
movq %rax, -0x78(%rbp)
xorl %r15d, %r15d
leaq -0x70(%rbp), %rcx
movq -0x50(%rbp), %rbx
movq 0xa8(%r14), %r12
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq 0x128(%r14), %rsi
movq 0x130(%r14), %rdx
addq %rsi, %rdx
movq %r14, %r13
movq %rcx, %r14
movq %rcx, %rdi
callq 0xda94
movsd 0x148(%r13), %xmm0
movzbl 0x150(%r13), %ecx
movq %r12, %rdi
movq -0x78(%rbp), %rsi
movq %r14, %r12
movq %r14, %rdx
movl %r15d, %r8d
movq %r13, %r9
callq 0x4b04c
movq %r13, %r14
movq %rax, (%rbx)
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
movq -0x30(%rbp), %r13
je 0x4bd7f
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x9340
leaq -0x3d0(%rip), %rax      # 0x4b9b6
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq %r14, -0x90(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %r8
movq %rbx, %r9
callq 0x4cff4
cmpq $0x0, (%r13,%r15,8)
jne 0x4bf07
movq %r12, %rcx
movq -0x98(%rbp), %rax
movq %rax, (%r13,%r15,8)
incq %r15
movslq 0x88(%r14), %rax
addq $0x8, %rbx
cmpq %rax, %r15
jl 0x4bd05
leaq -0xc0(%rbp), %rax
leaq -0x40(%rbp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x55286
movb $0x1, -0x38(%rbp)
movq 0x80(%r14), %rax
testq %rax, %rax
movq -0x50(%rbp), %r13
movq -0x48(%rbp), %rbx
jne 0x4be3e
leaq 0x50(%r14), %r15
leaq -0x40(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x90f0
movq 0x80(%r14), %rax
testq %rax, %rax
je 0x4be27
cmpl $0x0, 0x88(%r14)
jle 0x4be7a
xorl %r12d, %r12d
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x9620
movq (%r13,%r12,8), %rdi
testq %rdi, %rdi
je 0x4be67
movq (%rdi), %rax
callq *0x8(%rax)
incq %r12
movslq 0x88(%r14), %rax
addq $0x8, %r15
cmpq %rax, %r12
jl 0x4be4f
leaq -0x40(%rbp), %rdi
callq 0x4d0b4
testq %rbx, %rbx
movq -0x30(%rbp), %rax
je 0x4be9e
shlq $0x3, %rbx
cmpq $0x0, -0x8(%rax,%rbx)
jne 0x4bf07
addq $-0x8, %rbx
jne 0x4be90
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4becf
jmp 0x4becf
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x4bee0
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x9340
jmp 0x4bee0
movq %rax, %r14
jmp 0x4bee0
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x4d0b4
movq -0x48(%rbp), %rcx
testq %rcx, %rcx
movq -0x30(%rbp), %rax
je 0x4beff
shlq $0x3, %rcx
cmpq $0x0, -0x8(%rax,%rcx)
jne 0x4bf07
addq $-0x8, %rcx
jne 0x4bef1
movq %r14, %rdi
callq 0x9670
callq 0x90d0