// File: /workspace/github_cpp_makefile_star2_O3/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 0x55e4
movl $0x1, %ebx
testb %al, %al
je 0x4c45
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x504c
leaq 0x30(%rsp), %rdi
callq 0x5a76
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x48b6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4290
leaq 0xd9db(%rip), %rdi      # 0x12298
callq 0x7535
leaq 0xd9cf(%rip), %rdi      # 0x12298
callq 0x74df
leaq 0xd9c3(%rip), %rdi      # 0x12298
callq 0x7910
callq 0x7a1d
leaq 0xd9ca(%rip), %rsi      # 0x122b0
leaq 0xc8(%rsp), %rdi
callq 0x4dbe
leaq 0xc8(%rsp), %rdi
callq 0x7acb
leaq 0xc8(%rsp), %rdi
callq 0x4e5a
leaq 0xd9b4(%rip), %rdi      # 0x122c8
leaq 0xd995(%rip), %rsi      # 0x122b0
callq 0x4e8a
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 0x4dbe
movq %rbp, %rdi
leaq 0xd939(%rip), %rsi      # 0x122b0
callq 0x4dbe
movq %r12, %rdi
movq %rbp, %rsi
callq 0x8a2c
movl %eax, %ebx
movq %rbp, %rdi
callq 0x4e5a
movq %r12, %rdi
callq 0x4e5a
testl %ebx, %ebx
je 0x4a71
leaq 0xd920(%rip), %rdi      # 0x122c8
leaq 0xd901(%rip), %rsi      # 0x122b0
callq 0x4e8a
callq 0x7b31
movq %r14, %rdi
callq 0x74df
leaq 0x190(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4dbe
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8455
movq 0x10(%r14), %rax
movaps 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rcx
movq %rcx, 0x10(%r14)
movups (%r14), %xmm1
movups %xmm0, (%r14)
movaps %xmm1, 0x140(%rsp)
movq %rax, 0x150(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x4e5a
movq %r13, %rdi
callq 0x4e5a
movq %rbx, %rdi
callq 0x4e5a
leaq 0x178(%rsp), %rdi
movq %r14, %rsi
callq 0x4dbe
leaq 0x178(%rsp), %rbx
movq %rbx, %rdi
callq 0x82bb
movq %rbx, %rdi
callq 0x4e5a
movq %r15, %rcx
movl (%r15), %eax
incl %eax
jmp 0x4959
leaq 0x160(%rsp), %rdi
leaq 0xd830(%rip), %rsi      # 0x122b0
callq 0x4dbe
leaq 0x160(%rsp), %rbx
movq %rbx, %rdi
callq 0x7acb
movq %rbx, %rdi
callq 0x4e5a
leaq 0xd854(%rip), %rax      # 0x122f8
movss 0x48(%rax), %xmm0
ucomiss 0x8554(%rip), %xmm0     # 0xd004
jne 0x4ac1
jp 0x4ac1
leaq 0xd8bd(%rip), %rax      # 0x12378
movl $0x64, (%rax)
callq 0x88ef
leaq 0xd8ab(%rip), %rax      # 0x12378
incl (%rax)
leaq 0x68(%rsp), %rdi
leaq 0xd81d(%rip), %rsi      # 0x122f8
callq 0x4fa6
leaq 0x80(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x4fa6
leaq 0x98(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4fa6
leaq 0xd7ed(%rip), %rdx      # 0x122f8
movq 0x58(%rdx), %rax
leaq 0x80(%rsp), %rcx
movq %rax, 0x40(%rcx)
movups 0x48(%rdx), %xmm0
movups %xmm0, 0x30(%rcx)
leaq 0x68(%rsp), %rdi
callq 0x5dfa
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x4b4a
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x4b67
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x4b7e
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
leaq 0xd7f3(%rip), %rax      # 0x12378
cmpl $0x64, (%rax)
movl $0x0, %eax
movq %r15, %rcx
jl 0x4959
leaq 0xd75b(%rip), %rbx      # 0x122f8
leaq 0xe0(%rsp), %rdi
movq %rbx, %rsi
callq 0x4fa6
leaq 0xf8(%rsp), %rdi
leaq 0x18(%rbx), %rsi
callq 0x4fa6
leaq 0x110(%rsp), %rdi
leaq 0x30(%rbx), %rsi
callq 0x4fa6
movq 0x58(%rbx), %rax
leaq 0xe0(%rsp), %rdi
movq %rax, 0x58(%rdi)
movups 0x48(%rbx), %xmm0
movups %xmm0, 0x48(%rdi)
callq 0x5ef4
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x4c09
movq 0x120(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x4c26
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0xe0(%rsp), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x4c45
movq 0xf0(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4c60
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 0xe0(%rsp), %rdi
jmp 0x4d4f
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x4ca9
movq 0x108(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
jmp 0x4ca9
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x4d9b
movq 0xf0(%rsp), %rsi
jmp 0x4d3d
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
jmp 0x4d8f
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x4d9b
movq 0x40(%rsp), %rsi
incq %rsi
jmp 0x4d40
jmp 0x4d98
jmp 0x4d98
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
jmp 0x4d8f
movq %rax, %rbx
jmp 0x4d2e
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x4d2e
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x4d9b
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x4290
jmp 0x4d9b
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4f60
jmp 0x4d9b
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
jmp 0x4d8f
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
jmp 0x4d8f
jmp 0x4d98
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x4e5a
jmp 0x4d87
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x4e5a
jmp 0x4d9b
jmp 0x4d98
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4db6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4290
movq %rbx, %rdi
callq 0x4450