// File: /workspace/github_cpp_makefile_star2_O3/EduBic[P]TSP-MetaheuristicSolvers/solversexecutor.cpp
// Function: SolversExecutor::executeAndMeasureTime(Solver&, TSPSolution&, TSPSolution&)
void SolversExecutor::executeAndMeasureTime(Solver& tspSolver, TSPSolution& initSol, TSPSolution& bestSol) {

    bestSol.solveBy = tspSolver.getSolverName();

    std::string tmp = "-----------------------------";
    std::cout << std::endl << tmp << tspSolver.getSolverName() << tmp << std::endl << std::endl;

    // initialize clocks for running time recording
    //   two ways:
    //   1) CPU time (t2 - t1)
    //   2) wall-clock time (tv2 - tv1)
    clock_t startClock, finishClock;
    timeval  tv1, tv2;

    startClock = clock();
    gettimeofday(&tv1, NULL);

    tspSolver.solve(mTspInstance, initSol, bestSol);

    finishClock = clock();
    gettimeofday(&tv2, NULL);

    bestSol.userTime = (double)(tv2.tv_sec+tv2.tv_usec*1e-6 - (tv1.tv_sec+tv1.tv_usec*1e-6));
    bestSol.cpuTime = (double)(finishClock - startClock) / CLOCKS_PER_SEC;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rax
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq *(%rax)
leaq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0x3310
movq (%r13), %rdi
leaq 0x18(%rsp), %rbp
cmpq %rbp, %rdi
je 0x44b2
callq 0x3290
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x3cac(%rip), %rsi      # 0x816d
leaq 0x3cc2(%rip), %rdx      # 0x818a
callq 0x5d1c
movq 0x6afc(%rip), %rdi      # 0xafd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq 0x6ae1(%rip), %rdi      # 0xafd0
callq 0x3030
movq %rax, %rdi
callq 0x31f0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rdi
callq 0x32f0
movq %rax, %r13
movq (%r15), %rax
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq *(%rax)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r13, %rdi
callq 0x32f0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rax, %rdi
callq 0x32f0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31f0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31f0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x45a9
callq 0x3290
callq 0x31d0
movq %rax, %r13
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x3390
addq $0x8, %r12
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq *0x8(%rax)
callq 0x31d0
movq %rax, %r14
leaq 0x48(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x3390
cvtsi2sdq (%r15), %xmm0
cvtsi2sdq 0x8(%r15), %xmm1
movsd 0x3a2b(%rip), %xmm2     # 0x8028
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x28(%rsp), %xmm0
cvtsi2sdq 0x30(%rsp), %xmm3
mulsd %xmm2, %xmm3
addsd %xmm0, %xmm3
subsd %xmm3, %xmm1
subq %r13, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x39fb(%rip), %xmm0     # 0x8030
movsd %xmm1, 0x38(%rbx)
movsd %xmm0, 0x40(%rbx)
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x464e
callq 0x3290
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4661
jmp 0x4661
movq %rax, %rbx
jmp 0x467c
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x467c
callq 0x3290
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x468b
callq 0x3290
movq %rbx, %rdi
callq 0x3410
nop