// File: /workspace/github_cpp_makefile_star2_O3/IlanPrice[P]Linear-Algebra-Library-in-Cplusplus/Matrix.cpp
// Function: hess(Matrix const&)
Matrix hess(const Matrix& A)
{

	int n = A.mRows;
	Matrix Ahes = A;
	disp(A);
	Vector u = Ahes.getElements(2,n,1,1,"Vector");
	std::cout<< "u=\n"<< u <<"\n";
	Vector v(length(u));
	v(1) = norm(u,2);
	std::cout<< "v=\n"<< v <<"\n";
	Vector w = u-v;
	Matrix H = eye(n);
	Matrix K = eye(n-1);
	if (norm(w)>1e-14)
	{
		Matrix temp = outer(w,w);
		K = K - (2/(w*w))*temp;
	}
	std::cout<< "H=\n"<< H <<"\n";
	H.setElements(2,n,2,n,K);
	disp(H);
	Ahes = H*Ahes*H;
	disp(Ahes);
	for (int i=2;i<n-1;i++)
	{
		Matrix B = Ahes.getElements(i,n,i, n);
		Vector u2 = B.getElements(2,B.mRows,1,1,"Vector");
		std::cout<< "B=\n"<< B <<"\n";
		std::cout<< "u2=\n"<< u2 <<"\n";
		Vector v2(length(u2));
		v2(1) = norm(u2,2);;
		std::cout<< "v2=\n"<< v2 <<"\n";
		Vector w2 = u2-v2;
		std::cout<<"w2=\n" << w2<<"\n";
		Matrix Hhat = eye(B.mRows-1);
		if (norm(w2)>1e-14)
		{
		Matrix temp2 = outer(w2,w2);
		std::cout<< temp2 <<"\n\n";
		Hhat = Hhat - (2/(w2*w2))*temp2;
		}
		std::cout<< "Hhat=\n"<< Hhat <<"\n\n";
		Matrix H2 = eye(n);
		H2.setElements(i+1,n,i+1,n,Hhat);
		std::cout<< "H2=\n"<< H2 <<"\n\n";
		Ahes = H2*Ahes*H2;
	}

	for (int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				if (std::abs(Ahes(i,j)) < 1e-12)
					Ahes(i,j) = 0;
			}
		}
	return Ahes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, %r15
movq %rdi, %rbx
movl 0x8(%rsi), %r14d
callq 0x3f2a
movq 0x6803(%rip), %rdi      # 0xffd0
movq %r15, %rsi
callq 0x4049
movq 0x67f4(%rip), %rdi      # 0xffd0
leaq 0x2b11(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2110
leaq 0x188(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2de6(%rip), %rsi      # 0xc5e6
leaq 0x2de5(%rip), %rdx      # 0xc5ec
leaq 0x178(%rsp), %rdi
callq 0x3c44
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
movl $0x2, %edx
movl %r14d, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x4398
movq 0x178(%rsp), %rdi
cmpq %r15, %rdi
je 0x984a
callq 0x2100
movq 0x677f(%rip), %rdi      # 0xffd0
leaq 0x2dd7(%rip), %rsi      # 0xc62f
movl $0x3, %edx
callq 0x2110
movq 0x6767(%rip), %rdi      # 0xffd0
leaq 0xb0(%rsp), %rsi
callq 0x3335
leaq 0x2a77(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
movq %rax, %rdi
callq 0x2110
leaq 0xb0(%rsp), %rdi
callq 0x3461
leaq 0xc0(%rsp), %rdi
movl %eax, %esi
callq 0x28b8
leaq 0xb0(%rsp), %rdi
movl $0x2, %esi
callq 0x33e7
movsd %xmm0, 0x68(%rsp)
leaq 0xc0(%rsp), %rdi
movl $0x1, %esi
callq 0x3330
movsd 0x68(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x66ef(%rip), %rdi      # 0xffd0
leaq 0x2d4b(%rip), %rsi      # 0xc633
movl $0x3, %edx
callq 0x2110
movq 0x66d7(%rip), %rdi      # 0xffd0
leaq 0xc0(%rsp), %rsi
callq 0x3335
leaq 0x29e7(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
movq %rax, %rdi
callq 0x2110
leaq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x2af8
leaq 0x58(%rsp), %rdi
movl %r14d, %esi
movl %r14d, %edx
callq 0x3dd4
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
testl %r14d, %r14d
jle 0x996d
movq 0x58(%rsp), %rax
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movq %rsi, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x995d
leal -0x1(%r14), %edx
leaq 0x90(%rsp), %rdi
movl %edx, %esi
movl %edx, 0x34(%rsp)
callq 0x3dd4
cmpl $0x2, %r14d
movabsq $0x3ff0000000000000, %rdi # imm = 0x3FF0000000000000
jl 0x99b2
movq 0x90(%rsp), %rax
movl 0x34(%rsp), %ecx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movq %rdi, (%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x99a2
leaq 0xa0(%rsp), %rdi
movl $0x2, %esi
callq 0x33e7
ucomisd 0x293c(%rip), %xmm0     # 0xc308
jbe 0x9aa7
leaq 0x108(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x28fa
leaq 0xf8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x28fa
leaq 0x20(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x692c
leaq 0xf8(%rsp), %rdi
callq 0x294e
leaq 0x108(%rsp), %rdi
callq 0x294e
leaq 0xa0(%rsp), %rdi
movq %rdi, %rsi
callq 0x2c95
movsd 0x28d0(%rip), %xmm1     # 0xc318
divsd %xmm0, %xmm1
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movapd %xmm1, %xmm0
callq 0x4e7a
leaq 0x10(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x4dd5
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x681a
movq %r15, %rdi
callq 0x3fe2
leaq 0x48(%rsp), %rdi
callq 0x3fe2
leaq 0x20(%rsp), %rdi
callq 0x3fe2
movq 0x6522(%rip), %rdi      # 0xffd0
leaq 0x2b82(%rip), %rsi      # 0xc637
movl $0x3, %edx
callq 0x2110
movq 0x650a(%rip), %rdi      # 0xffd0
leaq 0x58(%rsp), %rsi
callq 0x4049
movq 0x64f9(%rip), %rdi      # 0xffd0
leaq 0x2816(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2110
leaq 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x3f2a
leaq 0x58(%rsp), %rdi
leaq 0xe8(%rsp), %r9
movl $0x2, %esi
movl %r14d, %edx
movl $0x2, %ecx
movl %r14d, %r8d
callq 0x475c
leaq 0xe8(%rsp), %rdi
callq 0x3fe2
movq 0x649d(%rip), %rdi      # 0xffd0
leaq 0x58(%rsp), %rsi
callq 0x4049
movq 0x648c(%rip), %rdi      # 0xffd0
leaq 0x27a9(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2110
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movq %rbx, %rdx
callq 0x4ef7
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x4ef7
leaq 0x20(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x681a
movq %r15, %rdi
callq 0x3fe2
leaq 0x10(%rsp), %rdi
callq 0x3fe2
movq 0x642c(%rip), %rdi      # 0xffd0
movq %rbx, %rsi
callq 0x4049
movq 0x641d(%rip), %rdi      # 0xffd0
leaq 0x273a(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2110
cmpl $0x4, %r14d
jl 0xa08d
movl $0x2, %r15d
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movl %r14d, %ecx
movl %r15d, 0x68(%rsp)
movl %r15d, %r8d
movl %r14d, %r9d
callq 0x412c
movl 0x28(%rsp), %r12d
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x29cd(%rip), %rsi      # 0xc5e6
leaq 0x29cc(%rip), %rdx      # 0xc5ec
callq 0x3c44
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x2, %edx
movl %r12d, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x4398
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x9c62
callq 0x2100
movl $0x3, %edx
movq 0x6362(%rip), %r15      # 0xffd0
movq %r15, %rdi
leaq 0x29c3(%rip), %rsi      # 0xc63b
callq 0x2110
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x4049
movl $0x1, %edx
movq %r15, %rdi
leaq 0x265b(%rip), %rsi      # 0xc2f4
callq 0x2110
movl $0x4, %edx
movq %r15, %rdi
leaq 0x2992(%rip), %rsi      # 0xc63f
callq 0x2110
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3335
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2626(%rip), %rsi      # 0xc2f4
callq 0x2110
leaq 0x10(%rsp), %rdi
callq 0x3461
leaq 0x48(%rsp), %rdi
movl %eax, %esi
callq 0x28b8
leaq 0x10(%rsp), %rdi
movl $0x2, %esi
callq 0x33e7
movsd %xmm0, 0xd0(%rsp)
leaq 0x48(%rsp), %rdi
movl $0x1, %esi
callq 0x3330
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, (%rax)
movl $0x4, %edx
movq 0x62a7(%rip), %rdi      # 0xffd0
leaq 0x2914(%rip), %rsi      # 0xc644
callq 0x2110
movq 0x6294(%rip), %rdi      # 0xffd0
leaq 0x48(%rsp), %rsi
callq 0x3335
movl $0x1, %edx
movq %rax, %rdi
leaq 0x259f(%rip), %rsi      # 0xc2f4
callq 0x2110
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x2af8
movl $0x4, %edx
movq 0x6253(%rip), %r13      # 0xffd0
movq %r13, %rdi
leaq 0x28c2(%rip), %rsi      # 0xc649
callq 0x2110
movq %r13, %rdi
leaq 0x80(%rsp), %rsi
callq 0x3335
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2549(%rip), %rsi      # 0xc2f4
callq 0x2110
leal -0x1(%r12), %r13d
leaq 0x70(%rsp), %rdi
movl %r13d, %esi
movl %r13d, %edx
callq 0x3dd4
cmpl $0x2, %r12d
movabsq $0x3ff0000000000000, %rdi # imm = 0x3FF0000000000000
jl 0x9def
movq 0x70(%rsp), %rax
movl %r13d, %ecx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movq %rdi, (%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x9ddf
leaq 0x80(%rsp), %rdi
movl $0x2, %esi
callq 0x33e7
movl 0x68(%rsp), %r15d
ucomisd 0x24fa(%rip), %xmm0     # 0xc308
jbe 0x9f05
leaq 0x148(%rsp), %rdi
leaq 0x80(%rsp), %r13
movq %r13, %rsi
callq 0x28fa
leaq 0x168(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x28fa
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
leaq 0x148(%rsp), %r13
movq %r13, %rsi
movq %r12, %rdx
callq 0x692c
movq %r12, %rdi
callq 0x294e
movq %r13, %rdi
callq 0x294e
movq 0x615f(%rip), %r13      # 0xffd0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4049
movl $0x2, %edx
movq %r13, %rdi
leaq 0x2468(%rip), %rsi      # 0xc2f3
callq 0x2110
leaq 0x80(%rsp), %rdi
movq %rdi, %rsi
callq 0x2c95
leaq 0xd8(%rsp), %r12
movsd 0x2468(%rip), %xmm1     # 0xc318
divsd %xmm0, %xmm1
movq %r12, %rdi
movapd %xmm1, %xmm0
leaq 0x38(%rsp), %rsi
callq 0x4e7a
leaq 0x158(%rsp), %rbp
movq %rbp, %rdi
leaq 0x70(%rsp), %r13
movq %r13, %rsi
movq %r12, %rdx
callq 0x4dd5
movq %r13, %rdi
movq %rbp, %rsi
callq 0x681a
movq %rbp, %rdi
callq 0x3fe2
movq %r12, %rdi
callq 0x3fe2
leaq 0x38(%rsp), %rdi
callq 0x3fe2
movl $0x6, %edx
movq 0x60bf(%rip), %rdi      # 0xffd0
leaq 0x2736(%rip), %rsi      # 0xc64e
callq 0x2110
movq 0x60ac(%rip), %rdi      # 0xffd0
leaq 0x70(%rsp), %rsi
callq 0x4049
movl $0x2, %edx
movq 0x6096(%rip), %rdi      # 0xffd0
leaq 0x23b2(%rip), %rsi      # 0xc2f3
callq 0x2110
leaq 0x38(%rsp), %rdi
movl %r14d, %esi
movl %r14d, %edx
callq 0x3dd4
movq 0x38(%rsp), %rax
xorl %ecx, %ecx
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
movq (%rax,%rcx,8), %rdx
movq %rsi, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x9f67
leaq 0x138(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x3f2a
incl %r15d
leaq 0x38(%rsp), %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %r15d, %ecx
movl %r14d, %r8d
leaq 0x138(%rsp), %r12
movq %r12, %r9
callq 0x475c
movq %r12, %rdi
callq 0x3fe2
movl $0x4, %edx
movq 0x600f(%rip), %rdi      # 0xffd0
leaq 0x268d(%rip), %rsi      # 0xc655
callq 0x2110
movq 0x5ffc(%rip), %rdi      # 0xffd0
leaq 0x38(%rsp), %rsi
callq 0x4049
movl $0x2, %edx
movq 0x5fe6(%rip), %rdi      # 0xffd0
leaq 0x2302(%rip), %rsi      # 0xc2f3
callq 0x2110
leaq 0xd8(%rsp), %r13
movq %r13, %rdi
leaq 0x38(%rsp), %r12
movq %r12, %rsi
movq %rbx, %rdx
callq 0x4ef7
leaq 0x158(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x4ef7
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x681a
movq %rbp, %rdi
callq 0x3fe2
movq %r13, %rdi
callq 0x3fe2
movq %r12, %rdi
callq 0x3fe2
leaq 0x70(%rsp), %rdi
callq 0x3fe2
leaq 0x80(%rsp), %rdi
callq 0x294e
leaq 0x48(%rsp), %rdi
callq 0x294e
leaq 0x10(%rsp), %rdi
callq 0x294e
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x3fe2
cmpl 0x34(%rsp), %r15d
jne 0x9bd9
testl %r14d, %r14d
jle 0xa100
movl %r14d, %r13d
negl %r13d
movl $0x1, %r15d
movl $0x1, %r12d
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x5202
movsd (%rax), %xmm0
andpd 0x1f92(%rip), %xmm0     # 0xc050
movsd 0x225a(%rip), %xmm1     # 0xc320
ucomisd %xmm0, %xmm1
jbe 0xa0e1
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x5202
movq $0x0, (%rax)
leal (%r12,%r13), %eax
incl %eax
movl %r12d, %ecx
incl %ecx
movl %ecx, %r12d
cmpl $0x1, %eax
jne 0xa0a4
leal 0x1(%r15), %eax
cmpl %r14d, %r15d
movl %eax, %r15d
jne 0xa09e
leaq 0x90(%rsp), %rdi
callq 0x3fe2
leaq 0x58(%rsp), %rdi
callq 0x3fe2
leaq 0xa0(%rsp), %rdi
callq 0x294e
leaq 0xc0(%rsp), %rdi
callq 0x294e
leaq 0xb0(%rsp), %rdi
callq 0x294e
movq %rbx, %rax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x3fe2
jmp 0xa2d6
movq %rax, %r14
leaq 0xf8(%rsp), %rdi
callq 0x294e
jmp 0xa17a
movq %rax, %r14
leaq 0x108(%rsp), %rdi
callq 0x294e
jmp 0xa2e5
jmp 0xa2e2
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0xa2db
jmp 0xa2e2
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
jmp 0xa2db
jmp 0xa262
movq %rax, %r14
jmp 0xa2f2
movq %rax, %r14
jmp 0xa2fc
jmp 0xa1fc
movq %rax, %r14
movq 0x178(%rsp), %rdi
cmpq %r15, %rdi
je 0xa323
callq 0x2100
jmp 0xa323
jmp 0xa1ec
jmp 0xa1f4
movq %rax, %r14
jmp 0xa323
movq %rax, %r14
jmp 0xa316
movq %rax, %r14
jmp 0xa309
jmp 0xa29e
movq %rax, %r14
leaq 0x168(%rsp), %rdi
callq 0x294e
jmp 0xa21e
movq %rax, %r14
leaq 0x148(%rsp), %rdi
callq 0x294e
jmp 0xa2a1
jmp 0xa24b
jmp 0xa2e2
jmp 0xa28a
jmp 0xa28f
jmp 0xa28f
jmp 0xa29e
movq %rax, %r14
leaq 0x138(%rsp), %rdi
jmp 0xa256
jmp 0xa28f
movq %rax, %r14
leaq 0xd8(%rsp), %rdi
callq 0x3fe2
jmp 0xa292
jmp 0xa2e2
movq %rax, %r14
jmp 0xa2d6
movq %rax, %r14
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0xa2d6
callq 0x2100
jmp 0xa2d6
jmp 0xa2ba
jmp 0xa2c9
movq %rax, %r14
jmp 0xa2ab
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x3fe2
jmp 0xa2a1
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x3fe2
leaq 0x80(%rsp), %rdi
callq 0x294e
jmp 0xa2bd
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x294e
jmp 0xa2cc
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x294e
leaq 0x20(%rsp), %rdi
callq 0x3fe2
jmp 0xa2e5
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x3fe2
leaq 0x58(%rsp), %rdi
callq 0x3fe2
leaq 0xa0(%rsp), %rdi
callq 0x294e
leaq 0xc0(%rsp), %rdi
callq 0x294e
leaq 0xb0(%rsp), %rdi
callq 0x294e
movq %rbx, %rdi
callq 0x3fe2
movq %r14, %rdi
callq 0x21b0