// File: 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
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl 0x1832b(%rip), %eax     # 0x22420
imull $0x75bcd15, %eax, %edi  # imm = 0x75BCD15
callq 0x42c0
movq -0x8(%rbp), %rdi
callq 0xbd70
leaq 0x182f0(%rip), %rdi     # 0x22400
callq 0xbc50
movq %rax, %rcx
movq %rcx, %rax
movq %rsp, %rdx
movq %rdx, -0x20(%rbp)
leaq 0xf(,%rcx,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0xb8(%rbp)
movq %rcx, %rsp
movq %rax, -0x28(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0xbc(%rbp)
leaq 0x182a7(%rip), %rdi     # 0x22400
callq 0xbc50
movq %rax, %rcx
movl -0xbc(%rbp), %eax
cmpl %ecx, %eax
jge 0xa18a
movq -0xb8(%rbp), %rax
movl -0xc(%rbp), %edx
addl $0x1, %edx
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xa149
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x1828e(%rip), %eax     # 0x22428
jge 0xa408
movslq 0x18271(%rip), %rax     # 0x22418
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x4030
movq %rax, -0x38(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x1823c(%rip), %eax     # 0x22418
jge 0xa259
movslq 0x18237(%rip), %rax     # 0x2241c
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x4030
movq %rax, %rdx
movq -0x38(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0x181f7(%rip), %eax     # 0x2241c
jge 0xa249
movq -0x38(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa21c
jmp 0xa24b
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xa1d3
leaq -0x98(%rbp), %rdi
callq 0xb750
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0xc0(%rbp)
leaq 0x18184(%rip), %rdi     # 0x22400
callq 0xbc50
movq %rax, %rcx
movl -0xc0(%rbp), %eax
cmpl %ecx, %eax
jge 0xa30d
movslq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
callq 0x40b0
cltq
movq %rax, -0xc8(%rbp)
leaq 0x18152(%rip), %rdi     # 0x22400
callq 0xbc50
movq -0xd0(%rbp), %rcx
movq %rax, %rsi
movq -0xc8(%rbp), %rax
movslq -0x10(%rbp), %rdx
subq %rdx, %rsi
xorl %edx, %edx
divq %rsi
movq -0xb8(%rbp), %rax
addq %rdx, %rcx
movl %ecx, -0x18(%rbp)
movslq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, -0x2c(%rbp)
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movslq -0x10(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %edx
movslq -0x18(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xa26c
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0xd4(%rbp)
leaq 0x180dc(%rip), %rdi     # 0x22400
callq 0xbc50
movq %rax, %rcx
movl -0xd4(%rbp), %eax
cmpl %ecx, %eax
jge 0xa3bf
movq -0xb8(%rbp), %rax
movslq -0x10(%rbp), %rcx
leaq (%rax,%rcx,4), %rsi
leaq -0x98(%rbp), %rdi
callq 0xbd90
jmp 0xa357
leaq -0x80(%rbp), %rdi
movl $0x0, -0xa8(%rbp)
leaq -0xa8(%rbp), %rsi
callq 0xbe00
jmp 0xa373
leaq -0x68(%rbp), %rdi
movl $0x0, -0xac(%rbp)
leaq -0xac(%rbp), %rsi
callq 0xbe00
jmp 0xa38f
jmp 0xa391
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xa314
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x5250
jmp 0xa414
movl $0xbf800000, -0x48(%rbp) # imm = 0xBF800000
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xbe30
jmp 0xa3ee
leaq -0x98(%rbp), %rdi
callq 0x5250
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xa191
movq -0x20(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x4550