// File: /workspace/github_cpp_makefile_star2_O1/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 $0x98, %rsp
movq %rdi, %rbx
movups 0x98ca(%rip), %xmm0     # 0xef5c
leaq 0x60(%rsp), %r14
movups %xmm0, 0xc(%r14)
movups 0x98ad(%rip), %xmm0     # 0xef50
movaps %xmm0, (%r14)
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movl $0x7, %edx
movq %r14, %rsi
callq 0x8770
movups 0x98cb(%rip), %xmm0     # 0xef90
movaps %xmm0, 0x20(%r14)
movups 0x98af(%rip), %xmm0     # 0xef80
movaps %xmm0, 0x10(%r14)
movupd 0x9892(%rip), %xmm0     # 0xef70
movapd %xmm0, (%r14)
movabsq $0x3fcd70a3d70a3d71, %rax # imm = 0x3FCD70A3D70A3D71
movq %rax, 0x30(%r14)
leaq 0x30(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0xf(%rsp), %rcx
movl $0x7, %edx
callq 0x8e70
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movl $0x38, %edi
callq 0x2220
leaq 0x60(%rsp), %rdx
movq %rax, (%rdx)
movq %rax, 0x8(%rdx)
movq %rax, %rcx
addq $0x38, %rcx
movq %rcx, 0x10(%rdx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq $0x0, 0x30(%rax)
movq %rcx, 0x8(%rdx)
leaq 0xf(%rsp), %rcx
movl $0x7, %esi
movq %rbx, %rdi
callq 0x8eae
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x577d
callq 0x2200
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %rax
subq %rax, %rcx
je 0x5890
movq %rcx, %rax
sarq $0x2, %rax
cmpq $0x1, %rax
movq %rax, %rcx
adcq $0x0, %rcx
movq %rcx, 0x10(%rsp)
xorl %edx, %edx
movsd 0x8977(%rip), %xmm0     # 0xe128
movq %rax, 0x18(%rsp)
movq %rax, %rdi
cmpq $0x1, %rdi
movq %rdi, 0x20(%rsp)
adcq $0x0, %rdi
cmpq %rdx, 0x18(%rsp)
je 0x587a
movq (%rbx), %rax
movq %rax, 0x28(%rsp)
xorl %r12d, %r12d
movq %r12, %r10
addq %rdx, %r10
jb 0x586e
movq 0x30(%rsp), %r11
leaq (%r12,%r12,2), %r14
movq 0x28(%rsp), %rax
movq (%rax,%r14,8), %r15
movq %r12, %rsi
leal -0x1(%rsi), %ebp
movq (%rbx), %rax
leaq (%rax,%r14,8), %rcx
leaq 0x1(%rsi), %r13
leaq (,%r13,2), %r9
addq %r13, %r9
leaq (%rax,%r9,8), %rax
movq %r12, %r9
movapd %xmm0, %xmm1
xorpd %xmm3, %xmm3
xorpd %xmm2, %xmm2
cmpl %ebp, %r12d
jge 0x5838
movq (%rcx), %r8
movsd -0x8(%r8,%rsi,8), %xmm2
cmpq %r10, %r13
jae 0x5846
movq (%rax), %r8
movsd (%r8,%r10,8), %xmm3
addsd (%r11,%r9,8), %xmm2
addsd %xmm3, %xmm2
minsd %xmm1, %xmm2
incq %r9
movapd %xmm2, %xmm1
cmpq %r10, %r9
jbe 0x5821
movsd %xmm2, (%r15,%r10,8)
movq %r13, %rsi
cmpq %r10, %r13
jbe 0x57fd
incq %r12
cmpq %rdi, %r12
jne 0x57dc
incq %rdx
movq 0x20(%rsp), %rdi
decq %rdi
cmpq 0x10(%rsp), %rdx
jne 0x57b9
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x589f
callq 0x2200
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x58ae
callq 0x2200
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x58da
callq 0x2200
jmp 0x58da
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x58ee
callq 0x2200
jmp 0x58ee
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x58fd
callq 0x2200
movq %rbx, %rdi
callq 0x2360