// File: cmaureir[P]strip-packing/scattersearch.cpp
// Function: refset_rebuild()
void refset_rebuild()
{
    //cout << "refset_rebuild()" << endl;
    // Removing the worst b/2 solutions
    sort_solutions(refset);
    refset.erase(refset.end()-(b/2), refset.end());

    // Generating «popsize» best random + local search
    vector<solution> new_sols;
    solutions_generation(new_sols);
    fitness_calculation(new_sols);
    new_sols = solutions_improvement2(new_sols);

    // Choosing the b/2 worst solutions
    sort_solutions(new_sols);
    refset.erase(refset.begin(),refset.end()-(b/2));

    for (int i = 0; i < (b/2); i++)
    {
        refset.push_back(new_sols[i]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
leaq 0x16f26(%rip), %rdi     # 0x22358
movq %rdi, -0xd0(%rbp)
callq 0x9b20
movq -0xd0(%rbp), %rdi
callq 0x6510
movq %rax, -0x18(%rbp)
movl 0x16ed4(%rip), %eax     # 0x22328
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movslq %eax, %rsi
leaq -0x18(%rbp), %rdi
callq 0xc120
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0xc160
movq -0xd0(%rbp), %rdi
callq 0x6510
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xc160
movq -0xd0(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xc090
movq %rax, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0xb730
movq -0xc8(%rbp), %rdi
callq 0xa0e0
jmp 0xb4cd
leaq -0x48(%rbp), %rdi
callq 0xa080
jmp 0xb4d8
leaq -0x88(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4dc0
jmp 0xb4ea
leaq -0x70(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xb130
jmp 0xb4fc
leaq -0x48(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
leaq -0x70(%rbp), %rsi
movq %rsi, -0xe0(%rbp)
callq 0x5160
movq -0xe0(%rbp), %rdi
callq 0x4eb0
leaq -0x88(%rbp), %rdi
callq 0x4eb0
movq -0xd8(%rbp), %rdi
callq 0x9b20
jmp 0xb53d
leaq 0x16e14(%rip), %rdi     # 0x22358
movq %rdi, -0xf0(%rbp)
callq 0x64e0
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xc160
movq -0xf0(%rbp), %rdi
callq 0x6510
movq %rax, -0xb0(%rbp)
movl 0x16da5(%rip), %eax     # 0x22328
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movslq %eax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0xc120
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xc160
movq -0xf0(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0xa0(%rbp), %rdx
callq 0xc090
movq %rax, -0xe8(%rbp)
jmp 0xb5d8
movq -0xe8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, -0xf4(%rbp)
movl 0x16d26(%rip), %eax     # 0x22328
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xf4(%rbp), %eax
cmpl %ecx, %eax
jge 0xb672
movslq -0xbc(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0xbd00
movq %rax, %rsi
leaq 0x16d28(%rip), %rdi     # 0x22358
callq 0xbe30
jmp 0xb637
jmp 0xb639
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0xb5f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0xb684
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x4eb0
jmp 0xb684
leaq -0x48(%rbp), %rdi
callq 0x4eb0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x4eb0
movq -0x50(%rbp), %rdi
callq 0x4550
nopw %cs:(%rax,%rax)