// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movapd %xmm1, %xmm6
movapd %xmm0, %xmm5
movq %r9, %r12
movq %r8, %r15
movq %rcx, %r13
movq %rsi, %rbx
movapd 0xd7f1(%rip), %xmm0     # 0x33100
movapd %xmm5, %xmm7
andpd %xmm0, %xmm7
movapd %xmm2, %xmm8
andpd %xmm0, %xmm8
ucomisd %xmm7, %xmm8
movq %rdi, %r14
movapd %xmm2, %xmm9
unpcklpd %xmm5, %xmm9            # xmm9 = xmm9[0],xmm5[0]
movl $0x1, %ebp
jbe 0x25951
shufpd $0x1, %xmm9, %xmm9      # xmm9 = xmm9[1,0]
movl $0x3, %ebp
movapd %xmm7, %xmm11
movapd %xmm8, %xmm10
jmp 0x2595b
movapd %xmm8, %xmm11
movapd %xmm7, %xmm10
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm6
jne 0x2597a
jp 0x2597a
movsd %xmm11, (%r14)
movsd %xmm10, (%rbx)
xorpd %xmm0, %xmm0
jmp 0x25ac9
andpd %xmm6, %xmm0
movb $0x1, %al
ucomisd %xmm10, %xmm0
jbe 0x259f2
movapd %xmm10, %xmm1
divsd %xmm0, %xmm1
movl $0x2, %ebp
movsd 0xe23b(%rip), %xmm3     # 0x33bd8
ucomisd %xmm1, %xmm3
jbe 0x259f2
movsd %xmm0, (%rbx)
mulsd %xmm11, %xmm1
divsd %xmm11, %xmm0
movapd %xmm10, %xmm4
divsd %xmm0, %xmm4
movsd 0xd89e(%rip), %xmm0     # 0x33260
cmpltsd %xmm11, %xmm0
movapd %xmm0, %xmm3
andnpd %xmm1, %xmm3
andpd %xmm4, %xmm0
orpd %xmm3, %xmm0
movlpd %xmm0, (%r14)
movapd %xmm6, %xmm1
unpcklpd %xmm6, %xmm1            # xmm1 = xmm1[0],xmm6[0]
movapd %xmm9, %xmm0
divpd %xmm1, %xmm0
xorl %eax, %eax
jmp 0x259f2
testb %al, %al
je 0x25ac9
movapd %xmm10, %xmm1
subsd %xmm11, %xmm1
movapd %xmm1, %xmm0
divsd %xmm10, %xmm0
movapd %xmm1, 0xe0(%rsp)
cmpeqsd %xmm10, %xmm1
movsd 0xd83b(%rip), %xmm13    # 0x33260
andpd %xmm1, %xmm13
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm13
movapd %xmm9, 0xf0(%rsp)
movapd %xmm9, %xmm3
unpckhpd %xmm9, %xmm3            # xmm3 = xmm3[1],xmm9[1]
movapd %xmm6, %xmm9
divsd %xmm3, %xmm9
movsd 0xe01e(%rip), %xmm12    # 0x33a78
subsd %xmm13, %xmm12
movapd %xmm9, %xmm14
mulsd %xmm9, %xmm14
movapd %xmm12, %xmm0
mulsd %xmm12, %xmm0
addsd %xmm14, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movapd %xmm2, 0xc0(%rsp)
movapd %xmm5, 0xb0(%rsp)
movapd %xmm6, 0x80(%rsp)
movq %rdx, 0x28(%rsp)
movapd %xmm7, 0xa0(%rsp)
movapd %xmm8, 0x90(%rsp)
movapd %xmm9, 0x70(%rsp)
jb 0x25c20
sqrtsd %xmm0, %xmm2
jmp 0x25c8d
movsd 0xd78e(%rip), %xmm9     # 0x33260
movapd %xmm9, %xmm10
ucomisd %xmm7, %xmm8
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
movapd %xmm1, %xmm4
ja 0x25aef
movapd %xmm9, %xmm4
movapd %xmm10, %xmm3
ja 0x25afa
movapd %xmm0, %xmm3
cmpltsd %xmm8, %xmm7
andpd %xmm7, %xmm0
andnpd %xmm10, %xmm7
orpd %xmm0, %xmm7
ja 0x25b14
movapd %xmm1, %xmm9
movsd %xmm4, (%r12)
movsd %xmm3, (%r15)
movlpd %xmm7, (%r13)
movsd %xmm9, (%rdx)
cmpl $0x1, %ebp
jne 0x25b5f
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd (%r12), %xmm0
setbe %al
movl $0x1, %edx
subl %eax, %edx
subl %eax, %edx
ucomisd (%r13), %xmm0
leal -0x1(%rax,%rax), %ecx
cmoval %edx, %ecx
movl %ecx, %eax
negl %eax
ucomisd %xmm5, %xmm0
cmovbel %ecx, %eax
cmpl $0x2, %ebp
jne 0x25b93
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd (%r12), %xmm0
setbe %al
movl $0x1, %edx
subl %eax, %edx
subl %eax, %edx
ucomisd %xmm9, %xmm0
leal -0x1(%rax,%rax), %ecx
cmoval %edx, %ecx
movl %ecx, %eax
negl %eax
ucomisd %xmm6, %xmm0
cmovbel %ecx, %eax
cmpl $0x3, %ebp
jne 0x25bc6
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd (%r15), %xmm0
setbe %al
movl $0x1, %edx
subl %eax, %edx
subl %eax, %edx
ucomisd %xmm9, %xmm0
leal -0x1(%rax,%rax), %ecx
cmoval %edx, %ecx
movl %ecx, %eax
negl %eax
ucomisd %xmm2, %xmm0
cmovbel %ecx, %eax
movl %eax, %ecx
sarl $0x1f, %ecx
orl $0x1, %ecx
movl %eax, %edx
negl %edx
xorpd %xmm0, %xmm0
ucomisd %xmm5, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd (%rbx), %xmm1
cmovbel %eax, %edx
movl %edx, %eax
negl %eax
ucomisd %xmm2, %xmm0
cmovbel %edx, %eax
sarl $0x1f, %eax
orl $0x1, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm1, (%rbx)
mulsd (%r14), %xmm0
movsd %xmm0, (%r14)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd %xmm10, 0x10(%rsp)
movsd %xmm11, (%rsp)
movapd %xmm3, 0x60(%rsp)
movapd %xmm12, 0x50(%rsp)
movapd %xmm13, 0x40(%rsp)
movapd %xmm14, 0x30(%rsp)
callq 0x9990
xorpd %xmm1, %xmm1
movapd 0x30(%rsp), %xmm14
movapd 0x40(%rsp), %xmm13
movapd 0x50(%rsp), %xmm12
movapd 0x60(%rsp), %xmm3
movsd (%rsp), %xmm11
movsd 0x10(%rsp), %xmm10
movapd 0x70(%rsp), %xmm9
movapd 0x80(%rsp), %xmm6
movapd %xmm0, %xmm2
ucomisd %xmm1, %xmm13
jne 0x25ca8
jp 0x25ca8
movapd 0xd462(%rip), %xmm0     # 0x33100
andpd %xmm9, %xmm0
jmp 0x25d3a
movapd %xmm13, %xmm0
mulsd %xmm13, %xmm0
addsd %xmm14, %xmm0
ucomisd %xmm1, %xmm0
jb 0x25cc3
sqrtsd %xmm0, %xmm0
jmp 0x25d3a
movsd %xmm10, 0x10(%rsp)
movsd %xmm11, (%rsp)
movapd %xmm3, 0x60(%rsp)
movapd %xmm12, 0x50(%rsp)
movapd %xmm13, 0x40(%rsp)
movapd %xmm14, 0x30(%rsp)
movapd %xmm2, 0xd0(%rsp)
callq 0x9990
movapd 0xd0(%rsp), %xmm2
movapd 0x30(%rsp), %xmm14
movapd 0x40(%rsp), %xmm13
movapd 0x50(%rsp), %xmm12
movapd 0x60(%rsp), %xmm3
movsd (%rsp), %xmm11
movsd 0x10(%rsp), %xmm10
movapd 0x70(%rsp), %xmm9
movapd 0x80(%rsp), %xmm6
movapd %xmm2, %xmm4
addsd %xmm0, %xmm4
mulsd 0xd486(%rip), %xmm4     # 0x331d0
divsd %xmm4, %xmm11
movsd %xmm11, (%r14)
mulsd %xmm4, %xmm10
movsd %xmm10, (%rbx)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm14
jne 0x25da7
jp 0x25da7
ucomisd %xmm1, %xmm13
jne 0x25de4
jp 0x25de4
xorpd %xmm0, %xmm0
xorl %eax, %eax
ucomisd %xmm3, %xmm0
setbe %al
leal -0x2(,%rax,4), %ecx
shll $0x2, %eax
movl $0x2, %edx
subl %eax, %edx
ucomisd %xmm6, %xmm0
cmovbel %ecx, %edx
xorps %xmm11, %xmm11
cvtsi2sd %edx, %xmm11
jmp 0x25e2b
unpcklpd %xmm13, %xmm12          # xmm12 = xmm12[0],xmm13[0]
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
addpd %xmm12, %xmm2
movapd %xmm9, %xmm0
unpcklpd %xmm9, %xmm0            # xmm0 = xmm0[0],xmm9[0]
divpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0xd488(%rip), %xmm11    # 0x33260
addsd %xmm4, %xmm11
mulsd %xmm1, %xmm11
jmp 0x25e2b
movapd 0xd2e4(%rip), %xmm0     # 0x330d0
movapd 0xe0(%rsp), %xmm2
xorpd %xmm2, %xmm0
cmpltsd %xmm1, %xmm3
andpd %xmm3, %xmm0
andnpd %xmm2, %xmm3
orpd %xmm0, %xmm3
movapd %xmm6, %xmm0
unpcklpd %xmm9, %xmm0            # xmm0 = xmm0[0],xmm9[0]
unpcklpd %xmm12, %xmm3           # xmm3 = xmm3[0],xmm12[0]
divpd %xmm3, %xmm0
movapd %xmm0, %xmm11
unpckhpd %xmm0, %xmm11           # xmm11 = xmm11[1],xmm0[1]
addsd %xmm0, %xmm11
movapd %xmm11, %xmm0
mulsd %xmm11, %xmm0
addsd 0xd403(%rip), %xmm0     # 0x33240
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x25e4d
sqrtsd %xmm0, %xmm0
jmp 0x25e7a
movapd %xmm4, 0x10(%rsp)
movapd %xmm11, (%rsp)
callq 0x9990
movapd (%rsp), %xmm11
movapd 0x10(%rsp), %xmm4
movapd 0x70(%rsp), %xmm9
movapd 0x80(%rsp), %xmm6
movapd 0xc0(%rsp), %xmm2
movapd 0xb0(%rsp), %xmm5
movq 0x28(%rsp), %rdx
movapd 0xa0(%rsp), %xmm7
movapd 0x90(%rsp), %xmm8
movsd 0xdbcb(%rip), %xmm10    # 0x33a78
divsd %xmm0, %xmm10
movapd 0xf0(%rsp), %xmm3
movapd %xmm3, %xmm1
unpcklpd %xmm11, %xmm1           # xmm1 = xmm1[0],xmm11[0]
shufpd $0x1, %xmm0, %xmm3      # xmm3 = xmm3[1],xmm0[0]
divpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
mulsd %xmm0, %xmm9
addsd %xmm10, %xmm9
divsd %xmm4, %xmm9
mulsd %xmm1, %xmm0
divsd %xmm4, %xmm0
shufpd $0x2, %xmm1, %xmm0      # xmm0 = xmm0[0],xmm1[1]
jmp 0x25ad7