// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/mathop.c
// Function: vl_svd2
void
vl_svd2 (double* S, double *U, double *V, double const *M)
{
  double m11 = M[0] ;
  double m21 = M[1] ;
  double m12 = M[2] ;
  double m22 = M[3] ;
  double cu1 = m11 ;
  double su1 = m21 ;
  double norm = sqrt(cu1*cu1 + su1*su1) ;
  double cu2, su2, cv2, sv2 ;
  double f, g, h ;
  double smin, smax ;
  cu1 /= norm ;
  su1 /= norm ;

  f = cu1 * m11 + su1 * m21 ;
  g = cu1 * m12 + su1 * m22 ;
  h = - su1 * m12 + cu1 * m22 ;

  vl_lapack_dlasv2 (&smin, &smax,
                    &sv2, &cv2,
                    &su2, &cu2,
                    f, g, h) ;

  assert(S) ;
  S[0] = smax ;
  S[1] = 0 ;
  S[2] = 0 ;
  S[3] = smin ;

  if (U) {
    U[0] = cu2*cu1 - su2*su1 ;
    U[1] = su2*cu1 + cu2*su1 ;
    U[2] = - cu2*su1 - su2*cu1 ;
    U[3] = - su2*su1 + cu2*cu1 ;
  }
  if (V) {
    V[0] = cv2 ;
    V[1] = sv2 ;
    V[2] = - sv2 ;
    V[3] = cv2 ;
  }
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq 0x88(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x88(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x88(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x88(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x60(%rsp), %xmm2
movsd 0x58(%rsp), %xmm1
mulsd 0x58(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x9b20
movsd %xmm0, 0x50(%rsp)
movsd 0x50(%rsp), %xmm1
movsd 0x60(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x50(%rsp), %xmm1
movsd 0x58(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x80(%rsp), %xmm2
movsd 0x58(%rsp), %xmm1
mulsd 0x78(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x60(%rsp), %xmm0
movsd 0x70(%rsp), %xmm2
movsd 0x58(%rsp), %xmm1
mulsd 0x68(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x58(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x70(%rsp), %xmm2
movsd 0x60(%rsp), %xmm1
mulsd 0x68(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x40(%rsp), %r8
leaq 0x48(%rsp), %r9
callq 0x9810
movsd 0x8(%rsp), %xmm0
movq 0xa0(%rsp), %rax
movsd %xmm0, (%rax)
movq 0xa0(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
movq 0xa0(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movsd 0x10(%rsp), %xmm0
movq 0xa0(%rsp), %rax
movsd %xmm0, 0x18(%rax)
cmpq $0x0, 0x98(%rsp)
je 0x3ba4b
movsd 0x48(%rsp), %xmm0
movsd 0x60(%rsp), %xmm2
movsd 0x40(%rsp), %xmm1
mulsd 0x58(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x98(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x40(%rsp), %xmm0
movsd 0x60(%rsp), %xmm2
movsd 0x48(%rsp), %xmm1
mulsd 0x58(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x98(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movsd 0x48(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x58(%rsp), %xmm2
movsd 0x40(%rsp), %xmm1
mulsd 0x60(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x98(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movsd 0x40(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x58(%rsp), %xmm2
movsd 0x48(%rsp), %xmm1
mulsd 0x60(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x98(%rsp), %rax
movsd %xmm0, 0x18(%rax)
cmpq $0x0, 0x90(%rsp)
je 0x3bab8
movsd 0x38(%rsp), %xmm0
movq 0x90(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x30(%rsp), %xmm0
movq 0x90(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movsd 0x30(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x90(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movsd 0x38(%rsp), %xmm0
movq 0x90(%rsp), %rax
movsd %xmm0, 0x18(%rax)
addq $0xa8, %rsp
retq