// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/lensing.c
// Function: lensing_d40
int lensing_d40(
                double * mu,
                int num_mu,
                int lmax,
                double ** d40
                ) {
  double ll;
  int index_mu, l;
  double *fac1, *fac3, *fac4;
  ErrorMsg erreur;
  class_alloc(fac1,lmax*sizeof(double),erreur);
  class_alloc(fac3,lmax*sizeof(double),erreur);
  class_alloc(fac4,lmax*sizeof(double),erreur);
  for (l=4;l<lmax;l++) {
    ll = (double) l;
    fac1[l] = sqrt((2*ll+3)*(2*ll+1)/((ll-3)*(ll+5)));
    fac3[l] = sqrt((2*ll+3)*(ll-4)*(ll+4)/((2*ll-1)*(ll-3)*(ll+5)));
    fac4[l] = sqrt(2./(2*ll+3));
  }

  class_setup_parallel();
  for (index_mu=0;index_mu<num_mu;index_mu++) {
    class_run_parallel(=,
      int l;
      double declare_list_of_variables_inside_parallel_region(dlm1, dl, dlp1);
      d40[index_mu][0]=0;
      d40[index_mu][1]=0;
      d40[index_mu][2]=0;
      dlm1=0.; /*l=3*/
      d40[index_mu][3]=0;
      dl=sqrt(315.)*(1+mu[index_mu])*(1+mu[index_mu])*(1-mu[index_mu])*(1-mu[index_mu])/16.; /*l=4*/
      d40[index_mu][4] = dl * sqrt(2./9.);
      for (l=4;l<lmax;l++){
        /* sqrt((2l+1)/2)*d22 recurrence, supposed to be more stable */
        dlp1 = fac1[l]*mu[index_mu]*dl - fac3[l]*dlm1;
        d40[index_mu][l+1] = dlp1 * fac4[l];
        dlm1 = dl;
        dl = dlp1;
      }
      return _SUCCESS_;
    );
  }
  class_finish_parallel();
  free(fac1); free(fac3); free(fac4);
  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rcx, 0x98(%rsp)
movl %esi, 0x24(%rsp)
movq %rdi, 0x90(%rsp)
movl %edx, 0xc(%rsp)
movslq %edx, %r12
shlq $0x3, %r12
movq %r12, %rdi
callq 0x8460
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0xbdf8f
movq %r12, %rdi
callq 0x8460
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0xbdfcf
movq %r12, %rdi
callq 0x8460
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0xbe00f
cmpl $0x5, 0xc(%rsp)
jl 0xbdcb4
movl 0xc(%rsp), %ebx
movl $0x4, %r14d
xorpd %xmm2, %xmm2
xorps %xmm4, %xmm4
cvtsi2sd %r14d, %xmm4
addsd %xmm4, %xmm4
movapd %xmm4, %xmm3
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
addpd 0x64ba6(%rip), %xmm3    # 0x122720
movapd %xmm3, %xmm0
unpckhpd %xmm3, %xmm0            # xmm0 = xmm0[1],xmm3[1]
mulsd %xmm3, %xmm0
movd %r14d, %xmm1
pshufd $0x50, %xmm1, %xmm5     # xmm5 = xmm1[0,0,1,1]
addsd 0x30c50(%rip), %xmm4    # 0xee7e8
movdqa %xmm5, %xmm1
paddd 0x64bac(%rip), %xmm1    # 0x122750
cvtdq2pd %xmm1, %xmm6
paddd 0x64bb0(%rip), %xmm5    # 0x122760
punpckldq 0x335b8(%rip), %xmm5 # xmm5 = xmm5[0],mem[0],xmm5[1],mem[1]
movdqa 0x33d40(%rip), %xmm1    # 0xf1900
por %xmm1, %xmm5
subpd %xmm1, %xmm5
movapd %xmm6, %xmm1
mulpd %xmm5, %xmm1
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
divsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
movapd %xmm3, 0x70(%rsp)
jb 0xbdbea
sqrtsd %xmm0, %xmm0
jmp 0xbdc2f
movapd %xmm4, 0xc0(%rsp)
movapd %xmm5, 0xb0(%rsp)
movapd %xmm6, 0xa0(%rsp)
callq 0x82b0
movapd 0xa0(%rsp), %xmm6
movapd 0xb0(%rsp), %xmm5
movapd 0xc0(%rsp), %xmm4
movapd 0x70(%rsp), %xmm3
xorpd %xmm2, %xmm2
movq 0x38(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
movapd %xmm3, %xmm0
unpcklpd %xmm4, %xmm0            # xmm0 = xmm0[0],xmm4[0]
mulpd %xmm6, %xmm0
mulpd %xmm5, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
divsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xbdc62
sqrtsd %xmm0, %xmm0
jmp 0xbdc71
callq 0x82b0
movapd 0x70(%rsp), %xmm3
xorpd %xmm2, %xmm2
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
movsd 0x3107c(%rip), %xmm0    # 0xeed00
divsd %xmm3, %xmm0
ucomisd %xmm2, %xmm0
jb 0xbdc94
sqrtsd %xmm0, %xmm0
jmp 0xbdc9d
callq 0x82b0
xorpd %xmm2, %xmm2
movq 0x28(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0xbdb5e
callq 0x1c686
leaq 0xd0(%rsp), %rdi
movl %eax, %esi
callq 0x1c736
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
cmpl $0x0, 0x24(%rsp)
jle 0xbdf53
xorl %ebx, %ebx
movabsq $0x100000001, %r15      # imm = 0x100000001
leaq 0x89547(%rip), %rax     # 0x147240
addq $0x10, %rax
movq %rax, 0x70(%rsp)
movl $0x20, %edi
callq 0x83b0
movq %rax, %r14
movq %r15, 0x8(%rax)
movq 0x70(%rsp), %rax
movq %rax, (%r14)
movl $0x70, %edi
callq 0x83b0
movq %rax, %rbp
movq %r15, 0x8(%rax)
leaq 0x8ac9d(%rip), %rax     # 0x1489d0
movq %rax, (%rbp)
movq %rbp, %r15
addq $0x10, %r15
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1d4aa
movq %r14, %r12
addq $0x10, %r12
leaq 0x8acc7(%rip), %rax     # 0x148a20
movq %rax, 0x10(%rbp)
movq 0x98(%rsp), %rax
movq %rax, 0x38(%rbp)
movl %ebx, 0x40(%rbp)
movq 0x90(%rsp), %rax
movq %rax, 0x48(%rbp)
movl 0xc(%rsp), %eax
movl %eax, 0x50(%rbp)
movq 0x38(%rsp), %rax
movq %rax, 0x58(%rbp)
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rbp)
movq 0x28(%rsp), %rax
movq %rax, 0x68(%rbp)
movq %r15, 0x10(%r14)
movq %rbp, 0x18(%r14)
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
callq 0x1d3e8
movq %r12, 0x40(%rsp)
movq %r14, 0x48(%rsp)
movq 0x8b1ed(%rip), %rax     # 0x148fb0
cmpb $0x0, (%rax)
je 0xbddce
incl 0x8(%r14)
jmp 0xbddd3
lock
incl 0x8(%r14)
movl $0x1, %ebp
lock
xaddl %ebp, 0xf0(%rsp)
movl 0xd0(%rsp), %ecx
testl %ecx, %ecx
je 0xbde3c
xorl %r12d, %r12d
leal (%r12,%rbp), %eax
xorl %edx, %edx
divl %ecx
movq 0xf8(%rsp), %r15
imulq $0xb0, %rdx, %r13
leaq (%r15,%r13), %rdi
addq $0x58, %rdi
movq %rdi, 0x10(%rsp)
callq 0x8080
testl %eax, %eax
sete 0x18(%rsp)
je 0xbde86
leaq 0x10(%rsp), %rdi
callq 0x1d204
incl %r12d
movl 0xd0(%rsp), %ecx
cmpl %ecx, %r12d
jb 0xbddef
jmp 0xbde3e
xorl %ecx, %ecx
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movq 0xf8(%rsp), %r15
imulq $0xb0, %rdx, %r12
leaq (%r15,%r12), %rax
addq $0x58, %rax
movq %rax, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x1d294
addq %r12, %r15
movb $0x1, 0x18(%rsp)
movq %r15, %rdi
leaq 0x40(%rsp), %rsi
callq 0xc6292
jmp 0xbde96
addq %r13, %r15
movq %r15, %rdi
leaq 0x40(%rsp), %rsi
callq 0xc6292
leaq 0x10(%rsp), %rdi
callq 0x1d204
subq $-0x80, %r15
movq %r15, %rdi
callq 0x81c0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0xbdebb
callq 0x1d330
movabsq $0x100000001, %r15      # imm = 0x100000001
movq %r14, %rdi
callq 0x1d330
leaq 0x50(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x1dd2e
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0xbdef1
callq 0x1d330
incl %ebx
cmpl 0x24(%rsp), %ebx
jne 0xbdd02
movq 0x50(%rsp), %r12
movq 0x58(%rsp), %rbx
cmpq %rbx, %r12
je 0xbdf2f
movq %r12, %rdi
callq 0x1c7ba
testl %eax, %eax
jne 0xbe070
addq $0x10, %r12
cmpq %rbx, %r12
jne 0xbdf0c
movq 0x50(%rsp), %r12
movq 0x58(%rsp), %rbx
cmpq %r12, %rbx
je 0xbdf53
movq %r12, %r14
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0xbdf45
callq 0x1d330
addq $0x10, %r14
cmpq %rbx, %r14
jne 0xbdf37
movq %r12, 0x58(%rsp)
movq 0x38(%rsp), %rdi
callq 0x8410
movq 0x30(%rsp), %rdi
callq 0x8410
movq 0x28(%rsp), %rdi
callq 0x8410
xorl %ebx, %ebx
leaq 0x50(%rsp), %rdi
callq 0x1c806
leaq 0xd0(%rsp), %rdi
callq 0x1c84c
jmp 0xbe05c
leaq 0x3006e(%rip), %rsi     # 0xee004
leaq 0x67ae7(%rip), %rdx     # 0x125a84
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0x3007b(%rip), %rsi     # 0xee034
leaq 0x67b48(%rip), %rdx     # 0x125b08
leaq 0x8d0(%rsp), %rdi
movl $0x710, %ecx            # imm = 0x710
jmp 0xbe04d
leaq 0x3002e(%rip), %rsi     # 0xee004
leaq 0x67abd(%rip), %rdx     # 0x125a9a
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0x3003b(%rip), %rsi     # 0xee034
leaq 0x67b08(%rip), %rdx     # 0x125b08
leaq 0x8d0(%rsp), %rdi
movl $0x711, %ecx            # imm = 0x711
jmp 0xbe04d
leaq 0x2ffee(%rip), %rsi     # 0xee004
leaq 0x67a8e(%rip), %rdx     # 0x125aab
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0x2fffb(%rip), %rsi     # 0xee034
leaq 0x67ac8(%rip), %rdx     # 0x125b08
leaq 0x8d0(%rsp), %rdi
movl $0x712, %ecx            # imm = 0x712
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebx
movl %ebx, %eax
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %ebx
jmp 0xbdf73
jmp 0xbe083
jmp 0xbe0c5
movq %rax, %rbx
jmp 0xbe090
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1d204
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0xbe09f
callq 0x1d330
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0xbe0e7
callq 0x1d330
jmp 0xbe0e7
movq %rax, %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
jne 0xbe0ea
jmp 0xbe0ef
movq %rax, %rbx
jmp 0xbe0ef
movq %rax, %rbx
jmp 0xbe0da
movq %rax, %rbx
movq %rbp, %rdi
callq 0x8380
movq %r14, %rdi
callq 0x8380
jmp 0xbe0ef
movq %rax, %rbx
movq %r14, %rdi
callq 0x1d330
leaq 0x50(%rsp), %rdi
callq 0x1c806
leaq 0xd0(%rsp), %rdi
callq 0x1c84c
movq %rbx, %rdi
callq 0x8650