// File: yukimasano[P]cpp_matrix/Matrix.cpp
// Function: evec_c(Matrix&)
Vector evec_c(Matrix& A){
	assert(nrows(A) == ncols(A));
	// INITIALISATION
	Vector x(nrows(A));
  Vector xold(nrows(A));
  xold  = randv(xold);
  x  = randv(x);
  float eps = 1.0;
  float lam;
  while (eps>1e-15){
    x = A*x;
    lam = (xold*x)/xold.norm();
    x = x/x.norm();
    eps=(x-xold).norm();
    xold=x;
  }
  signed int s = (lam>0) - (lam<0);
  x= x*s;
  return x;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x3ac0
movl %eax, 0x3c(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x3ad0
movl %eax, %ecx
movl 0x3c(%rsp), %eax
cmpl %ecx, %eax
jne 0x629e
jmp 0x62bd
leaq 0x906d(%rip), %rdi      # 0xf312
leaq 0x8e9d(%rip), %rsi      # 0xf149
movl $0x1aa, %edx            # imm = 0x1AA
leaq 0x906f(%rip), %rcx      # 0xf327
callq 0x2090
movb $0x0, 0xe7(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x3ac0
movq 0x28(%rsp), %rdi
movl %eax, %esi
callq 0xd040
movq 0xe8(%rsp), %rdi
callq 0x3ac0
movl %eax, %esi
leaq 0xd0(%rsp), %rdi
callq 0xd040
jmp 0x62fc
leaq 0xb0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xe4b0
jmp 0x6313
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xdc70
jmp 0x632a
leaq 0xb0(%rsp), %rdi
callq 0xd170
movq 0x28(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0xe4b0
jmp 0x634b
movq 0x28(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xdc70
jmp 0x635f
leaq 0xa0(%rsp), %rdi
callq 0xd170
movss 0x8cf8(%rip), %xmm0     # 0xf06c
movss %xmm0, 0x9c(%rsp)
movss 0x9c(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x8cf6(%rip), %xmm1     # 0xf088
ucomisd %xmm1, %xmm0
jbe 0x65ce
movq 0x28(%rsp), %rdx
movq 0xe8(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x4800
jmp 0x63b8
movq 0x28(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0xdc70
jmp 0x63cc
leaq 0x88(%rsp), %rdi
callq 0xd170
movq 0x28(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xd740
movsd %xmm0, 0x20(%rsp)
jmp 0x63f3
leaq 0xd0(%rsp), %rdi
movl $0x2, %esi
callq 0xe320
movsd %xmm0, 0x18(%rsp)
jmp 0x640d
movq 0x28(%rsp), %rdi
movsd 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x98(%rsp)
movl $0x2, %esi
callq 0xe320
movsd %xmm0, 0x10(%rsp)
jmp 0x6441
movq 0x28(%rsp), %rsi
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0xd9c0
jmp 0x6463
movq 0x28(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0xdc70
jmp 0x6474
leaq 0x78(%rsp), %rdi
callq 0xd170
movq 0x28(%rsp), %rsi
leaq 0x60(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0xd470
jmp 0x6497
leaq 0x60(%rsp), %rdi
movl $0x2, %esi
callq 0xe320
movsd %xmm0, 0x8(%rsp)
jmp 0x64ae
movsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x9c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0xd170
movq 0x28(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xdc70
jmp 0x64df
jmp 0x637d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x6694
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x666e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xd170
jmp 0x666e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xd170
jmp 0x666e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0xd170
jmp 0x666e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xd170
jmp 0x666e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x60(%rsp), %rdi
callq 0xd170
jmp 0x666e
movq 0x28(%rsp), %rsi
movss 0x98(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
seta %al
movzbl %al, %eax
ucomiss %xmm1, %xmm0
seta %cl
movzbl %cl, %ecx
subl %ecx, %eax
movl %eax, 0x5c(%rsp)
cvtsi2sdl 0x5c(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0xd860
jmp 0x6614
movq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xdc70
jmp 0x6625
leaq 0x48(%rsp), %rdi
callq 0xd170
movb $0x1, 0xe7(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xd170
testb $0x1, 0xe7(%rsp)
jne 0x6687
jmp 0x667d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x48(%rsp), %rdi
callq 0xd170
leaq 0xd0(%rsp), %rdi
callq 0xd170
jmp 0x6694
movq 0x28(%rsp), %rdi
callq 0xd170
movq 0x30(%rsp), %rax
addq $0xf8, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0xd170
movq 0xc8(%rsp), %rdi
callq 0x21e0
nopl (%rax,%rax)