// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/hyperspherical.c
// Function: hyperspherical_WKB_vec
int hyperspherical_WKB_vec(int l,
                            double beta,
                            double * __restrict__ sinK_vec,
                            int size_sinK_vec,
                            double * __restrict__ Phi){
  double e, w, w2, alpha, alpha2, t;
  double S, Q, C, argu, Ai;
  int airy_sign = 1, phisign = 1;
  int index_sinK;
  double one_over_alpha;
  double one_over_alpha2;
  double one_over_sqrt_one_plus_alpha2;
  double sqrt_alpha;
  double one_over_e;
  double one_over_beta;
  double cscK;
  double pow_argu_onesixth;

  one_over_e = sqrt(l*(l+1.0));
  e = 1.0/one_over_e;
  alpha = beta*e;
  alpha2 = alpha*alpha;
  one_over_alpha = 1.0/alpha;
  one_over_alpha2 = one_over_alpha*one_over_alpha;
  one_over_sqrt_one_plus_alpha2 = 1.0/sqrt(1.0+alpha2);
  sqrt_alpha=sqrt(alpha);
  one_over_beta = 1.0/beta;

  for (index_sinK=0; index_sinK<size_sinK_vec; index_sinK++){
    cscK=1.0/sinK_vec[index_sinK];
    w = alpha*sinK_vec[index_sinK];
    w2 = w*w;
    if (alpha > cscK){
      S = alpha*log((sqrt(w2-1.0)+sqrt(w2+alpha2))*one_over_sqrt_one_plus_alpha2)+
        atan(one_over_alpha*sqrt((w2+alpha2)/(w2-1.0)))-M_PI_2;
      airy_sign = -1;
    }
    else{
      t = sqrt(1.0-w2)/sqrt(1.0+w2*one_over_alpha2);
      S = atanh(t)-alpha*atan(t*one_over_alpha);
      airy_sign = 1;
    }
    argu = 1.5*S*one_over_e;
    Q = cscK*cscK-alpha2;
    C = 0.5*sqrt_alpha*one_over_beta;
    pow_argu_onesixth = pow(argu,1.0/6.0);
    Ai = airy_cheb_approx(airy_sign*pow(pow_argu_onesixth,4));
    Phi[index_sinK] = phisign*2.0*_SQRT_PI_*C*pow_argu_onesixth*pow(fabs(Q),-0.25)*Ai*cscK;
  }
  return _SUCCESS_;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movl %edi, 0x114(%rsp)
movsd %xmm0, 0x108(%rsp)
movq %rsi, 0x100(%rsp)
movl %edx, 0xfc(%rsp)
movq %rcx, 0xf0(%rsp)
movl $0x1, 0x94(%rsp)
movl $0x1, 0x90(%rsp)
cvtsi2sdl 0x114(%rsp), %xmm0
cvtsi2sdl 0x114(%rsp), %xmm1
movsd 0x18f03a(%rip), %xmm2   # 0x1d2248
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x82e0
movsd %xmm0, 0x60(%rsp)
movsd 0x18f01f(%rip), %xmm0   # 0x1d2248
divsd 0x60(%rsp), %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0x108(%rsp), %xmm0
mulsd 0xe8(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0xd0(%rsp), %xmm0
mulsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0x18efd2(%rip), %xmm0   # 0x1d2248
divsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x80(%rsp), %xmm0
mulsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
movsd 0x18efa0(%rip), %xmm0   # 0x1d2248
addsd 0xc8(%rsp), %xmm0
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x18ef87(%rip), %xmm0   # 0x1d2248
divsd %xmm1, %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0xd0(%rsp), %xmm0
callq 0x82e0
movsd %xmm0, 0x68(%rsp)
movsd 0x18ef61(%rip), %xmm0   # 0x1d2248
divsd 0x108(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movl $0x0, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jge 0x436be
movq 0x100(%rsp), %rax
movslq 0x8c(%rsp), %rcx
movsd 0x18ef1b(%rip), %xmm0   # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0xd0(%rsp), %xmm0
movq 0x100(%rsp), %rax
movslq 0x8c(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0xe0(%rsp), %xmm0
mulsd 0xe0(%rsp), %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0xd0(%rsp), %xmm0
ucomisd 0x50(%rsp), %xmm0
jbe 0x43480
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd 0x18ee99(%rip), %xmm1   # 0x1d2248
subsd %xmm1, %xmm0
callq 0x82e0
movsd %xmm0, 0x28(%rsp)
movsd 0xd8(%rsp), %xmm0
addsd 0xc8(%rsp), %xmm0
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
addsd %xmm1, %xmm0
mulsd 0x70(%rsp), %xmm0
callq 0x82f0
movsd %xmm0, 0x38(%rsp)
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0xd8(%rsp), %xmm0
addsd 0xc8(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movsd 0x18ee23(%rip), %xmm2   # 0x1d2248
subsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x8310
movsd 0x38(%rsp), %xmm2
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x19208d(%rip), %xmm1   # 0x1d54f0
subsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
movl $0xffffffff, 0x94(%rsp) # imm = 0xFFFFFFFF
jmp 0x43552
movsd 0x18edc0(%rip), %xmm0   # 0x1d2248
subsd 0xd8(%rsp), %xmm0
callq 0x82e0
movsd %xmm0, 0x10(%rsp)
movsd 0xd8(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x18ed91(%rip), %xmm1   # 0x1d2248
addsd %xmm1, %xmm0
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0xc0(%rsp), %xmm0
callq 0x8630
movsd %xmm0, 0x18(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0xc0(%rsp), %xmm0
mulsd 0x80(%rsp), %xmm0
callq 0x8310
movsd 0x18(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x20(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xb8(%rsp)
movl $0x1, 0x94(%rsp)
movsd 0x18f6f6(%rip), %xmm0   # 0x1d2c50
mulsd 0xb8(%rsp), %xmm0
mulsd 0x60(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x50(%rsp), %xmm2
movsd 0xc8(%rsp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0x18f6d1(%rip), %xmm0   # 0x1d2c88
mulsd 0x68(%rsp), %xmm0
mulsd 0x58(%rsp), %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0xa0(%rsp), %xmm0
movsd 0x191f43(%rip), %xmm1   # 0x1d5520
callq 0x8610
movsd %xmm0, 0x48(%rsp)
cvtsi2sdl 0x94(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x48(%rsp), %xmm0
movl $0x4, %edi
callq 0x5b970
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x436d0
movsd %xmm0, 0x98(%rsp)
cvtsi2sdl 0x90(%rsp), %xmm0
movsd 0x18f64f(%rip), %xmm1   # 0x1d2c80
mulsd %xmm1, %xmm0
movsd 0x191edb(%rip), %xmm1   # 0x1d5518
mulsd %xmm1, %xmm0
mulsd 0xa8(%rsp), %xmm0
mulsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xb0(%rsp), %xmm0
movaps 0x18ebca(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movsd 0x18ebde(%rip), %xmm1   # 0x1d2250
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
mulsd 0x98(%rsp), %xmm0
mulsd 0x50(%rsp), %xmm0
movq 0xf0(%rsp), %rax
movslq 0x8c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x43301
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax,%rax)