// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/mathop.c
// Function: vl_lapack_dlasv2
void
vl_lapack_dlasv2 (double *smin,
                  double *smax,
                  double *sv,
                  double *cv,
                  double *su,
                  double *cu,
                  double f,
                  double g,
                  double h)
{
  double svt, cvt, sut, cut; /* temporary sv, cv, su, and cu */
  double ft = f, gt = g, ht = h; /* temporary f, g, h */
  double fa = fabs(f), ga = fabs(g), ha = fabs(h); /* |f|, |g|, and |h| */
  int pmax = 1 ; /* pointer to max abs entry */
  int swap = 0 ; /* is swapped */
  int glarge = 0 ; /* is g very large */
  int tsign ; /* tmp sign */
  double fmh ; /* |f| -|h| */
  double d ; /* (|f| -|h|)/|f| */
  double dd ; /* d*d */
  double q ; /* g/f */
  double qq ; /* q*q */
  double s ; /* (|f| + |h|)/|f| */
  double ss ; /* s*s */
  double spq ; /* sqrt(ss + qq) */
  double dpq ; /* sqrt(dd + qq) */
  double a ; /* (spq + dpq)/2 */
  double tmp ; /* temporaries */
  double tt;

  /* make fa >= ha */
  if (fa < ha) {
    pmax = 3 ;
    tmp =ft ; ft = ht ; ht = tmp ; /* swap ft and ht */
    tmp =fa ; fa = ha ; ha = tmp ; /* swap fa and ha */
    swap = 1 ;
  }

  if (ga == 0.0) { /* diagonal */
    *smin = ha ;
    *smax = fa ;
    /* identity matrix */
    cut = 1.0 ; sut = 0.0 ;
    cvt = 1.0 ; svt = 0.0 ;
  }
  else { /* not diagonal */
    if (ga > fa) { /* g is the largest entry */
      pmax = 2 ;
      if ((fa / ga) < VL_EPSILON_D) { /* g is very large */
        glarge = 1 ;
        *smax = ga ; /* 1 ulp */
        if (ha > 1.0) {
          *smin = fa / (ga / ha) ; /* 2 ulps */
        } else {
          *smin = (fa / ga) * ha ; /* 2 ulps */
        }
        cut = 1.0 ; sut = ht / gt ;
        cvt = 1.0 ; svt = ft / gt ;
      }
    }

    if (glarge == 0) { /* normal case */
      fmh = fa - ha ; /* 1ulp */
      if (fmh == fa) {  /* cope with infinite f or h */
        d = 1.0 ;
      } else {
        d = fmh / fa ; /* note 0<=d<=1.0, 2 ulps */
      }
      q = gt / ft ; /* note |q|<1/EPS, 1 ulp */
      s = 2.0 - d ; /* note s>=1.0, 3 ulps */
      dd = d*d ;
      qq = q*q ;
      ss = s*s ;
      spq = sqrt(ss + qq) ; /* note 1<=spq<=1+1/EPS, 5 ulps */
      if (d == 0.0) {
        dpq = fabs(q) ; /* 0 ulp */
      } else {
        dpq = sqrt(dd + qq) ; /* note 0<=dpq<=1+1/EPS, 3.5 ulps */
      }
      a = 0.5 * (spq + dpq) ; /* note 1<=a<=1 + |q|, 6 ulps */
      *smin = ha / a; /* 7 ulps */
      *smax = fa * a; /* 7 ulps */
      if (qq==0.0) { /* qq underflow */
        if (d==0.0) {
          tmp = sign(ft)*2*sign(gt); /* 0ulp */
        }
        else {
          tmp = gt/(sign(ft)*fmh) + q/s; /* 6 ulps */
        }
      } else {
        tmp = (q/(spq + s) + q/(dpq + d))*(1.0 + a);  /* 17 ulps */
      }
      /* if qq */
      tt = sqrt(tmp*tmp + 4.0) ; /* 18.5 ulps */
      cvt = 2.0 / tt ; /* 19.5 ulps */
      svt = tmp / tt ; /* 36.5 ulps */
      cut = (cvt + svt*q) / a ; /* 46.5 ulps */
      sut = (ht / ft) * svt / a ; /* 45.5 ulps */
    } /* if g not large */
  } /* if ga */
  if (swap == 1) {
    *cu = svt ; *su = cvt ;
    *cv = sut ; *sv = cut ;
  } else {
    *cu = cut ; *su = sut ;
    *cv = cvt ; *sv = svt ;
  }
  /* correct the signs of smax and smin */
  if (pmax==1) { tsign = sign(*cv) * sign(*cu) * sign(f) ; }
  if (pmax==2) { tsign = sign(*sv) * sign(*cu) * sign(g) ; }
  if (pmax==3) { tsign = sign(*sv) * sign(*su) * sign(h) ; }
  *smax = isign(tsign) * (*smax);
  *smin = isign(tsign * sign(f) * sign(h)) * (*smin) ;
}

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
movq %rcx, 0xe8(%rsp)
movq %r8, 0xe0(%rsp)
movq %r9, 0xd8(%rsp)
movsd %xmm0, 0xd0(%rsp)
movsd %xmm1, 0xc8(%rsp)
movsd %xmm2, 0xc0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0xc8(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0xc0(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0xd0(%rsp), %xmm0
movaps 0x1d5f8(%rip), %xmm1    # 0x59150
pand %xmm1, %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0xc8(%rsp), %xmm0
movaps 0x1d5db(%rip), %xmm1    # 0x59150
pand %xmm1, %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0xc0(%rsp), %xmm0
movaps 0x1d5c1(%rip), %xmm1    # 0x59150
pand %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movl $0x1, 0x6c(%rsp)
movl $0x0, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
movsd 0x80(%rsp), %xmm1
movsd 0x70(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3bc30
movl $0x3, 0x6c(%rsp)
movsd 0x98(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movl $0x1, 0x68(%rsp)
movsd 0x78(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3bca7
jp 0x3bca7
movsd 0x70(%rsp), %xmm0
movq 0x100(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x80(%rsp), %xmm0
movq 0xf8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x1d468(%rip), %xmm0    # 0x590d8
movsd %xmm0, 0xa0(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0x1d44b(%rip), %xmm0    # 0x590d8
movsd %xmm0, 0xb0(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xb8(%rsp)
jmp 0x3c0cc
movsd 0x78(%rsp), %xmm0
ucomisd 0x80(%rsp), %xmm0
jbe 0x3bdb5
movl $0x2, 0x6c(%rsp)
movsd 0x80(%rsp), %xmm1
divsd 0x78(%rsp), %xmm1
movsd 0x1dced(%rip), %xmm0    # 0x599c8
ucomisd %xmm1, %xmm0
jbe 0x3bdb3
movl $0x1, 0x64(%rsp)
movsd 0x78(%rsp), %xmm0
movq 0xf8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x70(%rsp), %xmm0
movsd 0x1d3cb(%rip), %xmm1    # 0x590d8
ucomisd %xmm1, %xmm0
jbe 0x3bd3a
movsd 0x80(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
divsd 0x70(%rsp), %xmm1
divsd %xmm1, %xmm0
movq 0x100(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x3bd5b
movsd 0x80(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
movq 0x100(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x1d375(%rip), %xmm0    # 0x590d8
movsd %xmm0, 0xa0(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x90(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0x1d349(%rip), %xmm0    # 0x590d8
movsd %xmm0, 0xb0(%rsp)
movsd 0x98(%rsp), %xmm0
divsd 0x90(%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
jmp 0x3bdb5
cmpl $0x0, 0x64(%rsp)
jne 0x3c0ca
movsd 0x80(%rsp), %xmm0
subsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x58(%rsp), %xmm0
ucomisd 0x80(%rsp), %xmm0
jne 0x3bdf8
jp 0x3bdf8
movsd 0x1d2e8(%rip), %xmm0    # 0x590d8
movsd %xmm0, 0x50(%rsp)
jmp 0x3be0d
movsd 0x58(%rsp), %xmm0
divsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x90(%rsp), %xmm0
divsd 0x98(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x1d2b3(%rip), %xmm0    # 0x590e0
subsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x50(%rsp), %xmm0
mulsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x40(%rsp), %xmm0
mulsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x30(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
callq 0x9b20
movsd %xmm0, 0x20(%rsp)
movsd 0x50(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3beb0
jp 0x3beb0
movsd 0x40(%rsp), %xmm0
movaps 0x1d2ac(%rip), %xmm1    # 0x59150
pand %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x3bec7
movsd 0x48(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
callq 0x9b20
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm1
addsd 0x18(%rsp), %xmm1
movsd 0x1d1a5(%rip), %xmm0    # 0x59080
mulsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x70(%rsp), %xmm0
divsd 0x10(%rsp), %xmm0
movq 0x100(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x80(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movq 0xf8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0x38(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3bfd9
jp 0x3bfd9
movsd 0x50(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3bf8d
jp 0x3bf8d
movsd 0x98(%rsp), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
shll %eax
movsd 0x90(%rsp), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %edx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x3bfd7
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm2
xorps %xmm1, %xmm1
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm2, %xmm1
cmoval %ecx, %eax
cvtsi2sd %eax, %xmm1
mulsd 0x58(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0x40(%rsp), %xmm1
divsd 0x30(%rsp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x3c021
movsd 0x40(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
addsd 0x30(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0x40(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
addsd 0x50(%rsp), %xmm2
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd 0x1d0c7(%rip), %xmm1    # 0x590d8
addsd 0x10(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x1d0df(%rip), %xmm1    # 0x59118
addsd %xmm1, %xmm0
callq 0x9b20
movsd %xmm0, (%rsp)
movsd 0x1d091(%rip), %xmm0    # 0x590e0
divsd (%rsp), %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0x8(%rsp), %xmm0
divsd (%rsp), %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0xb0(%rsp), %xmm1
movsd 0xb8(%rsp), %xmm0
movsd 0x40(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x98(%rsp), %xmm0
mulsd 0xb8(%rsp), %xmm0
divsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
jmp 0x3c0cc
cmpl $0x1, 0x68(%rsp)
jne 0x3c129
movsd 0xb8(%rsp), %xmm0
movq 0xd8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0xb0(%rsp), %xmm0
movq 0xe0(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0xa8(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0xa0(%rsp), %xmm0
movq 0xf0(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x3c17d
movsd 0xa0(%rsp), %xmm0
movq 0xd8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0xa8(%rsp), %xmm0
movq 0xe0(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0xb0(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0xb8(%rsp), %xmm0
movq 0xf0(%rsp), %rax
movsd %xmm0, (%rax)
cmpl $0x1, 0x6c(%rsp)
jne 0x3c1eb
movq 0xe8(%rsp), %rax
movsd (%rax), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
movq 0xd8(%rsp), %rcx
movsd (%rcx), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %edx, %ecx
imull %ecx, %eax
movsd 0xd0(%rsp), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %edx, %ecx
imull %ecx, %eax
movl %eax, 0x60(%rsp)
cmpl $0x2, 0x6c(%rsp)
jne 0x3c259
movq 0xf0(%rsp), %rax
movsd (%rax), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
movq 0xd8(%rsp), %rcx
movsd (%rcx), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %edx, %ecx
imull %ecx, %eax
movsd 0xc8(%rsp), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %edx, %ecx
imull %ecx, %eax
movl %eax, 0x60(%rsp)
cmpl $0x3, 0x6c(%rsp)
jne 0x3c2c7
movq 0xf0(%rsp), %rax
movsd (%rax), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
movq 0xe0(%rsp), %rcx
movsd (%rcx), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %edx, %ecx
imull %ecx, %eax
movsd 0xc0(%rsp), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %edx, %ecx
imull %ecx, %eax
movl %eax, 0x60(%rsp)
movl 0x60(%rsp), %edx
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovll %ecx, %eax
cvtsi2sd %eax, %xmm0
movq 0xf8(%rsp), %rax
mulsd (%rax), %xmm0
movq 0xf8(%rsp), %rax
movsd %xmm0, (%rax)
movl 0x60(%rsp), %edx
movsd 0xd0(%rsp), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
imull %eax, %edx
movsd 0xc0(%rsp), %xmm1
xorps %xmm0, %xmm0
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
imull %eax, %edx
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl $0x0, %edx
cmovll %ecx, %eax
cvtsi2sd %eax, %xmm0
movq 0x100(%rsp), %rax
mulsd (%rax), %xmm0
movq 0x100(%rsp), %rax
movsd %xmm0, (%rax)
addq $0x108, %rsp            # imm = 0x108
retq
nop