// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/lensing.c
// Function: lensing_d3m1
int lensing_d3m1(
                 double * mu,
                 int num_mu,
                 int lmax,
                 double ** d3m1
                 ) {
  double ll;
  int index_mu, l;
  double *fac1, *fac2, *fac3, *fac4;
  ErrorMsg erreur;
  class_alloc(fac1,lmax*sizeof(double),erreur);
  class_alloc(fac2,lmax*sizeof(double),erreur);
  class_alloc(fac3,lmax*sizeof(double),erreur);
  class_alloc(fac4,lmax*sizeof(double),erreur);
  for (l=3;l<lmax;l++) {
    ll = (double) l;
    fac1[l] = sqrt((2*ll+3)*(2*ll+1)/((ll-2)*(ll+4)*ll*(ll+2))) * (ll+1);
    fac2[l] = 3.0/(ll*(ll+1));
    fac3[l] = sqrt((2*ll+3)/(2*ll-1)*(ll-3)*(ll+3)*(ll-1)*(ll+1)/((ll-2)*(ll+4)*ll*(ll+2)))*(ll+1)/ll;
    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);
      d3m1[index_mu][0]=0;
      d3m1[index_mu][1]=0;
      dlm1=0.; /*l=2*/
      d3m1[index_mu][2]=0;
      dl=sqrt(105./2.)*(1+mu[index_mu])*(1-mu[index_mu])*(1-mu[index_mu])/8.; /*l=3*/
      d3m1[index_mu][3] = dl * sqrt(2./7.);
      for (l=3;l<lmax;l++){
        /* sqrt((2l+1)/2)*d22 recurrence, supposed to be more stable */
        dlp1 = fac1[l]*(mu[index_mu]+fac2[l])*dl - fac3[l]*dlm1;
        d3m1[index_mu][l+1] = dlp1 * fac4[l];
        dlm1 = dl;
        dl = dlp1;
      }
      return _SUCCESS_;
    );
  }
  class_finish_parallel();
  free(fac1); free(fac2); free(fac3); free(fac4);
  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10f8, %rsp           # imm = 0x10F8
movq %rcx, 0xe8(%rsp)
movl %esi, %ebp
movq %rdi, 0xe0(%rsp)
movl %edx, 0x5c(%rsp)
movslq %edx, %rbx
leaq (,%rbx,8), %r13
movq %r13, %rdi
callq 0x8490
movq %rax, 0x50(%rsp)
testq %rax, %rax
je 0xb5e0c
movq %r13, %rdi
callq 0x8490
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0xb5e4f
movq %r13, %rdi
callq 0x8490
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0xb6164
movq %r13, %rdi
callq 0x8490
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0xb61a4
xorl %r14d, %r14d
xorpd %xmm3, %xmm3
leaq 0x3(%r14), %rax
cmpq %rbx, %rax
jge 0xb5e92
leal 0x3(%r14), %eax
cvtsi2sd %eax, %xmm4
movapd %xmm4, %xmm6
addsd %xmm4, %xmm6
movapd %xmm6, %xmm5
unpcklpd %xmm6, %xmm5            # xmm5 = xmm5[0],xmm6[0]
addpd 0x63920(%rip), %xmm5    # 0x1195b0
movapd %xmm5, %xmm0
unpckhpd %xmm5, %xmm0            # xmm0 = xmm0[1],xmm5[1]
mulsd %xmm5, %xmm0
leal 0x1(%r14), %eax
cvtsi2sd %eax, %xmm1
leal 0x7(%r14), %eax
cvtsi2sd %rax, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm4, %xmm2
leal 0x5(%r14), %eax
cvtsi2sd %rax, %xmm7
mulsd %xmm2, %xmm7
divsd %xmm7, %xmm0
ucomisd %xmm3, %xmm0
movsd %xmm4, 0x10(%rsp)
movapd %xmm5, 0x70(%rsp)
jb 0xb5cde
sqrtsd %xmm0, %xmm0
jmp 0xb5d17
movapd %xmm6, 0xc0(%rsp)
movsd %xmm7, 0xd8(%rsp)
callq 0x82d0
movsd 0xd8(%rsp), %xmm7
movapd 0xc0(%rsp), %xmm6
movapd 0x70(%rsp), %xmm5
movsd 0x10(%rsp), %xmm4
xorpd %xmm3, %xmm3
leal 0x4(%r14), %eax
cvtsi2sd %eax, %xmm8
mulsd %xmm8, %xmm0
movq 0x50(%rsp), %rax
movsd %xmm0, 0x18(%rax,%r14,8)
movapd %xmm4, %xmm0
mulsd %xmm8, %xmm0
movsd 0x30a06(%rip), %xmm1    # 0xe6748
divsd %xmm0, %xmm1
movq 0x48(%rsp), %rax
movsd %xmm1, 0x18(%rax,%r14,8)
addsd 0x2fa8e(%rip), %xmm6    # 0xe57e8
movapd %xmm5, %xmm0
divsd %xmm6, %xmm0
cvtsi2sd %r14d, %xmm1
mulsd %xmm0, %xmm1
leal 0x6(%r14), %eax
cvtsi2sd %rax, %xmm2
mulsd %xmm1, %xmm2
leal 0x2(%r14), %eax
cvtsi2sd %eax, %xmm0
mulsd %xmm2, %xmm0
mulsd %xmm8, %xmm0
divsd %xmm7, %xmm0
ucomisd %xmm3, %xmm0
jb 0xb5d99
sqrtsd %xmm0, %xmm0
jmp 0xb5dc2
movsd %xmm8, 0xc0(%rsp)
callq 0x82d0
movsd 0xc0(%rsp), %xmm8
movapd 0x70(%rsp), %xmm5
movsd 0x10(%rsp), %xmm4
xorpd %xmm3, %xmm3
mulsd %xmm8, %xmm0
divsd %xmm4, %xmm0
movq 0x40(%rsp), %rax
movsd %xmm0, 0x18(%rax,%r14,8)
movsd 0x2ff01(%rip), %xmm0    # 0xe5ce0
divsd %xmm5, %xmm0
ucomisd %xmm3, %xmm0
jb 0xb5def
sqrtsd %xmm0, %xmm0
jmp 0xb5df8
callq 0x82d0
xorpd %xmm3, %xmm3
movq 0x38(%rsp), %rax
movsd %xmm0, 0x18(%rax,%r14,8)
incq %r14
jmp 0xb5c63
leaq 0x2f1f1(%rip), %rsi     # 0xe5004
leaq 0x66b0a(%rip), %rdx     # 0x11c924
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2f1fe(%rip), %rsi     # 0xe5034
leaq 0x66b51(%rip), %rdx     # 0x11c98e
leaq 0x8f0(%rsp), %rdi
movl $0x696, %ecx            # imm = 0x696
jmp 0xb61e2
leaq 0x2f1ae(%rip), %rsi     # 0xe5004
leaq 0x66ad8(%rip), %rdx     # 0x11c935
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2f1bb(%rip), %rsi     # 0xe5034
leaq 0x66b0e(%rip), %rdx     # 0x11c98e
leaq 0x8f0(%rsp), %rdi
movl $0x697, %ecx            # imm = 0x697
jmp 0xb61e2
callq 0x1a2a0
leaq 0xf0(%rsp), %rdi
movl %eax, %esi
callq 0x1a33e
xorpd %xmm0, %xmm0
leaq 0xa0(%rsp), %rax
andq $0x0, 0x10(%rax)
movapd %xmm0, (%rax)
xorl %ebx, %ebx
testl %ebp, %ebp
cmovlel %ebx, %ebp
movl %ebp, 0x10(%rsp)
leaq 0xd(%rsp), %r14
movabsq $0x100000001, %r15      # imm = 0x100000001
leaq 0x8b344(%rip), %rax     # 0x141220
addq $0x10, %rax
movq %rax, 0x70(%rsp)
leaq 0x28(%rsp), %r13
cmpl 0x10(%rsp), %ebx
je 0xb6133
andq $0x0, 0x60(%rsp)
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x1b0f6
movq %rax, %rbp
movq %r14, 0x90(%rsp)
movq %rax, 0x98(%rsp)
movq %r15, 0x8(%rax)
movq 0x70(%rsp), %rax
movq %rax, (%rbp)
pushq $0x78
popq %rdi
callq 0x83d0
movq %rax, %r12
leaq 0xf(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq %r15, 0x8(%r12)
leaq 0x8c8b5(%rip), %rax     # 0x142800
movq %rax, (%r12)
movq %r12, %r14
addq $0x10, %r14
movq %r14, %rdi
leaq 0xe(%rsp), %rsi
callq 0x1b18a
movq %rbp, %r15
addq $0x10, %r15
leaq 0x8c8df(%rip), %rax     # 0x142850
movq %rax, 0x10(%r12)
movq 0xe8(%rsp), %rax
movq %rax, 0x38(%r12)
movl %ebx, 0x40(%r12)
movq 0xe0(%rsp), %rax
movq %rax, 0x48(%r12)
movl 0x5c(%rsp), %eax
movl %eax, 0x50(%r12)
movq 0x50(%rsp), %rax
movq %rax, 0x58(%r12)
movq 0x48(%rsp), %rax
movq %rax, 0x60(%r12)
movq 0x40(%rsp), %rax
movq %rax, 0x68(%r12)
movq 0x38(%rsp), %rax
movq %rax, 0x70(%r12)
andq $0x0, 0x30(%rsp)
movq %r13, %rdi
callq 0xbe198
movq %r14, 0x10(%rbp)
andq $0x0, 0x20(%rsp)
movq %r12, 0x18(%rbp)
andq $0x0, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x1afb0
andq $0x0, 0x98(%rsp)
movq %rbp, 0x68(%rsp)
movq %r15, 0x60(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x1b0e8
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x1b09c
leaq 0x18(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x1b986
pushq $0x1
popq %rax
movl %eax, %ebp
lock
xaddl %ebp, 0x110(%rsp)
xorl %r14d, %r14d
movl 0xf0(%rsp), %ecx
cmpl %ecx, %r14d
jae 0xb608c
leal (%r14,%rbp), %eax
xorl %edx, %edx
divl %ecx
movq 0x118(%rsp), %r15
imulq $0xb0, %rdx, %r12
leaq (%r15,%r12), %rdi
addq $0x58, %rdi
movq %rdi, 0x28(%rsp)
callq 0x1add8
movb %al, 0x30(%rsp)
testb %al, %al
jne 0xb60c3
movq %r13, %rdi
callq 0x1adc2
incl %r14d
jmp 0xb6042
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movq 0x118(%rsp), %r15
imulq $0xb0, %rdx, %r14
leaq (%r15,%r14), %rsi
addq $0x58, %rsi
movq %r13, %rdi
callq 0x1ae48
addq %r14, %r15
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
callq 0xbe5a6
jmp 0xb60d3
addq %r12, %r15
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
callq 0xbe5a6
movq %r13, %rdi
callq 0x1adc2
subq $-0x80, %r15
movq %r15, %rdi
callq 0x81e0
leaq 0x20(%rsp), %rdi
callq 0x1afb0
leaq 0x68(%rsp), %rdi
callq 0x1afb0
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x1bb4a
leaq 0xd(%rsp), %r14
movabsq $0x100000001, %r15      # imm = 0x100000001
leaq 0x88(%rsp), %rdi
callq 0x1afb0
incl %ebx
jmp 0xb5eea
movq 0xa0(%rsp), %r14
movq 0xa8(%rsp), %rbx
cmpq %rbx, %r14
je 0xb6203
movq %r14, %rdi
callq 0x1a3be
addq $0x10, %r14
testl %eax, %eax
je 0xb6143
pushq $0x1
popq %rbx
jmp 0xb623a
leaq 0x2ee99(%rip), %rsi     # 0xe5004
leaq 0x667c8(%rip), %rdx     # 0x11c93a
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2eea6(%rip), %rsi     # 0xe5034
leaq 0x667f9(%rip), %rdx     # 0x11c98e
leaq 0x8f0(%rsp), %rdi
movl $0x698, %ecx            # imm = 0x698
jmp 0xb61e2
leaq 0x2ee59(%rip), %rsi     # 0xe5004
leaq 0x66799(%rip), %rdx     # 0x11c94b
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2ee66(%rip), %rsi     # 0xe5034
leaq 0x667b9(%rip), %rdx     # 0x11c98e
leaq 0x8f0(%rsp), %rdi
movl $0x699, %ecx            # imm = 0x699
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x10f8, %rsp           # imm = 0x10F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa0(%rsp), %rdi
callq 0x1a3f0
movq 0x50(%rsp), %rdi
callq 0x8430
movq 0x48(%rsp), %rdi
callq 0x8430
movq 0x40(%rsp), %rdi
callq 0x8430
movq 0x38(%rsp), %rdi
callq 0x8430
xorl %ebx, %ebx
leaq 0xa0(%rsp), %rdi
callq 0x1a3f8
leaq 0xf0(%rsp), %rdi
callq 0x1a41a
jmp 0xb61ef
jmp 0xb625a
jmp 0xb62a1
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1adc2
jmp 0xb626c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1afb0
leaq 0x88(%rsp), %rdi
callq 0x1afb0
jmp 0xb6288
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0xb629a
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x1afb0
jmp 0xb62c5
movq %rax, %rbx
jmp 0xb62c5
movq %rax, %rbx
jmp 0xb62b8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbe198
leaq 0x90(%rsp), %rdi
callq 0x1b0e8
leaq 0xa0(%rsp), %rdi
callq 0x1a3f8
leaq 0xf0(%rsp), %rdi
callq 0x1a41a
movq %rbx, %rdi
callq 0x8680