// File: /workspace/github_cpp_makefile_star2_O1/cmaureir[P]strip-packing/scattersearch.cpp
// Function: solutions_generation(std::vector<solution, std::allocator<solution>>&)
void solutions_generation(vector<solution> &soluciones)
{
    //cout << "solutions_generation()" << endl;
    // Fixed seed
    srand(123456789*iteration);
    soluciones.clear();

    int i, j, k, r;
    int ids[bs.size()];
    int tmp;

    // Sorted sequence of the rectangles
    for (i = 0; i < (int)bs.size(); i++) ids[i] = i+1;

    // Shuffling rectangles order
    for (i = 0; i < popsize; i++) {

        // filling strip with 0
        int **strip_tmp;
        strip_tmp = new int*[strip_width];
        for (j = 0; j < strip_width; j++) {
            strip_tmp[j] = new int[strip_height];
            for (k = 0; k < strip_height; k++) {
                strip_tmp[j][k] = 0;
            }
        }

        solution tmp_sol;
        for (j = 0; j < (int)bs.size(); j++) {
            r = j + (rand() % (bs.size()-j));
            tmp = ids[j];
            ids[j] = ids[r];
            ids[r] = tmp;
        }

        // Adding shuffled rectangles on the solutions structure
        for (j = 0; j < (int)bs.size(); j++) {
            tmp_sol.items.push_back(ids[j]);
            tmp_sol.a.push_back(0);
            tmp_sol.b.push_back(0);
        }

        // tmp solution fitness
        tmp_sol.fitness = -1.0;
        tmp_sol.height  = 0;
        tmp_sol.p = 0.0;
        tmp_sol.strip = strip_tmp;

        soluciones.push_back(tmp_sol);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
imull $0x75bcd15, 0xaf73(%rip), %edi # imm = 0x75BCD15
callq 0x4250
movq (%rbx), %rsi
movq %rbx, -0xb0(%rbp)
movq %rbx, %rdi
callq 0xc2fc
movq 0xaf3d(%rip), %rax      # 0x12360
subq 0xaf2e(%rip), %rax      # 0x12358
sarq $0x2, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
movq %rsp, %r12
subq %rcx, %r12
movq %r12, %rsp
testl %eax, %eax
jle 0x746c
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
leaq 0x1(%rcx), %rdx
movl %edx, (%r12,%rcx,4)
movq %rdx, %rcx
cmpq %rdx, %rax
jne 0x745c
cmpb $0x1, 0xaf0d(%rip)      # 0x12380
jne 0x772c
movq $0x0, -0x38(%rbp)
movq %r12, -0xa8(%rbp)
movslq 0xaee1(%rip), %r12      # 0x12370
leaq (,%r12,8), %rdi
testq %r12, %r12
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x4030
movq %rax, -0x40(%rbp)
testq %r12, %r12
jle 0x7503
movslq 0xaeba(%rip), %rbx      # 0x12374
leaq (,%rbx,4), %r14
testq %rbx, %rbx
movq $-0x1, %rax
cmovsq %rax, %r14
movl %ebx, %r15d
shlq $0x2, %r15
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x4030
movq -0x40(%rbp), %rcx
movq %rax, (%rcx,%r13,8)
testl %ebx, %ebx
jle 0x74fb
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x4150
incq %r13
cmpq %r13, %r12
jne 0x74da
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
movq 0xae3d(%rip), %rax      # 0x12360
subq 0xae2e(%rip), %rax      # 0x12358
movq $0x0, -0x60(%rbp)
shrq $0x2, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
movq -0xa8(%rbp), %r12
jle 0x75b7
xorl %r14d, %r14d
xorl %r15d, %r15d
callq 0x40a0
cltq
movq 0xadfb(%rip), %rcx      # 0x12360
subq 0xadec(%rip), %rcx      # 0x12358
sarq $0x2, %rcx
imulq %rbx, %rcx
addq %r14, %rcx
xorl %edx, %edx
divq %rcx
addl %r15d, %edx
movl (%r12,%r15,4), %eax
movslq %edx, %rcx
movl (%r12,%rcx,4), %edx
movl %edx, (%r12,%r15,4)
movl %eax, (%r12,%rcx,4)
incq %r15
movq 0xadc4(%rip), %rax      # 0x12360
subq 0xadb5(%rip), %rax      # 0x12358
shrq $0x2, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
decq %r14
cmpq %rax, %r15
jl 0x7557
movq 0xada2(%rip), %rax      # 0x12360
subq 0xad93(%rip), %rax      # 0x12358
shrq $0x2, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
leaq -0x88(%rbp), %rbx
leaq -0x70(%rbp), %r13
jle 0x769d
movq %r12, %r14
xorl %r15d, %r15d
movq -0x98(%rbp), %rsi
cmpq -0x90(%rbp), %rsi
je 0x760a
movl (%r14), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x98(%rbp)
jmp 0x7619
leaq -0xa0(%rbp), %rdi
movq %r14, %rdx
callq 0xc32c
movl $0x0, -0x2c(%rbp)
movq -0x80(%rbp), %rsi
cmpq -0x78(%rbp), %rsi
je 0x763a
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x80(%rbp)
jmp 0x7646
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
callq 0xc44c
movl $0x0, -0x2c(%rbp)
movq -0x68(%rbp), %rsi
cmpq -0x60(%rbp), %rsi
je 0x7667
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x68(%rbp)
jmp 0x7673
movq %r13, %rdi
leaq -0x2c(%rbp), %rdx
callq 0xc44c
incq %r15
movq 0xace3(%rip), %rax      # 0x12360
subq 0xacd4(%rip), %rax      # 0x12358
shrq $0x2, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cltq
addq $0x4, %r14
cmpq %rax, %r15
jl 0x75e8
movl $0xbf800000, -0x50(%rbp) # imm = 0xBF800000
movq $0x0, -0x58(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x8b20
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x76dc
movq -0x60(%rbp), %rsi
subq %rdi, %rsi
callq 0x4290
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x76f4
movq -0x78(%rbp), %rsi
subq %rdi, %rsi
callq 0x4290
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x770f
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0x4290
cmpb $0x1, 0xac6a(%rip)      # 0x12380
jne 0x772c
movq -0x38(%rbp), %rcx
leal 0x1(%rcx), %eax
cmpl $0x31, %ecx
movq %rax, -0x38(%rbp)
jb 0x7488
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7741
jmp 0x7741
jmp 0x7741
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x4f7c
movq %rbx, %rdi
callq 0x4450