// File: /workspace/github_cpp_makefile_star2_O1/yukimasano[P]cpp_matrix/Matrix.cpp
// Function: SD(Matrix&, Vector&, int&)
Vector SD(Matrix& A, Vector& v, int& count){
	assert(nrows(A) == ncols(A));
	int m =nrows(A);
	// we want a square system

	// INITIALISATION
	Vector x= v;
	double tol = 1.e-14*v.norm();
	double top;
	Vector r = A*x;
	r= r-v;
	double bottom;
	Vector temp(m);
	double alpha;
	//std::cout<<" before the while loop "<<(A*x -c).norm() << std::endl<<std::flush;
	while (r.norm() > tol){
		top = r*r;
		temp = A*r;
		bottom = r*temp;
		alpha= top/bottom;
		count+=1;
		x = x + top*r/bottom;
		r = v - A*x;
	}
   //	std::cout<<count<<std::endl<<std::flush;

	return x;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x40(%rsp)
movl 0x8(%rsi), %ebp
cmpl 0xc(%rsi), %ebp
jne 0x7358
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x82b8
movq %r14, %rdi
movl $0x2, %esi
callq 0x8dfc
movsd %xmm0, 0x10(%rsp)
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %rbx, 0x8(%rsp)
movq %rbx, %rdx
callq 0x3941
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x84c8
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x89dc
movq %r14, 0x38(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x8310
leaq 0x18(%rsp), %rdi
movl %ebp, %esi
callq 0x8268
movsd 0x10(%rsp), %xmm0
mulsd 0x2e79(%rip), %xmm0     # 0xa090
movsd %xmm0, 0x10(%rsp)
leaq 0x28(%rsp), %r13
leaq 0x48(%rsp), %rbp
leaq 0x78(%rsp), %r15
leaq 0x68(%rsp), %r14
movq %r13, %rdi
movl $0x2, %esi
callq 0x8dfc
ucomisd 0x10(%rsp), %xmm0
jbe 0x732d
movq %r13, %rdi
movq %r13, %rsi
callq 0x8673
movsd %xmm0, 0x60(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3941
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x89dc
movq %rbp, %rdi
callq 0x8310
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8673
movsd %xmm0, 0x58(%rsp)
movq 0x40(%rsp), %rax
incl (%rax)
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
movq %r13, %rdx
callq 0x877e
movq %r14, %rdi
movq %r15, %rsi
leaq 0x58(%rsp), %rdx
callq 0x8804
movq %rbp, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x831d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x89dc
movq %rbp, %rdi
callq 0x8310
movq %r14, %rdi
callq 0x8310
movq %r15, %rdi
callq 0x8310
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3941
movq %rbp, %rdi
movq 0x38(%rsp), %rsi
movq %r14, %rdx
callq 0x84c8
movq %r13, %rdi
movq %rbp, %rsi
callq 0x89dc
movq %rbp, %rdi
callq 0x8310
movq %r14, %rdi
callq 0x8310
jmp 0x7231
leaq 0x18(%rsp), %rdi
callq 0x8310
leaq 0x28(%rsp), %rdi
callq 0x8310
movq 0x8(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2fbb(%rip), %rdi      # 0xa31a
leaq 0x2deb(%rip), %rsi      # 0xa151
leaq 0x309b(%rip), %rcx      # 0xa408
movl $0x330, %edx            # imm = 0x330
callq 0x20b0
jmp 0x737b
jmp 0x73e3
movq %rax, %r14
jmp 0x73f0
movq %rax, %r14
jmp 0x73fa
movq %rax, %r14
movq %rbx, %rdi
jmp 0x73ff
jmp 0x73e3
jmp 0x73e3
movq %rax, %r14
jmp 0x73cd
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x8310
jmp 0x73a8
movq %rax, %r14
leaq 0x68(%rsp), %rdi
jmp 0x73dc
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x8310
jmp 0x73c3
jmp 0x73e3
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x8310
leaq 0x78(%rsp), %rdi
jmp 0x73dc
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x8310
jmp 0x73e6
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x8310
leaq 0x28(%rsp), %rdi
callq 0x8310
movq 0x8(%rsp), %rdi
callq 0x8310
movq %r14, %rdi
callq 0x21f0