// File: /workspace/github_cpp_makefile_star2_O1/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 0x3f5e
movq 0x67bc(%rip), %rdi      # 0xffd0
movq %r15, %rsi
callq 0x407a
movq 0x67ad(%rip), %rdi      # 0xffd0
leaq 0x2aca(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2120
leaq 0x188(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2d9f(%rip), %rsi      # 0xc5e6
leaq 0x2d9e(%rip), %rdx      # 0xc5ec
leaq 0x178(%rsp), %rdi
callq 0x3c6e
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
movl $0x2, %edx
movl %r14d, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x43be
movq 0x178(%rsp), %rdi
cmpq %r15, %rdi
je 0x9891
callq 0x2110
movq 0x6738(%rip), %rdi      # 0xffd0
leaq 0x2d90(%rip), %rsi      # 0xc62f
movl $0x3, %edx
callq 0x2120
movq 0x6720(%rip), %rdi      # 0xffd0
leaq 0xb0(%rsp), %rsi
callq 0x3359
leaq 0x2a30(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
leaq 0xb0(%rsp), %rdi
callq 0x3485
leaq 0xc0(%rsp), %rdi
movl %eax, %esi
callq 0x28c8
leaq 0xb0(%rsp), %rdi
movl $0x2, %esi
callq 0x340b
movsd %xmm0, 0x68(%rsp)
leaq 0xc0(%rsp), %rdi
movl $0x1, %esi
callq 0x3354
movsd 0x68(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x66a8(%rip), %rdi      # 0xffd0
leaq 0x2d04(%rip), %rsi      # 0xc633
movl $0x3, %edx
callq 0x2120
movq 0x6690(%rip), %rdi      # 0xffd0
leaq 0xc0(%rsp), %rsi
callq 0x3359
leaq 0x29a0(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
leaq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x2b28
leaq 0x58(%rsp), %rdi
movl %r14d, %esi
movl %r14d, %edx
callq 0x3df8
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
testl %r14d, %r14d
jle 0x99b4
movq 0x58(%rsp), %rax
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movq %rsi, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x99a4
leal -0x1(%r14), %edx
leaq 0x90(%rsp), %rdi
movl %edx, %esi
movl %edx, 0x24(%rsp)
callq 0x3df8
cmpl $0x2, %r14d
movabsq $0x3ff0000000000000, %rdi # imm = 0x3FF0000000000000
jl 0x99f9
movq 0x90(%rsp), %rax
movl 0x24(%rsp), %ecx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movq %rdi, (%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x99e9
leaq 0xa0(%rsp), %rdi
movl $0x2, %esi
callq 0x340b
ucomisd 0x28f5(%rip), %xmm0     # 0xc308
jbe 0x9aee
leaq 0x108(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2918
leaq 0xf8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2918
leaq 0x48(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x68fd
leaq 0xf8(%rsp), %rdi
callq 0x2970
leaq 0x108(%rsp), %rdi
callq 0x2970
leaq 0xa0(%rsp), %rdi
movq %rdi, %rsi
callq 0x2cd3
movsd 0x2889(%rip), %xmm1     # 0xc318
divsd %xmm0, %xmm1
leaq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movapd %xmm1, %xmm0
callq 0x4e71
leaq 0x10(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x4dca
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x67e4
movq %r15, %rdi
callq 0x4016
leaq 0x38(%rsp), %rdi
callq 0x4016
leaq 0x48(%rsp), %rdi
callq 0x4016
movq 0x64db(%rip), %rdi      # 0xffd0
leaq 0x2b3b(%rip), %rsi      # 0xc637
movl $0x3, %edx
callq 0x2120
movq 0x64c3(%rip), %rdi      # 0xffd0
leaq 0x58(%rsp), %rsi
callq 0x407a
movq 0x64b2(%rip), %rdi      # 0xffd0
leaq 0x27cf(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2120
leaq 0xe8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x3f5e
leaq 0x58(%rsp), %rdi
leaq 0xe8(%rsp), %r9
movl $0x2, %esi
movl %r14d, %edx
movl $0x2, %ecx
movl %r14d, %r8d
callq 0x4768
leaq 0xe8(%rsp), %rdi
callq 0x4016
movq 0x6456(%rip), %rdi      # 0xffd0
leaq 0x58(%rsp), %rsi
callq 0x407a
movq 0x6445(%rip), %rdi      # 0xffd0
leaq 0x2762(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2120
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movq %rbx, %rdx
callq 0x4eee
leaq 0x48(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x4eee
leaq 0x48(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x67e4
movq %r15, %rdi
callq 0x4016
leaq 0x10(%rsp), %rdi
callq 0x4016
movq 0x63e5(%rip), %rdi      # 0xffd0
movq %rbx, %rsi
callq 0x407a
movq 0x63d6(%rip), %rdi      # 0xffd0
leaq 0x26f3(%rip), %rsi      # 0xc2f4
movl $0x1, %edx
callq 0x2120
cmpl $0x4, %r14d
jl 0xa0d8
movl $0x2, %r15d
leaq 0x48(%rsp), %r12
movq %r12, %r13
movq %r12, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movl %r14d, %ecx
movl %r15d, 0x68(%rsp)
movl %r15d, %r8d
movl %r14d, %r9d
callq 0x415c
movl 0x50(%rsp), %r12d
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x2983(%rip), %rsi      # 0xc5e6
leaq 0x2982(%rip), %rdx      # 0xc5ec
callq 0x3c6e
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
movl $0x2, %edx
movl %r12d, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x43be
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x9caa
callq 0x2110
movl $0x3, %edx
movq 0x631a(%rip), %r15      # 0xffd0
movq %r15, %rdi
leaq 0x297b(%rip), %rsi      # 0xc63b
callq 0x2120
movq %r15, %rdi
movq %r13, %rsi
callq 0x407a
movl $0x1, %edx
movq %r15, %rdi
leaq 0x2615(%rip), %rsi      # 0xc2f4
callq 0x2120
movl $0x4, %edx
movq %r15, %rdi
leaq 0x294c(%rip), %rsi      # 0xc63f
callq 0x2120
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3359
movl $0x1, %edx
movq %rax, %rdi
leaq 0x25e0(%rip), %rsi      # 0xc2f4
callq 0x2120
leaq 0x10(%rsp), %rdi
callq 0x3485
leaq 0x38(%rsp), %rdi
movl %eax, %esi
callq 0x28c8
leaq 0x10(%rsp), %rdi
movl $0x2, %esi
callq 0x340b
movsd %xmm0, 0xd0(%rsp)
leaq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0x3354
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, (%rax)
movl $0x4, %edx
movq 0x6261(%rip), %rdi      # 0xffd0
leaq 0x28ce(%rip), %rsi      # 0xc644
callq 0x2120
movq 0x624e(%rip), %rdi      # 0xffd0
leaq 0x38(%rsp), %rsi
callq 0x3359
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2559(%rip), %rsi      # 0xc2f4
callq 0x2120
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x2b28
movl $0x4, %edx
movq 0x620d(%rip), %r13      # 0xffd0
movq %r13, %rdi
leaq 0x287c(%rip), %rsi      # 0xc649
callq 0x2120
movq %r13, %rdi
leaq 0x80(%rsp), %rsi
callq 0x3359
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2503(%rip), %rsi      # 0xc2f4
callq 0x2120
leal -0x1(%r12), %r13d
leaq 0x70(%rsp), %rdi
movl %r13d, %esi
movl %r13d, %edx
callq 0x3df8
cmpl $0x2, %r12d
movabsq $0x3ff0000000000000, %rdi # imm = 0x3FF0000000000000
jl 0x9e35
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 0x9e25
leaq 0x80(%rsp), %rdi
movl $0x2, %esi
callq 0x340b
movl 0x68(%rsp), %r15d
ucomisd 0x24b4(%rip), %xmm0     # 0xc308
jbe 0x9f4b
leaq 0x148(%rsp), %rdi
leaq 0x80(%rsp), %rbp
movq %rbp, %rsi
callq 0x2918
leaq 0x168(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2918
leaq 0x28(%rsp), %r12
movq %r12, %rdi
leaq 0x148(%rsp), %rbp
movq %rbp, %rsi
movq %r13, %rdx
callq 0x68fd
movq %r13, %rdi
callq 0x2970
movq %rbp, %rdi
callq 0x2970
movq 0x6119(%rip), %rbp      # 0xffd0
movq %rbp, %rdi
movq %r12, %rsi
callq 0x407a
movl $0x2, %edx
movq %rbp, %rdi
leaq 0x2422(%rip), %rsi      # 0xc2f3
callq 0x2120
leaq 0x80(%rsp), %rdi
movq %rdi, %rsi
callq 0x2cd3
leaq 0xd8(%rsp), %r12
movsd 0x2422(%rip), %xmm1     # 0xc318
divsd %xmm0, %xmm1
movq %r12, %rdi
movapd %xmm1, %xmm0
leaq 0x28(%rsp), %rsi
callq 0x4e71
leaq 0x158(%rsp), %r13
movq %r13, %rdi
leaq 0x70(%rsp), %rbp
movq %rbp, %rsi
movq %r12, %rdx
callq 0x4dca
movq %rbp, %rdi
movq %r13, %rsi
callq 0x67e4
movq %r13, %rdi
callq 0x4016
movq %r12, %rdi
callq 0x4016
leaq 0x28(%rsp), %rdi
callq 0x4016
movl $0x6, %edx
movq 0x6079(%rip), %rdi      # 0xffd0
leaq 0x26f0(%rip), %rsi      # 0xc64e
callq 0x2120
movq 0x6066(%rip), %rdi      # 0xffd0
leaq 0x70(%rsp), %rsi
callq 0x407a
movl $0x2, %edx
movq 0x6050(%rip), %rdi      # 0xffd0
leaq 0x236c(%rip), %rsi      # 0xc2f3
callq 0x2120
leaq 0x28(%rsp), %rdi
movl %r14d, %esi
movl %r14d, %edx
callq 0x3df8
testl %r14d, %r14d
movabsq $0x3ff0000000000000, %rsi # imm = 0x3FF0000000000000
jle 0x9fc2
movq 0x28(%rsp), %rax
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movq %rsi, (%rdx,%rcx,8)
incq %rcx
cmpq %rcx, %r14
jne 0x9fb2
leaq 0x138(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x3f5e
incl %r15d
leaq 0x28(%rsp), %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %r15d, %ecx
movl %r14d, %r8d
leaq 0x138(%rsp), %r12
movq %r12, %r9
callq 0x4768
movq %r12, %rdi
callq 0x4016
movl $0x4, %edx
movq 0x5fc4(%rip), %rdi      # 0xffd0
leaq 0x2642(%rip), %rsi      # 0xc655
callq 0x2120
movq 0x5fb1(%rip), %rdi      # 0xffd0
leaq 0x28(%rsp), %rsi
callq 0x407a
movl $0x2, %edx
movq 0x5f9b(%rip), %rdi      # 0xffd0
leaq 0x22b7(%rip), %rsi      # 0xc2f3
callq 0x2120
leaq 0xd8(%rsp), %r12
movq %r12, %rdi
leaq 0x28(%rsp), %r13
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4eee
leaq 0x158(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x4eee
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x67e4
movq %rbp, %rdi
callq 0x4016
movq %r12, %rdi
callq 0x4016
movq %r13, %rdi
callq 0x4016
leaq 0x70(%rsp), %rdi
callq 0x4016
leaq 0x80(%rsp), %rdi
callq 0x2970
leaq 0x38(%rsp), %rdi
callq 0x2970
leaq 0x10(%rsp), %rdi
callq 0x2970
leaq 0x48(%rsp), %r12
movq %r12, %rdi
callq 0x4016
cmpl 0x24(%rsp), %r15d
jne 0x9c20
testl %r14d, %r14d
jle 0xa14b
movl %r14d, %r13d
negl %r13d
movl $0x1, %r15d
movl $0x1, %r12d
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x51ec
movsd (%rax), %xmm0
andpd 0x1f47(%rip), %xmm0     # 0xc050
movsd 0x220f(%rip), %xmm1     # 0xc320
ucomisd %xmm0, %xmm1
jbe 0xa12c
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x51ec
movq $0x0, (%rax)
leal (%r12,%r13), %eax
incl %eax
movl %r12d, %ecx
incl %ecx
movl %ecx, %r12d
cmpl $0x1, %eax
jne 0xa0ef
leal 0x1(%r15), %eax
cmpl %r14d, %r15d
movl %eax, %r15d
jne 0xa0e9
leaq 0x90(%rsp), %rdi
callq 0x4016
leaq 0x58(%rsp), %rdi
callq 0x4016
leaq 0xa0(%rsp), %rdi
callq 0x2970
leaq 0xc0(%rsp), %rdi
callq 0x2970
leaq 0xb0(%rsp), %rdi
callq 0x2970
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 0x38(%rsp), %rdi
callq 0x4016
jmp 0xa321
movq %rax, %r14
leaq 0xf8(%rsp), %rdi
callq 0x2970
jmp 0xa1c5
movq %rax, %r14
leaq 0x108(%rsp), %rdi
callq 0x2970
jmp 0xa330
jmp 0xa32d
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0xa326
jmp 0xa32d
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
jmp 0xa326
jmp 0xa2ad
movq %rax, %r14
jmp 0xa33d
movq %rax, %r14
jmp 0xa347
jmp 0xa247
movq %rax, %r14
movq 0x178(%rsp), %rdi
cmpq %r15, %rdi
je 0xa36e
callq 0x2110
jmp 0xa36e
jmp 0xa237
jmp 0xa23f
movq %rax, %r14
jmp 0xa36e
movq %rax, %r14
jmp 0xa361
movq %rax, %r14
jmp 0xa354
jmp 0xa2e9
movq %rax, %r14
leaq 0x168(%rsp), %rdi
callq 0x2970
jmp 0xa269
movq %rax, %r14
leaq 0x148(%rsp), %rdi
callq 0x2970
jmp 0xa2ec
jmp 0xa296
jmp 0xa32d
jmp 0xa2d5
jmp 0xa2da
jmp 0xa2da
jmp 0xa2e9
movq %rax, %r14
leaq 0x138(%rsp), %rdi
jmp 0xa2a1
jmp 0xa2da
movq %rax, %r14
leaq 0xd8(%rsp), %rdi
callq 0x4016
jmp 0xa2dd
jmp 0xa32d
movq %rax, %r14
jmp 0xa321
movq %rax, %r14
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0xa321
callq 0x2110
jmp 0xa321
jmp 0xa305
jmp 0xa314
movq %rax, %r14
jmp 0xa2f6
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x4016
jmp 0xa2ec
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x4016
leaq 0x80(%rsp), %rdi
callq 0x2970
jmp 0xa308
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x2970
jmp 0xa317
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2970
leaq 0x48(%rsp), %rdi
callq 0x4016
jmp 0xa330
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x4016
leaq 0x58(%rsp), %rdi
callq 0x4016
leaq 0xa0(%rsp), %rdi
callq 0x2970
leaq 0xc0(%rsp), %rdi
callq 0x2970
leaq 0xb0(%rsp), %rdi
callq 0x2970
movq %rbx, %rdi
callq 0x4016
movq %r14, %rdi
callq 0x21c0