// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms2/./assignment3.hpp
// Function: assignment3::binaryTree()
std::vector<std::vector<double>> binaryTree()
    {
        std::vector<int> vec = { 1,2,3,4,5,6,7 };
        std::vector<double> w = { 0.05, 0.4, 0.08,0.04,0.1,0.1,0.23 };

        std::vector<std::vector<double>> A(7, std::vector<double>(7));
        for (size_t s = 0; s < vec.size(); s++)
        {
            for (size_t i = 0; i < vec.size() - s; i++)
            {
                for (size_t r = i; r <= i + s; r++)
                {
                    double currMin = 999999999;
                    for (size_t k = i; k <= i + s; k++)
                    {
                        double resLeft = 0;
                        if ((int)i >= int(r - 1))
                            resLeft = 0;
                        else
                            resLeft = A[i][r - 1];

                        double resRight = 0;
                        if ((r + 1) >= (i + s))
                            resRight = 0;
                        else
                            resRight = A[r + 1][i + s];

                        currMin = std::min(currMin, w[k] + resLeft + resRight);
                    }
                    A[i][i + s] = currMin;
                }
            }
        }
        return A;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movups 0x9373(%rip), %xmm0     # 0xdf04
leaq 0x40(%rsp), %r14
movups %xmm0, 0xc(%r14)
movups 0x9356(%rip), %xmm0     # 0xdef8
movaps %xmm0, (%r14)
leaq 0x28(%rsp), %rdi
pushq $0x7
popq %r15
leaq 0x10(%rsp), %rcx
movq %r14, %rsi
movq %r15, %rdx
callq 0x710e
movups 0x9372(%rip), %xmm0     # 0xdf38
movaps %xmm0, 0x20(%r14)
movups 0x9356(%rip), %xmm0     # 0xdf28
movaps %xmm0, 0x10(%r14)
movups 0x933a(%rip), %xmm0     # 0xdf18
movaps %xmm0, (%r14)
movabsq $0x3fcd70a3d70a3d71, %rax # imm = 0x3FCD70A3D70A3D71
movq %rax, 0x30(%r14)
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0xe(%rsp), %rcx
movq %r15, %rdx
callq 0x7740
leaq 0x40(%rsp), %rdi
pushq $0x7
popq %rsi
leaq 0xe(%rsp), %rdx
callq 0x7776
pushq $0x7
popq %rsi
leaq 0x40(%rsp), %rdx
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
callq 0x77c8
leaq 0x40(%rsp), %rdi
callq 0xb156
movq 0x30(%rsp), %rax
subq 0x28(%rsp), %rax
sarq $0x2, %rax
xorl %ecx, %ecx
movsd 0x8488(%rip), %xmm0     # 0xd0d8
movq %rax, %rdx
cmpq %rax, %rcx
je 0x4cfb
xorl %esi, %esi
cmpq %rdx, %rsi
je 0x4cf0
leaq (%rsi,%rcx), %rdi
movq (%rbx), %r9
imulq $0x18, %rsi, %r8
movq (%r9,%r8), %r9
movq %rsi, %r10
cmpq %rdi, %r10
ja 0x4ce8
leal -0x1(%r10), %r11d
movq (%rbx), %r12
leaq (%r12,%r8), %r14
incq %r10
imulq $0x18, %r10, %r15
addq %r12, %r15
movq 0x10(%rsp), %r12
movapd %xmm0, %xmm1
movq %rsi, %r13
cmpq %rdi, %r13
ja 0x4ce0
xorpd %xmm3, %xmm3
xorpd %xmm2, %xmm2
cmpl %r11d, %esi
jge 0x4cbb
movq (%r14), %rbp
movsd -0x10(%rbp,%r10,8), %xmm2
cmpq %rdi, %r10
jae 0x4cc9
movq (%r15), %rbp
movsd (%rbp,%rdi,8), %xmm3
addsd (%r12,%r13,8), %xmm2
addsd %xmm3, %xmm2
minsd %xmm1, %xmm2
incq %r13
movapd %xmm2, %xmm1
jmp 0x4c9f
movsd %xmm1, (%r9,%rdi,8)
jmp 0x4c79
incq %rsi
jmp 0x4c5e
incq %rcx
decq %rdx
jmp 0x4c53
leaq 0x10(%rsp), %rdi
callq 0xb156
leaq 0x28(%rsp), %rdi
callq 0x9cda
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xb156
jmp 0x4d33
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xb156
jmp 0x4d42
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x9cda
movq %rbx, %rdi
callq 0x2380