// File: /workspace/github_cpp_makefile_star2_O3/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 0x7308
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x822a
movq %r14, %rdi
movl $0x2, %esi
callq 0x8d68
movsd %xmm0, 0x10(%rsp)
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %rbx, 0x8(%rsp)
movq %rbx, %rdx
callq 0x3915
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x8428
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x893a
movq %r14, 0x38(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x827e
leaq 0x18(%rsp), %rdi
movl %ebp, %esi
callq 0x81e8
movsd 0x10(%rsp), %xmm0
mulsd 0x1ec9(%rip), %xmm0     # 0x9090
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 0x8d68
ucomisd 0x10(%rsp), %xmm0
jbe 0x72dd
movq %r13, %rdi
movq %r13, %rsi
callq 0x85c5
movsd %xmm0, 0x60(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3915
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x893a
movq %rbp, %rdi
callq 0x827e
movq %r13, %rdi
movq %rbx, %rsi
callq 0x85c5
movsd %xmm0, 0x58(%rsp)
movq 0x40(%rsp), %rax
incl (%rax)
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
movq %r13, %rdx
callq 0x86d1
movq %r14, %rdi
movq %r15, %rsi
leaq 0x58(%rsp), %rdx
callq 0x8758
movq %rbp, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
callq 0x828b
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x893a
movq %rbp, %rdi
callq 0x827e
movq %r14, %rdi
callq 0x827e
movq %r15, %rdi
callq 0x827e
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3915
movq %rbp, %rdi
movq 0x38(%rsp), %rsi
movq %r14, %rdx
callq 0x8428
movq %r13, %rdi
movq %rbp, %rsi
callq 0x893a
movq %rbp, %rdi
callq 0x827e
movq %r14, %rdi
callq 0x827e
jmp 0x71e1
leaq 0x18(%rsp), %rdi
callq 0x827e
leaq 0x28(%rsp), %rdi
callq 0x827e
movq 0x8(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x200b(%rip), %rdi      # 0x931a
leaq 0x1e3b(%rip), %rsi      # 0x9151
leaq 0x20eb(%rip), %rcx      # 0x9408
movl $0x330, %edx            # imm = 0x330
callq 0x20b0
jmp 0x732b
jmp 0x7393
movq %rax, %r14
jmp 0x73a0
movq %rax, %r14
jmp 0x73aa
movq %rax, %r14
movq %rbx, %rdi
jmp 0x73af
jmp 0x7393
jmp 0x7393
movq %rax, %r14
jmp 0x737d
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x827e
jmp 0x7358
movq %rax, %r14
leaq 0x68(%rsp), %rdi
jmp 0x738c
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x827e
jmp 0x7373
jmp 0x7393
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x827e
leaq 0x78(%rsp), %rdi
jmp 0x738c
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x827e
jmp 0x7396
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x827e
leaq 0x28(%rsp), %rdi
callq 0x827e
movq 0x8(%rsp), %rdi
callq 0x827e
movq %r14, %rdi
callq 0x21f0