// File: /workspace/github_cpp_makefile_star2_O3/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 0x9976(%rip), %xmm0     # 0xef5c
leaq 0x60(%rsp), %r14
movups %xmm0, 0xc(%r14)
movups 0x9959(%rip), %xmm0     # 0xef50
movaps %xmm0, (%r14)
leaq 0x48(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movl $0x7, %edx
movq %r14, %rsi
callq 0x87ac
movups 0x9977(%rip), %xmm0     # 0xef90
movaps %xmm0, 0x20(%r14)
movups 0x995b(%rip), %xmm0     # 0xef80
movaps %xmm0, 0x10(%r14)
movupd 0x993e(%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 0x8eb6
movl $0x38, %edi
callq 0x2210
leaq 0x60(%rsp), %rdx
movq %rax, (%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 0x8ef4
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x56ba
callq 0x21f0
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
movq %rax, 0x10(%rsp)
subq %rax, %rcx
je 0x57bf
movq %rcx, %rax
sarq $0x2, %rax
cmpq $0x1, %rax
movq %rax, %rcx
adcq $0x0, %rcx
movq %rcx, 0x18(%rsp)
xorl %edx, %edx
movsd 0x8a35(%rip), %xmm0     # 0xe128
movq %rax, 0x20(%rsp)
movq %rax, %r8
cmpq $0x1, %r8
movq %r8, 0x28(%rsp)
adcq $0x0, %r8
cmpq %rdx, 0x20(%rsp)
je 0x57a9
movq (%rbx), %r9
xorl %eax, %eax
movq %rax, %r11
addq %rdx, %r11
jb 0x579d
movq 0x30(%rsp), %r14
leaq (%rax,%rax,2), %r15
movq (%r9,%r15,8), %r12
movq %rax, %r13
leal -0x1(%r13), %ebp
movq (%rbx), %rdi
leaq (%rdi,%r15,8), %rcx
incq %r13
leaq (,%r13,2), %r10
addq %r13, %r10
leaq (%rdi,%r10,8), %rdi
movq %rax, %r10
movapd %xmm0, %xmm1
xorpd %xmm3, %xmm3
xorpd %xmm2, %xmm2
cmpl %ebp, %eax
jge 0x576a
movq (%rcx), %rsi
movsd -0x10(%rsi,%r13,8), %xmm2
cmpq %r11, %r13
jae 0x5778
movq (%rdi), %rsi
movsd (%rsi,%r11,8), %xmm3
addsd (%r14,%r10,8), %xmm2
addsd %xmm3, %xmm2
minsd %xmm1, %xmm2
incq %r10
movapd %xmm2, %xmm1
cmpq %r11, %r10
jbe 0x5754
movsd %xmm2, (%r12,%r11,8)
cmpq %r11, %r13
jbe 0x5730
incq %rax
cmpq %r8, %rax
jne 0x5718
incq %rdx
movq 0x28(%rsp), %r8
decq %r8
cmpq 0x18(%rsp), %rdx
jne 0x56fb
movq 0x30(%rsp), %rax
testq %rax, %rax
movq 0x10(%rsp), %rdi
je 0x57db
movq %rax, %rdi
callq 0x21f0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x57e5
callq 0x21f0
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 0x5811
callq 0x21f0
jmp 0x5811
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5825
callq 0x21f0
jmp 0x5825
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x5834
callq 0x21f0
movq %rbx, %rdi
callq 0x2350