// File: /workspace/github_cpp_makefile_star2_O3/cmaureir[P]strip-packing/scattersearch.cpp
// Function: solutions_improvement2(std::vector<solution, std::allocator<solution>>)
vector<solution> solutions_improvement2(vector<solution> tmp)
{
    //cout << "solutions_improvement2()" << endl;

    vector<solution> candidates, final;
    solution tmp_sol;
    for (int i = 0; i < tmp.size(); i++) {

        int j = 0, v = 0, diff = 0;
        candidates.clear();
        tmp_sol = tmp[i];
        while(j < (int)tmp_sol.items.size()/3)
        {
            tmp_sol = shift_left(tmp_sol);
            fitness_calculation_one(tmp_sol);
            if(abs(tmp[i].fitness - tmp_sol.fitness) > diff)
            {
                diff = abs(tmp[i].fitness - tmp_sol.fitness);
                v = j;
            }
            j++;
            candidates.push_back(tmp_sol);
        }
        final.push_back(candidates[v]);
    }
    return final;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
xorl %eax, %eax
movq %rax, 0x80(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq %rax, 0x10(%rdi)
movq %rdi, 0x8(%rsp)
movups %xmm0, (%rdi)
movq %rax, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x8(%rsi), %rax
cmpq (%rsi), %rax
je 0x882f
movq %rsi, %r14
leaq 0x28(%rsp), %r15
leaq 0x10(%rsp), %r13
xorl %ebx, %ebx
movq %rsi, 0x100(%rsp)
movq 0x70(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0xc2ea
movq %rbx, 0xf8(%rsp)
leaq (%rbx,%rbx,2), %rcx
shlq $0x5, %rcx
movq (%r14), %rbx
movq %rcx, 0x108(%rsp)
addq %rcx, %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x53a2
leaq 0x18(%rbx), %rsi
movq %r15, %rdi
callq 0x53a2
leaq 0x30(%rbx), %rsi
leaq 0x40(%rsp), %rdi
callq 0x53a2
movq 0x58(%rbx), %rax
movq %rax, 0x40(%r15)
movups 0x48(%rbx), %xmm0
movups %xmm0, 0x30(%r15)
xorl %ebp, %ebp
movl $0x0, (%rsp)
movl $0x0, 0x4(%rsp)
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
shrq $0x2, %rax
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
cmpl %eax, %ebp
jge 0x87d0
leaq 0x90(%rsp), %rdi
movq %r13, %rsi
callq 0x4fa6
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
callq 0x4fa6
leaq 0xc0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x4fa6
movq 0x40(%r15), %rax
leaq 0xa8(%rsp), %rcx
movq %rax, 0x40(%rcx)
movups 0x30(%r15), %xmm0
movups %xmm0, 0x30(%rcx)
movq 0x90(%rsp), %rbx
movq 0x98(%rsp), %r12
movq %r12, %r14
subq %rbx, %r14
movq %r14, %rax
shrq $0x2, %rax
movl (%rbx), %r15d
testl %eax, %eax
jle 0x85ec
leaq 0x4(%rbx), %rsi
movq %r14, %rdx
movabsq $0x1fffffffc, %rax      # imm = 0x1FFFFFFFC
andq %rax, %rdx
movq %rbx, %rdi
callq 0x43f0
shlq $0x1e, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
sarq $0x1e, %r14
movl %r15d, (%rbx,%r14)
movq 0xa0(%rsp), %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
xorl %esi, %esi
movq %rsi, 0xa0(%rsp)
movups 0xa8(%rsp), %xmm2
movq 0xb8(%rsp), %r15
leaq 0xa8(%rsp), %rdx
movq %rsi, 0x10(%rdx)
movups %xmm0, (%rdx)
movaps 0xc0(%rsp), %xmm1
movaps %xmm1, 0x140(%rsp)
movq 0xd0(%rsp), %r14
leaq 0xc0(%rsp), %rcx
movq %rsi, 0x10(%rcx)
movups %xmm0, (%rcx)
movq 0x40(%rdx), %rcx
movq %rcx, 0x120(%rsp)
movups 0x30(%rdx), %xmm0
movaps %xmm0, 0x110(%rsp)
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rbx, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %rax, 0x20(%rsp)
testq %rdi, %rdi
je 0x86b6
subq %rdi, %rsi
movaps %xmm2, 0x130(%rsp)
callq 0x4290
movaps 0x130(%rsp), %xmm2
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rsi
movups %xmm2, 0x28(%rsp)
movq %r15, 0x38(%rsp)
testq %rdi, %rdi
je 0x86d7
subq %rdi, %rsi
callq 0x4290
movq 0x40(%rsp), %rdi
movq 0x50(%rsp), %rsi
movaps 0x140(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq %r14, 0x50(%rsp)
testq %rdi, %rdi
leaq 0x28(%rsp), %r15
je 0x8705
subq %rdi, %rsi
callq 0x4290
movq 0x120(%rsp), %rax
movq %rax, 0x40(%r15)
movaps 0x110(%rsp), %xmm0
movups %xmm0, 0x30(%r15)
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
movq 0x100(%rsp), %r14
je 0x8743
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x8760
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x877d
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq %r13, %rdi
callq 0x7234
movq (%r14), %rax
movq 0x108(%rsp), %rcx
movss 0x50(%rax,%rcx), %xmm0
subss 0x60(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl 0x4(%rsp), %xmm1
andps 0x48f4(%rip), %xmm0     # 0xd0a0
ucomiss %xmm1, %xmm0
jbe 0x87bc
cvttss2si %xmm0, %eax
movl %eax, 0x4(%rsp)
movl %ebp, (%rsp)
incl %ebp
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x8c66
jmp 0x8535
movslq (%rsp), %rax
leaq (%rax,%rax,2), %rsi
shlq $0x5, %rsi
addq 0x70(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x8c66
movq 0x8(%r14), %rax
subq (%r14), %rax
movq 0xf8(%rsp), %rbx
incq %rbx
sarq $0x5, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cmpq %rbx, %rax
ja 0x84c1
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x882f
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8846
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x885d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
leaq 0x70(%rsp), %rdi
callq 0x4e5a
movq 0x8(%rsp), %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x88c6
jmp 0x88c6
movq %rax, %rbx
jmp 0x88a7
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x88a7
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x88c9
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
jmp 0x88c9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4f60
movq 0x8(%rsp), %rdi
callq 0x4e5a
leaq 0x70(%rsp), %rdi
callq 0x4e5a
movq %rbx, %rdi
callq 0x4450