// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7243(%rip), %rsi      # 0xd15b
leaq 0x7240(%rip), %rdx      # 0xd15f
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x90f8
leaq 0x50(%rsp), %r15
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x721f(%rip), %rsi      # 0xd160
leaq 0x721d(%rip), %rdx      # 0xd165
movq %r15, %rdi
callq 0x90f8
leaq 0x70(%rsp), %r15
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x71fe(%rip), %rsi      # 0xd166
leaq 0x71fb(%rip), %rdx      # 0xd16a
movq %r15, %rdi
callq 0x90f8
leaq 0x90(%rsp), %r15
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x71d9(%rip), %rsi      # 0xd16b
leaq 0x71d6(%rip), %rdx      # 0xd16f
movq %r15, %rdi
callq 0x90f8
leaq 0xb0(%rsp), %r15
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x71b4(%rip), %rsi      # 0xd170
leaq 0x71b2(%rip), %rdx      # 0xd175
movq %r15, %rdi
callq 0x90f8
leaq 0xd0(%rsp), %r15
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7190(%rip), %rsi      # 0xd176
leaq 0x7190(%rip), %rdx      # 0xd17d
movq %r15, %rdi
callq 0x90f8
leaq 0xf0(%rsp), %r15
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x716e(%rip), %rsi      # 0xd17e
leaq 0x716d(%rip), %rdx      # 0xd184
movq %r15, %rdi
callq 0x90f8
leaq 0x110(%rsp), %r15
leaq 0x120(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x714b(%rip), %rsi      # 0xd185
leaq 0x714a(%rip), %rdx      # 0xd18b
movq %r15, %rdi
callq 0x90f8
leaq 0x130(%rsp), %r15
leaq 0x140(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7128(%rip), %rsi      # 0xd18c
leaq 0x7124(%rip), %rdx      # 0xd18f
movq %r15, %rdi
callq 0x90f8
leaq 0x150(%rsp), %r15
leaq 0x160(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x7102(%rip), %rsi      # 0xd190
leaq 0x7101(%rip), %rdx      # 0xd196
movq %r15, %rdi
callq 0x90f8
leaq 0x170(%rsp), %r15
leaq 0x180(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x70de(%rip), %rsi      # 0xd197
leaq 0x70dd(%rip), %rdx      # 0xd19d
movq %r15, %rdi
callq 0x90f8
xorl %edi, %edi
callq 0x4240
leaq 0x28(%rsp), %rdi
movq %rax, (%rdi)
callq 0x41d0
movq %rax, %r14
leaq 0x390(%rsp), %rdi
callq 0x4190
leaq 0x3a0(%rsp), %r15
leaq 0x70a3(%rip), %rsi      # 0xd19e
movl $0x9, %edx
movq %r15, %rdi
callq 0x42e0
movl 0xc(%r14), %esi
movq %r15, %rdi
callq 0x4420
leaq 0x708d(%rip), %rsi      # 0xd1a8
movl $0x1, %edx
movq %rax, %rdi
callq 0x42e0
movl 0x10(%r14), %esi
incl %esi
movq %r15, %rdi
callq 0x4420
leaq 0x706b(%rip), %rsi      # 0xd1a8
movl $0x1, %edx
movq %rax, %rdi
callq 0x42e0
movl $0x76c, %esi            # imm = 0x76C
addl 0x14(%r14), %esi
movq %r15, %rdi
callq 0x4420
leaq 0x7048(%rip), %rsi      # 0xd1aa
movl $0x1, %edx
movq %rax, %rdi
callq 0x42e0
movl 0x8(%r14), %esi
movq %r15, %rdi
callq 0x4420
leaq 0x7026(%rip), %rsi      # 0xd1a8
movl $0x1, %edx
movq %rax, %rdi
callq 0x42e0
movl 0x4(%r14), %esi
movq %r15, %rdi
callq 0x4420
leaq 0x7006(%rip), %rsi      # 0xd1a8
movl $0x1, %edx
movq %rax, %rdi
callq 0x42e0
movl (%r14), %esi
movq %r15, %rdi
callq 0x4420
leaq 0x6feb(%rip), %rsi      # 0xd1ac
movl $0x4, %edx
movq %rax, %rdi
callq 0x42e0
leaq 0x3a8(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x43d0
movq 0x8(%rsp), %rsi
leaq 0x190(%rsp), %rdi
movl $0x10, %edx
callq 0x42a0
leaq 0x6fb3(%rip), %rsi      # 0xd1b1
leaq 0x190(%rsp), %rdi
movl $0x24, %edx
callq 0x42e0
leaq 0x6fbf(%rip), %rsi      # 0xd1d6
leaq 0x190(%rsp), %rdi
movl $0x2e, %edx
callq 0x42e0
leaq 0x6fd5(%rip), %rsi      # 0xd205
leaq 0x190(%rsp), %rdi
movl $0x1c, %edx
callq 0x42e0
leaq 0x6fd9(%rip), %rsi      # 0xd222
leaq 0x190(%rsp), %rdi
movl $0x12, %edx
callq 0x42e0
leaq 0x6fd3(%rip), %rsi      # 0xd235
leaq 0x190(%rsp), %rdi
movl $0x21, %edx
callq 0x42e0
leaq 0x7048(%rip), %rsi      # 0xd2c3
leaq 0x190(%rsp), %rdi
movl $0x1, %edx
callq 0x42e0
leaq 0x6fc3(%rip), %rsi      # 0xd257
leaq 0x190(%rsp), %rdi
movl $0x11, %edx
callq 0x42e0
leaq 0x6fbc(%rip), %rsi      # 0xd269
leaq 0x190(%rsp), %rdi
movl $0x22, %edx
callq 0x42e0
leaq 0x6fc6(%rip), %rsi      # 0xd28c
leaq 0x190(%rsp), %rdi
movl $0x12, %edx
callq 0x42e0
leaq 0x6fc0(%rip), %rsi      # 0xd29f
leaq 0x190(%rsp), %rdi
movl $0x11, %edx
callq 0x42e0
cvtss2sd 0x50(%rbx), %xmm0
leaq 0x190(%rsp), %rdi
callq 0x43e0
movq %rax, %r14
leaq 0x6fa4(%rip), %rsi      # 0xd2b1
movl $0xf, %edx
movq %rax, %rdi
callq 0x42e0
movl 0xc050(%rip), %esi      # 0x12370
movq %r14, %rdi
callq 0x4420
movq %rax, %r14
leaq 0x6f86(%rip), %rsi      # 0xd2b8
movl $0x8, %edx
movq %rax, %rdi
callq 0x42e0
movl 0xc02b(%rip), %esi      # 0x12370
movq %r14, %rdi
callq 0x4420
movq %rax, %r14
leaq 0x6f58(%rip), %rsi      # 0xd2af
movl $0x1, %edx
movq %rax, %rdi
callq 0x42e0
xorps %xmm0, %xmm0
cvtss2sd 0x50(%rbx), %xmm0
movq %r14, %rdi
callq 0x43e0
leaq 0x6f46(%rip), %rsi      # 0xd2c1
movl $0x3, %edx
movq %rax, %rdi
callq 0x42e0
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
testl %eax, %eax
jle 0x65d5
xorl %r13d, %r13d
leaq 0x190(%rsp), %r15
xorl %ebp, %ebp
movq %rbp, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
mulq %rcx
movq %rdx, %r14
movl $0x15, %edx
movq %r15, %rdi
leaq 0x6efb(%rip), %rsi      # 0xd2c5
callq 0x42e0
shrq %r14
imulq $-0x160, %r14, %rax     # imm = 0xFEA0
addq %rsp, %rax
addq $0x30, %rax
movq (%rax,%r13,8), %rsi
movq 0x8(%rax,%r13,8), %rdx
movq %r15, %rdi
callq 0x42e0
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x6ed8(%rip), %rsi      # 0xd2db
callq 0x42e0
movq 0x18(%rbx), %rax
movl (%rax,%r13), %esi
movq %r14, %rdi
callq 0x4420
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6e85(%rip), %rsi      # 0xd2af
callq 0x42e0
movq 0x30(%rbx), %rax
movl (%rax,%r13), %esi
movq %r14, %rdi
callq 0x4420
movq %rax, %r14
movl $0xd, %edx
movq %rax, %rdi
leaq 0x6e99(%rip), %rsi      # 0xd2ea
callq 0x42e0
movq (%rbx), %rax
movq 0x18(%rbx), %rcx
movslq (%rax,%r13), %rax
movq 0xbef0(%rip), %rdx      # 0x12358
leaq (%rax,%rax,2), %rax
movl -0x4(%rdx,%rax,4), %esi
addl (%rcx,%r13), %esi
movq %r14, %rdi
callq 0x4420
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6e21(%rip), %rsi      # 0xd2af
callq 0x42e0
movq (%rbx), %rax
movq 0x30(%rbx), %rcx
movslq (%rax,%r13), %rax
movq 0xbeb3(%rip), %rdx      # 0x12358
leaq (%rax,%rax,2), %rax
movl -0x8(%rdx,%rax,4), %esi
addl (%rcx,%r13), %esi
movq %r14, %rdi
callq 0x4420
movl $0x3, %edx
movq %rax, %rdi
leaq 0x6df9(%rip), %rsi      # 0xd2c1
callq 0x42e0
movl $0x12, %edx
movq %r15, %rdi
leaq 0x6e1c(%rip), %rsi      # 0xd2f8
callq 0x42e0
movq 0x18(%rbx), %rax
cvtsi2sdl (%rax,%r13), %xmm1
movq (%rbx), %rax
movslq (%rax,%r13), %rax
movq 0xbe5f(%rip), %rcx      # 0x12358
leaq (%rax,%rax,2), %rax
cvtsi2sdl -0x4(%rcx,%rax,4), %xmm0
mulsd 0x6b45(%rip), %xmm0     # 0xd050
addsd %xmm1, %xmm0
movq %r15, %rdi
callq 0x43e0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6d86(%rip), %rsi      # 0xd2af
callq 0x42e0
movq 0x30(%rbx), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%r13), %xmm1
movq (%rbx), %rax
movslq (%rax,%r13), %rax
movq 0xbe0f(%rip), %rcx      # 0x12358
leaq (%rax,%rax,2), %rax
xorps %xmm0, %xmm0
cvtsi2sdl -0x8(%rcx,%rax,4), %xmm0
mulsd 0x6af2(%rip), %xmm0     # 0xd050
addsd %xmm1, %xmm0
movq %r14, %rdi
callq 0x43e0
movq %rax, %r14
movl $0x8, %edx
movq %rax, %rdi
leaq 0x6d8f(%rip), %rsi      # 0xd30b
callq 0x42e0
movq (%rbx), %rax
movl (%rax,%r13), %esi
movq %r14, %rdi
callq 0x4420
movl $0x3, %edx
movq %rax, %rdi
leaq 0x6d75(%rip), %rsi      # 0xd314
callq 0x42e0
movl $0x1, %edx
movq %r15, %rdi
leaq 0x6d10(%rip), %rsi      # 0xd2c3
callq 0x42e0
incq %rbp
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
cltq
addq $0x4, %r13
cmpq %rax, %rbp
jl 0x63a8
leaq 0x6d3c(%rip), %rsi      # 0xd318
leaq 0x190(%rsp), %rdi
movl $0x11, %edx
callq 0x42e0
leaq 0x6d35(%rip), %rsi      # 0xd32a
leaq 0x190(%rsp), %rdi
movl $0x14, %edx
callq 0x42e0
leaq 0x6d31(%rip), %rsi      # 0xd33f
leaq 0x190(%rsp), %rdi
movl $0xf, %edx
callq 0x42e0
leaq 0x190(%rsp), %rdi
callq 0x4350
movq 0xb984(%rip), %rax      # 0x11fb8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x198(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x190(%rsp,%rcx)
callq 0x4200
leaq 0x288(%rsp), %rdi
callq 0x40d0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6680
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4290
movq 0xb911(%rip), %rsi      # 0x11f98
leaq 0x390(%rsp), %rdi
callq 0x41c0
leaq 0x410(%rsp), %rdi
callq 0x40d0
movq $-0x160, %rbx           # imm = 0xFEA0
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x66be
movq (%r12), %rsi
incq %rsi
callq 0x4290
addq $-0x20, %r12
addq $0x20, %rbx
jne 0x66a8
addq $0x518, %rsp            # imm = 0x518
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x673f
jmp 0x6728
movq %rax, %rbx
jmp 0x677b
jmp 0x66fb
jmp 0x66fb
jmp 0x66fb
jmp 0x66fb
jmp 0x66fb
jmp 0x66fb
jmp 0x66fb
jmp 0x66fb
jmp 0x66fb
movq %rax, %rbx
addq $-0x10, %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x6716
movq (%r15), %rsi
incq %rsi
callq 0x4290
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x6702
jmp 0x67a7
movq %rax, %rbx
jmp 0x675a
jmp 0x672f
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x4370
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x675a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4290
movq 0xb837(%rip), %rsi      # 0x11f98
leaq 0x390(%rsp), %rdi
callq 0x41c0
leaq 0x410(%rsp), %rdi
callq 0x40d0
xorl %r14d, %r14d
movq 0x170(%rsp,%r14), %rdi
leaq (%r12,%r14), %rax
cmpq %rdi, %rax
je 0x679a
movq (%rax), %rsi
incq %rsi
callq 0x4290
addq $-0x20, %r14
cmpq $-0x160, %r14           # imm = 0xFEA0
jne 0x677e
movq %rbx, %rdi
callq 0x4450