// File: /workspace/github_cpp_makefile_star2_O2/cmaureir[P]strip-packing/scattersearch.cpp
// Function: print_tikz(solution)
void print_tikz(solution sol){

 const string colors[] ={
        "blue",
        "brown",
        "cyan",
        "gray",
        "green",
        "magenta",
        "orange",
        "purple",
        "red",
        "violet",
        "yellow"};

    time_t ltime;
    struct tm *Tm;
    ltime = time(NULL);
    Tm = localtime(&ltime);

    stringstream ss;
    ss << "diagrams/";
    ss << Tm->tm_mday << "-";
    ss << Tm->tm_mon + 1  << "-";
    ss << Tm->tm_year + 1900 << "_";
    ss << Tm->tm_hour << "-";
    ss << Tm->tm_min << "-";
    ss << Tm->tm_sec << ".tex";

    string path = ss.str();
    ofstream file(path.c_str());
    file << "\\documentclass[dvipsnames]{article}\n";
    file << "\\usepackage[pdftex,active,tightpage]{preview}\n";
    file << "\\usepackage[utf8]{inputenc}\n";
    file << "\\usepackage{tikz}\n";
    file << "\\PreviewEnvironment{tikzpicture}\n";
    file << "\n";
    file << "\\begin{document}\n";
    file << "  \\begin{tikzpicture}[scale=0.75]\n";
    file << "    \\begin{scope}\n";

    file << "       \\draw (0 ," << sol.fitness << ") -- (0,0) -- (" << strip_width << ",0) -- (" << strip_width << "," << sol.fitness << ");\n";
    for (int i = 0; i < (int)sol.items.size(); i++) {
        file << "           \\filldraw["<<colors[i%11]<<",draw=black] (" << sol.a[i] << "," << sol.b[i] << ") rectangle (" << sol.a[i] + bs[sol.items[i]-1].width << "," << sol.b[i] + bs[sol.items[i]-1].height << ");\n";
        file << "           \\draw (" << sol.a[i] +  bs[sol.items[i]-1].width/2.0 << "," << sol.b[i] + bs[sol.items[i]-1].height/2.0 << ") node {" << sol.items[i] << "};\n";
        file << "\n";
    }

    file << "     \\end{scope}\n";
    file << "  \\end{tikzpicture}\n";
    file << "\\end{document}\n";

    file.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x518, %rsp            # imm = 0x518
movq %rdi, %r14
leaq 0x5930(%rip), %rsi      # 0xb0db
leaq 0x230(%rsp), %rbx
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x7286
leaq 0x250(%rsp), %r15
leaq 0x5911(%rip), %rsi      # 0xb0e0
leaq 0x390(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x270(%rsp), %r15
leaq 0x58f8(%rip), %rsi      # 0xb0e6
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x290(%rsp), %r15
leaq 0x58e1(%rip), %rsi      # 0xb0eb
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x2b0(%rsp), %r15
leaq 0x58ca(%rip), %rsi      # 0xb0f0
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x2d0(%rsp), %r15
leaq 0x58b4(%rip), %rsi      # 0xb0f6
leaq 0x6(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x2f0(%rsp), %r15
leaq 0x58a0(%rip), %rsi      # 0xb0fe
leaq 0x5(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x310(%rsp), %r15
leaq 0x588b(%rip), %rsi      # 0xb105
leaq 0x4(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x330(%rsp), %r15
leaq 0x5876(%rip), %rsi      # 0xb10c
leaq 0x3(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x350(%rsp), %r15
leaq 0x585e(%rip), %rsi      # 0xb110
leaq 0x2(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
leaq 0x370(%rsp), %r15
leaq 0x5849(%rip), %rsi      # 0xb117
leaq 0x1(%rsp), %rdx
movq %r15, %rdi
callq 0x7286
xorl %edi, %edi
callq 0x4220
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x4190
movq %rax, %r15
leaq 0x390(%rsp), %rdi
callq 0x4160
leaq 0x3a0(%rsp), %r12
leaq 0x5810(%rip), %rsi      # 0xb11e
movq %r12, %rdi
callq 0x4240
movl 0xc(%r15), %esi
movq %r12, %rdi
callq 0x4410
leaq 0x57ff(%rip), %rsi      # 0xb128
movq %rax, %rdi
callq 0x4240
movl 0x10(%r15), %esi
incl %esi
movq %r12, %rdi
callq 0x4410
leaq 0x57e2(%rip), %rsi      # 0xb128
movq %rax, %rdi
callq 0x4240
movl $0x76c, %esi            # imm = 0x76C
addl 0x14(%r15), %esi
movq %r12, %rdi
callq 0x4410
leaq 0x57c4(%rip), %rsi      # 0xb12a
movq %rax, %rdi
callq 0x4240
movl 0x8(%r15), %esi
movq %r12, %rdi
callq 0x4410
leaq 0x57a7(%rip), %rsi      # 0xb128
movq %rax, %rdi
callq 0x4240
movl 0x4(%r15), %esi
movq %r12, %rdi
callq 0x4410
leaq 0x578c(%rip), %rsi      # 0xb128
movq %rax, %rdi
callq 0x4240
movl (%r15), %esi
movq %r12, %rdi
callq 0x4410
leaq 0x5776(%rip), %rsi      # 0xb12c
movq %rax, %rdi
callq 0x4240
leaq 0x3a8(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x43c0
movq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x4280
leaq 0x5748(%rip), %rsi      # 0xb131
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x575c(%rip), %rsi      # 0xb156
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x577a(%rip), %rsi      # 0xb185
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x5786(%rip), %rsi      # 0xb1a2
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x5788(%rip), %rsi      # 0xb1b5
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x5805(%rip), %rsi      # 0xb243
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x5788(%rip), %rsi      # 0xb1d7
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x5789(%rip), %rsi      # 0xb1e9
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x579b(%rip), %rsi      # 0xb20c
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x579d(%rip), %rsi      # 0xb21f
leaq 0x30(%rsp), %rdi
callq 0x4240
movss 0x50(%r14), %xmm0
movq %rax, %rdi
callq 0x41a0
leaq 0x5790(%rip), %rsi      # 0xb231
movq %rax, %rdi
callq 0x4240
movl 0xb8c1(%rip), %esi      # 0x11370
movq %rax, %rdi
callq 0x4410
leaq 0x577a(%rip), %rsi      # 0xb238
movq %rax, %rdi
callq 0x4240
movl 0xb8a4(%rip), %esi      # 0x11370
movq %rax, %rdi
callq 0x4410
leaq 0x5754(%rip), %rsi      # 0xb22f
movq %rax, %rdi
callq 0x4240
movss 0x50(%r14), %xmm0
movq %rax, %rdi
callq 0x41a0
leaq 0x5749(%rip), %rsi      # 0xb241
movq %rax, %rdi
callq 0x4240
xorl %r15d, %r15d
leaq 0x30(%rsp), %r13
leaq 0x5720(%rip), %r12      # 0xb22f
movq %r15, %rax
xorl %edx, %edx
pushq $0xb
popq %rcx
divq %rcx
movq %rax, %rbp
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x2, %rax
cltq
cmpq %rax, %r15
jge 0x5cd1
movq %r13, %rdi
leaq 0x5708(%rip), %rsi      # 0xb245
callq 0x4240
imulq $-0x160, %rbp, %rsi     # imm = 0xFEA0
addq %rbx, %rsi
movq %rax, %rdi
callq 0x4200
movq %rax, %rdi
leaq 0x56fd(%rip), %rsi      # 0xb25b
callq 0x4240
movq 0x18(%r14), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x4410
movq %rax, %rdi
movq %r12, %rsi
callq 0x4240
movq 0x30(%r14), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x4410
movq %rax, %rdi
leaq 0x56d2(%rip), %rsi      # 0xb26a
callq 0x4240
movq (%r14), %rcx
movq 0x18(%r14), %rdx
movslq (%rcx,%r15,4), %rcx
movq 0xb7a9(%rip), %rsi      # 0x11358
imulq $0xc, %rcx, %rcx
movl -0x4(%rsi,%rcx), %esi
addl (%rdx,%r15,4), %esi
movq %rax, %rdi
callq 0x4410
movq %rax, %rdi
movq %r12, %rsi
callq 0x4240
movq (%r14), %rcx
movq 0x30(%r14), %rdx
movslq (%rcx,%r15,4), %rcx
movq 0xb778(%rip), %rsi      # 0x11358
imulq $0xc, %rcx, %rcx
movl -0x8(%rsi,%rcx), %esi
addl (%rdx,%r15,4), %esi
movq %rax, %rdi
callq 0x4410
movq %rax, %rdi
leaq 0x5643(%rip), %rsi      # 0xb241
callq 0x4240
movq %r13, %rdi
leaq 0x566b(%rip), %rsi      # 0xb278
callq 0x4240
movq 0x18(%r14), %rcx
cvtsi2sdl (%rcx,%r15,4), %xmm1
movq (%r14), %rcx
movslq (%rcx,%r15,4), %rcx
movq 0xb72e(%rip), %rdx      # 0x11358
imulq $0xc, %rcx, %rcx
cvtsi2sdl -0x4(%rdx,%rcx), %xmm0
mulsd 0x53cc(%rip), %xmm0     # 0xb008
addsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x43d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x4240
movq 0x30(%r14), %rcx
cvtsi2sdl (%rcx,%r15,4), %xmm1
movq (%r14), %rcx
movslq (%rcx,%r15,4), %rcx
movq 0xb6ed(%rip), %rdx      # 0x11358
imulq $0xc, %rcx, %rcx
cvtsi2sdl -0x8(%rdx,%rcx), %xmm0
mulsd 0x538b(%rip), %xmm0     # 0xb008
addsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x43d0
movq %rax, %rdi
leaq 0x55f8(%rip), %rsi      # 0xb28b
callq 0x4240
movq (%r14), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x4410
movq %rax, %rdi
leaq 0x55e3(%rip), %rsi      # 0xb294
callq 0x4240
movq %r13, %rdi
leaq 0x5583(%rip), %rsi      # 0xb243
callq 0x4240
incq %r15
addq $0x20, %rbx
jmp 0x5b0f
leaq 0x55c0(%rip), %rsi      # 0xb298
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x55c1(%rip), %rsi      # 0xb2aa
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x55c5(%rip), %rsi      # 0xb2bf
leaq 0x30(%rsp), %rdi
callq 0x4240
leaq 0x30(%rsp), %rdi
callq 0x4340
leaq 0x30(%rsp), %rdi
callq 0x4360
leaq 0x10(%rsp), %rdi
callq 0x40f0
leaq 0x390(%rsp), %rdi
callq 0x41b0
movl $0x140, %ebx            # imm = 0x140
leaq (%rsp,%rbx), %rdi
addq $0x230, %rdi            # imm = 0x230
callq 0x40f0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x5d34
addq $0x518, %rsp            # imm = 0x518
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x5da8
jmp 0x5d94
movq %rax, %r14
jmp 0x5dbf
jmp 0x5d7e
jmp 0x5d7e
jmp 0x5d7e
jmp 0x5d7e
jmp 0x5d7e
jmp 0x5d7e
jmp 0x5d7e
jmp 0x5d7e
jmp 0x5d7e
movq %rax, %r14
addq $-0x20, %r15
movq %r15, %rdi
callq 0x40f0
cmpq %rbx, %r15
jne 0x5d81
jmp 0x5dde
movq %rax, %r14
jmp 0x5db2
jmp 0x5d9b
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x4360
leaq 0x10(%rsp), %rdi
callq 0x40f0
leaq 0x390(%rsp), %rdi
callq 0x41b0
movl $0x140, %ebx            # imm = 0x140
leaq (%rsp,%rbx), %rdi
addq $0x230, %rdi            # imm = 0x230
callq 0x40f0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x5dc4
movq %r14, %rdi
callq 0x4440