// File: IsaacLaw12[P]RayTracer/./src/OctTree.cpp
// Function: OctTree::calculate_bounding()
void OctTree::calculate_bounding(){
    for(int i=0; i<Vertices.cols(); i++){
        Eigen::Vector3d vertex = get_vertex(i);
        if (vertex(0) < min_corner(0)){
            min_corner(0) = vertex(0);
        }
        if (vertex(1) < min_corner(1)){
            min_corner(1) = vertex(1);
        }
        if (vertex(2) < min_corner(2)){
            min_corner(2) = vertex(2);
        }
        if (vertex(0) > max_corner(0)){
            max_corner(0) = vertex(0);
        }
        if (vertex(1) > max_corner(1)){
            max_corner(1) = vertex(1);
        }
        if (vertex(2) > max_corner(2)){
            max_corner(2) = vertex(2);
        }
    }
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x68(%rsp)
movl $0x0, 0x8c(%rsp)
movq 0x68(%rsp), %rax
movslq 0x8c(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq 0x30(%rax), %rdi
callq 0x6d50
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
jge 0x587bf
movq 0x68(%rsp), %rsi
movl 0x8c(%rsp), %edx
leaq 0x70(%rsp), %rdi
callq 0x57ac0
leaq 0x70(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x58(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movsd 0x58(%rsp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5858f
leaq 0x70(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movsd 0x50(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x70(%rsp), %rdi
movl $0x1, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movl $0x1, %esi
callq 0x6130
movsd 0x48(%rsp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x585f9
leaq 0x70(%rsp), %rdi
movl $0x1, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movl $0x1, %esi
callq 0x6130
movsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x70(%rsp), %rdi
movl $0x2, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movl $0x2, %esi
callq 0x6130
movsd 0x38(%rsp), %xmm1
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x58663
leaq 0x70(%rsp), %rdi
movl $0x2, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movl $0x2, %esi
callq 0x6130
movsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x70(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movsd 0x28(%rsp), %xmm0
ucomisd (%rax), %xmm0
jbe 0x586cd
leaq 0x70(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
addq $0x18, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6130
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x70(%rsp), %rdi
movl $0x1, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
addq $0x18, %rdi
movl $0x1, %esi
callq 0x6130
movsd 0x18(%rsp), %xmm0
ucomisd (%rax), %xmm0
jbe 0x5873b
leaq 0x70(%rsp), %rdi
movl $0x1, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
addq $0x18, %rdi
movl $0x1, %esi
callq 0x6130
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x70(%rsp), %rdi
movl $0x2, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
addq $0x18, %rdi
movl $0x2, %esi
callq 0x6130
movsd 0x8(%rsp), %xmm0
ucomisd (%rax), %xmm0
jbe 0x587a7
leaq 0x70(%rsp), %rdi
movl $0x2, %esi
callq 0x6130
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
addq $0x18, %rdi
movl $0x2, %esi
callq 0x6130
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0x587a9
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x584e7
addq $0x98, %rsp
retq
nopw (%rax,%rax)