// File: /workspace/github_cpp_makefile_star2_O3/yukimasano[P]cpp_matrix/Matrix.cpp
// Function: momentum(Matrix&, Vector&, int&, double, double)
Vector momentum(Matrix& A, Vector& v, int& count,double lambda,double mu){
	assert(nrows(A) == ncols(A));
	int m =nrows(A);
	// we want a square system

	// INITIALISATION
	Vector x= v;
	double tol = 1.e-12;
	Vector r = A*x;
	r= r-v;
	Vector temp(m);
	//std::cout<<" before the while loop "<<(A*x -c).norm() << std::endl<<std::flush;
	while ((A*x -v).norm() > tol){
		count+=1;
    temp = mu*temp - lambda*r;
		x = x + temp;
		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 $0x78, %rsp
movq %rcx, 0x38(%rsp)
movsd %xmm0, 0x60(%rsp)
movsd %xmm1, 0x58(%rsp)
movl 0x8(%rsi), %ebp
cmpl 0xc(%rsi), %ebp
jne 0x8085
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x822a
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3915
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %r15, %rdx
callq 0x8428
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x893a
leaq 0x8(%rsp), %rdi
callq 0x827e
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x81e8
leaq 0x48(%rsp), %r13
leaq 0x28(%rsp), %rbp
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3915
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x8428
movq %rbp, %rdi
movl $0x2, %esi
callq 0x8d68
movsd %xmm0, 0x40(%rsp)
movq %rbp, %rdi
callq 0x827e
movq %r13, %rdi
callq 0x827e
movsd 0x40(%rsp), %xmm0
ucomisd 0x1106(%rip), %xmm0     # 0x9098
jbe 0x805f
movq 0x38(%rsp), %rax
incl (%rax)
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x86d1
leaq 0x68(%rsp), %r14
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x86d1
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x8428
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0x893a
movq %rbp, %rdi
callq 0x827e
leaq 0x68(%rsp), %rdi
callq 0x827e
movq %r13, %rdi
callq 0x827e
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x828b
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x893a
movq %rbp, %rdi
callq 0x827e
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3915
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x8428
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x893a
movq %rbp, %rdi
callq 0x827e
movq %r13, %rdi
callq 0x827e
jmp 0x7f45
leaq 0x8(%rsp), %rdi
callq 0x827e
leaq 0x18(%rsp), %rdi
callq 0x827e
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x128e(%rip), %rdi      # 0x931a
leaq 0x10be(%rip), %rsi      # 0x9151
leaq 0x13f6(%rip), %rcx      # 0x9490
movl $0x3b3, %edx            # imm = 0x3B3
callq 0x20b0
jmp 0x80a8
jmp 0x80e1
movq %rax, %r14
jmp 0x810c
movq %rax, %r14
jmp 0x8116
jmp 0x80e1
movq %rax, %r14
jmp 0x80c6
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x827e
leaq 0x68(%rsp), %rdi
jmp 0x80f3
jmp 0x80eb
jmp 0x80e6
jmp 0x80e6
movq %rax, %r14
leaq 0x28(%rsp), %rdi
jmp 0x80fd
jmp 0x80e1
jmp 0x80e1
movq %rax, %r14
jmp 0x8102
movq %rax, %r14
jmp 0x80f8
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x827e
leaq 0x48(%rsp), %rdi
callq 0x827e
leaq 0x8(%rsp), %rdi
callq 0x827e
leaq 0x18(%rsp), %rdi
callq 0x827e
movq %rbx, %rdi
callq 0x827e
movq %r14, %rdi
callq 0x21f0