// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/hyperspherical.c
// Function: hyperspherical_forwards_recurrence_chunk
int hyperspherical_forwards_recurrence_chunk(int K,
                                             int lmax,
                                             double beta,
                                             double * __restrict__ x,
                                             double * __restrict__ sinK,
                                             double * __restrict__ cotK,
                                             int chunk,
                                             double * __restrict__ sqrtK,
                                             double * __restrict__ one_over_sqrtK,
                                             double * __restrict__ PhiL){
  int l;
  int index_x;
  for (index_x=0; index_x<chunk; index_x++){
    PhiL[index_x] = 1.0/beta*sin(beta*x[index_x])/sinK[index_x];
    PhiL[chunk+index_x] = PhiL[index_x]*
      (cotK[index_x]-beta/tan(beta*x[index_x]))*one_over_sqrtK[1];
  }
  for (l=2; l<=lmax; l++){
    for (index_x=0; index_x<chunk; index_x++)
      PhiL[l*chunk+index_x] =
        ((2*l-1)*cotK[index_x]*PhiL[(l-1)*chunk+index_x]-
         PhiL[(l-2)*chunk+index_x]*sqrtK[l-1])*one_over_sqrtK[l];
  }
  return _SUCCESS_;
}

// Assembly:
subq $0x58, %rsp
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rax
movl %edi, 0x54(%rsp)
movl %esi, 0x50(%rsp)
movsd %xmm0, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x30(%rsp)
movl %r9d, 0x2c(%rsp)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x41dc2
movsd 0x190575(%rip), %xmm0   # 0x1d2248
divsd 0x48(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rax
movslq 0x24(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
callq 0x80a0
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x38(%rsp), %rax
movslq 0x24(%rsp), %rcx
divsd (%rax,%rcx,8), %xmm0
movq 0x70(%rsp), %rax
movslq 0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x70(%rsp), %rax
movslq 0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x48(%rsp), %xmm0
movq 0x40(%rsp), %rax
movslq 0x24(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
callq 0x8220
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
movaps %xmm0, %xmm3
movsd 0x18(%rsp), %xmm0
divsd %xmm3, %xmm2
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movq 0x68(%rsp), %rax
mulsd 0x8(%rax), %xmm0
movq 0x70(%rsp), %rax
movl 0x2c(%rsp), %ecx
addl 0x24(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x41cbd
movl $0x2, 0x28(%rsp)
movl 0x28(%rsp), %eax
cmpl 0x50(%rsp), %eax
jg 0x41ec2
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jge 0x41eb0
movl 0x28(%rsp), %eax
shll %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
movq 0x30(%rsp), %rax
movslq 0x24(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq 0x70(%rsp), %rax
movl 0x28(%rsp), %ecx
subl $0x1, %ecx
imull 0x2c(%rsp), %ecx
addl 0x24(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movq 0x70(%rsp), %rax
movl 0x28(%rsp), %ecx
subl $0x2, %ecx
imull 0x2c(%rsp), %ecx
addl 0x24(%rsp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x60(%rsp), %rax
movl 0x28(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x68(%rsp), %rax
movslq 0x28(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq 0x70(%rsp), %rax
movl 0x28(%rsp), %ecx
imull 0x2c(%rsp), %ecx
addl 0x24(%rsp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x41de0
jmp 0x41eb2
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x41dca
xorl %eax, %eax
addq $0x58, %rsp
retq
nopl (%rax)