// File: /workspace/github_cpp_makefile_star2_O2/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 0x7fb1
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x80b8
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x372f
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %r15, %rdx
callq 0x8238
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x859c
leaq 0x8(%rsp), %rdi
callq 0x8104
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x8068
leaq 0x48(%rsp), %r13
leaq 0x28(%rsp), %rbp
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x372f
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x8238
movq %rbp, %rdi
pushq $0x2
popq %rsi
callq 0x891a
movsd %xmm0, 0x40(%rsp)
movq %rbp, %rdi
callq 0x8104
movq %r13, %rdi
callq 0x8104
movsd 0x40(%rsp), %xmm0
ucomisd 0x11da(%rip), %xmm0     # 0x9098
jbe 0x7f8b
movq 0x38(%rsp), %rax
incl (%rax)
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x8418
leaq 0x68(%rsp), %r14
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8418
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x8238
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0x859c
movq %rbp, %rdi
callq 0x8104
leaq 0x68(%rsp), %rdi
callq 0x8104
movq %r13, %rdi
callq 0x8104
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x8111
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x859c
movq %rbp, %rdi
callq 0x8104
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x372f
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x8238
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x859c
movq %rbp, %rdi
callq 0x8104
movq %r13, %rdi
callq 0x8104
jmp 0x7e73
leaq 0x8(%rsp), %rdi
callq 0x8104
leaq 0x18(%rsp), %rdi
callq 0x8104
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1362(%rip), %rdi      # 0x931a
leaq 0x1192(%rip), %rsi      # 0x9151
leaq 0x14ca(%rip), %rcx      # 0x9490
movl $0x3b3, %edx            # imm = 0x3B3
callq 0x20b0
jmp 0x7fd4
jmp 0x800d
movq %rax, %r14
jmp 0x8038
movq %rax, %r14
jmp 0x8042
jmp 0x800d
movq %rax, %r14
jmp 0x7ff2
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x8104
leaq 0x68(%rsp), %rdi
jmp 0x801f
jmp 0x8017
jmp 0x8012
jmp 0x8012
movq %rax, %r14
leaq 0x28(%rsp), %rdi
jmp 0x8029
jmp 0x800d
jmp 0x800d
movq %rax, %r14
jmp 0x802e
movq %rax, %r14
jmp 0x8024
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x8104
leaq 0x48(%rsp), %rdi
callq 0x8104
leaq 0x8(%rsp), %rdi
callq 0x8104
leaq 0x18(%rsp), %rdi
callq 0x8104
movq %rbx, %rdi
callq 0x8104
movq %r14, %rdi
callq 0x21d0