// File: /workspace/github_cpp_makefile_star2_O3/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, -0x90(%rbp)
movq %rsi, -0x88(%rbp)
movq %rdi, -0x38(%rbp)
movl 0x88(%rdi), %edx
movq %rsp, %rcx
leaq 0xf(,%rdx,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x58(%rbp)
movq %rcx, %rsp
movq %rsp, %rdi
subq %rax, %rdi
movq %rdi, %rsp
testq %rdx, %rdx
movq %rdi, -0x30(%rbp)
movq %rdx, -0x50(%rbp)
je 0x4b7b6
movq %rdx, %rbx
leaq (,%rdx,8), %rdx
xorl %esi, %esi
callq 0x91c0
xorps %xmm0, %xmm0
movaps %xmm0, -0xc0(%rbp)
movaps %xmm0, -0xd0(%rbp)
movq $0x0, -0xb0(%rbp)
testl %ebx, %ebx
movq -0x38(%rbp), %rbx
jle 0x4b7d2
leaq 0xb0(%rbx), %rax
movq %rax, -0x80(%rbp)
xorl %r15d, %r15d
leaq -0x78(%rbp), %r14
movq -0x58(%rbp), %r13
movq 0xa8(%rbx), %r12
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x128(%rbx), %rsi
movq 0x130(%rbx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xda46
movsd 0x148(%rbx), %xmm0
movzbl 0x150(%rbx), %ecx
movq %r12, %rdi
movq -0x80(%rbp), %rsi
movq %r14, %r12
movq %r14, %rdx
movl %r15d, %r8d
movq %rbx, %r9
callq 0x4aa0c
movq %rax, (%r13)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
movq -0x30(%rbp), %r14
je 0x4b73b
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x9350
leaq -0x3cc(%rip), %rax      # 0x4b376
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq %rbx, -0x98(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x98(%rbp), %rdx
movq -0x88(%rbp), %rcx
movq -0x90(%rbp), %r8
movq %r13, %r9
callq 0x4c9d8
cmpq $0x0, (%r14,%r15,8)
jne 0x4b8ec
movq %r14, %rcx
movq %r12, %r14
movq -0xa0(%rbp), %rax
movq %rax, (%rcx,%r15,8)
incq %r15
movq -0x38(%rbp), %rbx
movslq 0x88(%rbx), %rax
addq $0x8, %r13
cmpq %rax, %r15
jl 0x4b6cb
jmp 0x4b7d2
xorps %xmm0, %xmm0
movaps %xmm0, -0xc0(%rbp)
movaps %xmm0, -0xd0(%rbp)
movq $0x0, -0xb0(%rbp)
leaq -0xd0(%rbp), %rax
leaq -0x48(%rbp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x54c1c
movb $0x1, -0x40(%rbp)
movq -0x38(%rbp), %rbx
movq 0x80(%rbx), %rax
testq %rax, %rax
movq -0x58(%rbp), %r13
jne 0x4b820
leaq 0x50(%rbx), %r15
leaq -0x48(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x90f0
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x4b809
cmpl $0x0, 0x88(%rbx)
jle 0x4b85b
xorl %r12d, %r12d
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x9630
movq (%r13,%r12,8), %rdi
testq %rdi, %rdi
je 0x4b848
movq (%rdi), %rax
callq *0x8(%rax)
incq %r12
movslq 0x88(%rbx), %rax
addq $0x8, %r15
cmpq %rax, %r12
jl 0x4b830
leaq -0x48(%rbp), %rdi
callq 0x4ca86
movq -0x50(%rbp), %rcx
testq %rcx, %rcx
movq -0x30(%rbp), %rax
je 0x4b883
shlq $0x3, %rcx
cmpq $0x0, -0x8(%rax,%rcx)
jne 0x4b8ec
addq $-0x8, %rcx
jne 0x4b875
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4b8b4
jmp 0x4b8b4
movq %rax, %r14
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x4b8c5
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x9350
jmp 0x4b8c5
movq %rax, %r14
jmp 0x4b8c5
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x4ca86
movq -0x50(%rbp), %rcx
testq %rcx, %rcx
movq -0x30(%rbp), %rax
je 0x4b8e4
shlq $0x3, %rcx
cmpq $0x0, -0x8(%rax,%rcx)
jne 0x4b8ec
addq $-0x8, %rcx
jne 0x4b8d6
movq %r14, %rdi
callq 0x9680
callq 0x90d0
nop