// File: /workspace/github_cpp_makefile_star2_O1/cmaureir[P]strip-packing/main.cpp
// Function: main
int main(int argc, char *argv[]) {

    // Configuration
    string path;
    if(!check_flags(argc,argv,path)){
        return 1;
    }
    read_input_file(path);

    // Algorithm
    //int iteration = 0;
    //int loop;
    int watch_best;
    int best_fitness;

    solutions_generation(sols);
    fitness_calculation(sols);

    solutions_improvement(sols);
    refset_build();

    save_best_solution(refset);
    refset_tmp = refset;

    do {
        // number of new solutions in the RefSet
        loop = 0;
        while (get_difference(refset_tmp,refset) != 0)
        {
            refset_tmp = refset;
            solutions_combination();
            fitness_calculation(new_set);
            new_set = solutions_improvement2(new_set);
            //solutions_improvement(new_set);
            refset_modification(new_set);
            loop++;
        }
        save_best_solution(refset);

        /* A: If we find the optimal, stop */
        if(best.p == 100){
            iteration = max_iter;
        }
        /* A: end */

        refset_rebuild();
        iteration++;
        print_one_solution(best);
        //print_strip(best);
        //print_tikz(best);
    } while (iteration < max_iter);
    //print_one_solution(best);
    //print_strip(best);
    print_tikz(best);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rsp, %rdx
callq 0x55ec
movl $0x1, %ebx
testb %al, %al
je 0x4c58
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x5068
leaq 0x30(%rsp), %rdi
callq 0x5a7f
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x48b6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4290
leaq 0xd9db(%rip), %rdi      # 0x12298
callq 0x73e4
leaq 0xd9cf(%rip), %rdi      # 0x12298
callq 0x738e
leaq 0xd9c3(%rip), %rdi      # 0x12298
callq 0x7758
callq 0x786e
leaq 0xd9ca(%rip), %rsi      # 0x122b0
leaq 0xe8(%rsp), %rdi
callq 0x4dda
leaq 0xe8(%rsp), %rdi
callq 0x791c
leaq 0xe8(%rsp), %rdi
callq 0x4e76
leaq 0xd9b4(%rip), %rdi      # 0x122c8
leaq 0xd995(%rip), %rsi      # 0x122b0
callq 0x4ea6
xorl %eax, %eax
leaq 0xda53(%rip), %rcx      # 0x1237c
leaq 0x1c0(%rsp), %r12
leaq 0x1a8(%rsp), %rbp
leaq 0xd9b8(%rip), %rdx      # 0x122f8
leaq 0x18(%rdx), %rsi
movq %rsi, 0x28(%rsp)
addq $0x30, %rdx
movq %rdx, 0x20(%rsp)
leaq 0xd987(%rip), %r14      # 0x122e0
movq %rcx, %r15
movl %eax, (%rcx)
movq %r12, %rdi
leaq 0xd960(%rip), %rsi      # 0x122c8
callq 0x4dda
movq %rbp, %rdi
leaq 0xd939(%rip), %rsi      # 0x122b0
callq 0x4dda
movq %r12, %rdi
movq %rbp, %rsi
callq 0x88e7
movl %eax, %ebx
movq %rbp, %rdi
callq 0x4e76
movq %r12, %rdi
callq 0x4e76
testl %ebx, %ebx
je 0x4a78
leaq 0xd920(%rip), %rdi      # 0x122c8
leaq 0xd901(%rip), %rsi      # 0x122b0
callq 0x4ea6
callq 0x7982
movq %r14, %rdi
callq 0x738e
leaq 0x190(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4dda
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x82ce
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movups (%r14), %xmm0
movq 0x10(%r14), %rax
movups 0x70(%rsp), %xmm1
movups %xmm1, (%r14)
movq 0x80(%rsp), %rcx
movq %rcx, 0x10(%r14)
movaps 0x50(%rsp), %xmm1
movaps %xmm0, 0x50(%rsp)
movq %rax, 0x60(%rsp)
movups %xmm1, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x4e76
movq %r13, %rdi
callq 0x4e76
movq %rbx, %rdi
callq 0x4e76
leaq 0x178(%rsp), %rdi
movq %r14, %rsi
callq 0x4dda
leaq 0x178(%rsp), %rbx
movq %rbx, %rdi
callq 0x8126
movq %rbx, %rdi
callq 0x4e76
movq %r15, %rcx
movl (%r15), %eax
incl %eax
jmp 0x4959
leaq 0x160(%rsp), %rdi
leaq 0xd829(%rip), %rsi      # 0x122b0
callq 0x4dda
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
callq 0x791c
movq %rbx, %rdi
callq 0x4e76
leaq 0xd84d(%rip), %rax      # 0x122f8
movss 0x48(%rax), %xmm0
ucomiss 0x854d(%rip), %xmm0     # 0xd004
jne 0x4ac8
jp 0x4ac8
leaq 0xd8b6(%rip), %rax      # 0x12378
movl $0x64, (%rax)
callq 0x87a4
leaq 0xd8a4(%rip), %rax      # 0x12378
incl (%rax)
leaq 0x88(%rsp), %rdi
leaq 0xd813(%rip), %rsi      # 0x122f8
callq 0x4fc2
leaq 0xa0(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x4fc2
leaq 0xb8(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4fc2
leaq 0xd7e3(%rip), %rdx      # 0x122f8
movq 0x58(%rdx), %rax
leaq 0xa0(%rsp), %rcx
movq %rax, 0x40(%rcx)
movups 0x48(%rdx), %xmm0
movups %xmm0, 0x30(%rcx)
leaq 0x88(%rsp), %rdi
callq 0x5e03
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x4b57
movq 0xc8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4b74
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x4b91
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
leaq 0xd7e0(%rip), %rax      # 0x12378
cmpl $0x64, (%rax)
movl $0x0, %eax
movq %r15, %rcx
jl 0x4959
leaq 0xd748(%rip), %rbx      # 0x122f8
leaq 0x100(%rsp), %rdi
movq %rbx, %rsi
callq 0x4fc2
leaq 0x118(%rsp), %rdi
leaq 0x18(%rbx), %rsi
callq 0x4fc2
leaq 0x130(%rsp), %rdi
leaq 0x30(%rbx), %rsi
callq 0x4fc2
movq 0x58(%rbx), %rax
leaq 0x100(%rsp), %rdi
movq %rax, 0x58(%rdi)
movups 0x48(%rbx), %xmm0
movups %xmm0, 0x48(%rdi)
callq 0x5efd
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x4c1c
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x4c39
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x100(%rsp), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x4c58
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4c73
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4290
movl %ebx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
jmp 0x4d6b
movq %rax, %rbx
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x4cbc
movq 0x128(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
jmp 0x4cbc
movq %rax, %rbx
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x4db7
movq 0x110(%rsp), %rsi
jmp 0x4d56
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
jmp 0x4dab
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x4db7
movq 0x40(%rsp), %rsi
incq %rsi
jmp 0x4d59
jmp 0x4db4
jmp 0x4db4
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
jmp 0x4dab
movq %rax, %rbx
jmp 0x4d41
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d41
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x4db7
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
jmp 0x4db7
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4f7c
jmp 0x4db7
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
jmp 0x4dab
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
jmp 0x4dab
jmp 0x4db4
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x4e76
jmp 0x4da3
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x4e76
jmp 0x4db7
jmp 0x4db4
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4dd2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4290
movq %rbx, %rdi
callq 0x4450