// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/lensing.c
// Function: lensing_d4m2
int lensing_d4m2(
                 double * mu,
                 int num_mu,
                 int lmax,
                 double ** d4m2
                 ) {
  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=4;l<lmax;l++) {
    ll = (double) l;
    fac1[l] = sqrt((2*ll+3)*(2*ll+1)/((ll-3)*(ll+5)*(ll-1)*(ll+3))) * (ll+1.);
    fac2[l] = 8./(ll*(ll+1));
    fac3[l] = sqrt((2*ll+3)*(ll-4)*(ll+4)*(ll-2)*(ll+2)/((2*ll-1)*(ll-3)*(ll+5)*(ll-1)*(ll+3)))*(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);
      d4m2[index_mu][0]=0;
      d4m2[index_mu][1]=0;
      d4m2[index_mu][2]=0;
      dlm1=0.; /*l=3*/
      d4m2[index_mu][3]=0;
      dl=sqrt(126.)*(1+mu[index_mu])*(1-mu[index_mu])*(1-mu[index_mu])*(1-mu[index_mu])/16.; /*l=4*/
      d4m2[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]+fac2[l])*dl - fac3[l]*dlm1;
        d4m2[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 $0x1128, %rsp           # imm = 0x1128
movq %rcx, 0xd8(%rsp)
movl %esi, %ebp
movq %rdi, 0xd0(%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 0xb65b7
movq %r13, %rdi
callq 0x8490
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0xb65fa
movq %r13, %rdi
callq 0x8490
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0xb690f
movq %r13, %rdi
callq 0x8490
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0xb694f
xorl %r14d, %r14d
xorpd %xmm5, %xmm5
leaq 0x4(%r14), %rax
cmpq %rbx, %rax
jge 0xb663d
leal 0x4(%r14), %eax
cvtsi2sd %eax, %xmm6
movapd %xmm6, %xmm8
addsd %xmm6, %xmm8
movapd %xmm8, %xmm7
unpcklpd %xmm8, %xmm7            # xmm7 = xmm7[0],xmm8[0]
addpd 0x63207(%rip), %xmm7    # 0x1195b0
movapd %xmm7, %xmm0
unpckhpd %xmm7, %xmm0            # xmm0 = xmm0[1],xmm7[1]
mulsd %xmm7, %xmm0
movd %eax, %xmm1
pshufd $0x50, %xmm1, %xmm9     # xmm9 = xmm1[0,0,1,1]
movdqa %xmm9, %xmm1
paddd 0x63224(%rip), %xmm1    # 0x1195f0
cvtdq2pd %xmm1, %xmm11
movdqa %xmm9, %xmm10
paddd 0x63221(%rip), %xmm10   # 0x119600
pxor %xmm3, %xmm3
punpckldq %xmm3, %xmm10   # xmm10 = xmm10[0],xmm3[0],xmm10[1],xmm3[1]
movdqa 0x631f0(%rip), %xmm4    # 0x1195e0
por %xmm4, %xmm10
subpd %xmm4, %xmm10
movapd %xmm11, %xmm1
movdqa %xmm9, %xmm2
paddd 0x631b4(%rip), %xmm2    # 0x1195c0
cvtdq2pd %xmm2, %xmm12
mulpd %xmm10, %xmm1
mulpd %xmm12, %xmm1
paddd 0x631ac(%rip), %xmm9    # 0x1195d0
punpckldq %xmm3, %xmm9    # xmm9 = xmm9[0],xmm3[0],xmm9[1],xmm3[1]
por %xmm4, %xmm9
subpd %xmm4, %xmm9
mulpd %xmm9, %xmm1
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
divsd %xmm1, %xmm0
addsd 0x2f39f(%rip), %xmm8    # 0xe57e8
ucomisd %xmm5, %xmm0
movsd %xmm6, 0x10(%rsp)
movapd %xmm7, 0x70(%rsp)
jb 0xb6461
sqrtsd %xmm0, %xmm0
jmp 0xb64da
movapd %xmm8, 0xc0(%rsp)
movapd %xmm9, 0x110(%rsp)
movapd %xmm10, 0x100(%rsp)
movapd %xmm11, 0xf0(%rsp)
movapd %xmm12, 0xe0(%rsp)
callq 0x82d0
movapd 0xe0(%rsp), %xmm12
movapd 0xf0(%rsp), %xmm11
movapd 0x100(%rsp), %xmm10
movapd 0x110(%rsp), %xmm9
movapd 0xc0(%rsp), %xmm8
movapd 0x70(%rsp), %xmm7
movsd 0x10(%rsp), %xmm6
xorpd %xmm5, %xmm5
leal 0x5(%r14), %eax
cvtsi2sd %eax, %xmm3
movapd %xmm6, %xmm1
mulsd %xmm3, %xmm1
movsd 0x31f3e(%rip), %xmm2    # 0xe8430
divsd %xmm1, %xmm2
mulsd %xmm3, %xmm0
movq 0x50(%rsp), %rax
movsd %xmm0, 0x20(%rax,%r14,8)
movq 0x48(%rsp), %rax
movsd %xmm2, 0x20(%rax,%r14,8)
movapd %xmm7, %xmm0
unpcklpd %xmm8, %xmm0            # xmm0 = xmm0[0],xmm8[0]
mulpd %xmm11, %xmm0
mulpd %xmm10, %xmm0
mulpd %xmm12, %xmm0
mulpd %xmm9, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
divsd %xmm1, %xmm0
ucomisd %xmm5, %xmm0
jb 0xb6547
sqrtsd %xmm0, %xmm0
jmp 0xb656e
movsd %xmm3, 0xc0(%rsp)
callq 0x82d0
movsd 0xc0(%rsp), %xmm3
movapd 0x70(%rsp), %xmm7
movsd 0x10(%rsp), %xmm6
xorpd %xmm5, %xmm5
mulsd %xmm3, %xmm0
divsd %xmm6, %xmm0
movq 0x40(%rsp), %rax
movsd %xmm0, 0x20(%rax,%r14,8)
movsd 0x2f756(%rip), %xmm0    # 0xe5ce0
divsd %xmm7, %xmm0
ucomisd %xmm5, %xmm0
jb 0xb659a
sqrtsd %xmm0, %xmm0
jmp 0xb65a3
callq 0x82d0
xorpd %xmm5, %xmm5
movq 0x38(%rsp), %rax
movsd %xmm0, 0x20(%rax,%r14,8)
incq %r14
jmp 0xb6378
leaq 0x2ea46(%rip), %rsi     # 0xe5004
leaq 0x6635f(%rip), %rdx     # 0x11c924
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2ea53(%rip), %rsi     # 0xe5034
leaq 0x663cc(%rip), %rdx     # 0x11c9b4
leaq 0x920(%rsp), %rdi
movl $0x74c, %ecx            # imm = 0x74C
jmp 0xb698d
leaq 0x2ea03(%rip), %rsi     # 0xe5004
leaq 0x6632d(%rip), %rdx     # 0x11c935
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2ea10(%rip), %rsi     # 0xe5034
leaq 0x66389(%rip), %rdx     # 0x11c9b4
leaq 0x920(%rsp), %rdi
movl $0x74d, %ecx            # imm = 0x74D
jmp 0xb698d
callq 0x1a2a0
leaq 0x120(%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 0x8ab99(%rip), %rax     # 0x141220
addq $0x10, %rax
movq %rax, 0x70(%rsp)
leaq 0x28(%rsp), %r13
cmpl 0x10(%rsp), %ebx
je 0xb68de
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 0x8c3aa(%rip), %rax     # 0x142aa0
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 0x8c3d4(%rip), %rax     # 0x142af0
movq %rax, 0x10(%r12)
movq 0xd8(%rsp), %rax
movq %rax, 0x38(%r12)
movl %ebx, 0x40(%r12)
movq 0xd0(%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 0xbf2be
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, 0x140(%rsp)
xorl %r14d, %r14d
movl 0x120(%rsp), %ecx
cmpl %ecx, %r14d
jae 0xb6837
leal (%r14,%rbp), %eax
xorl %edx, %edx
divl %ecx
movq 0x148(%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 0xb686e
movq %r13, %rdi
callq 0x1adc2
incl %r14d
jmp 0xb67ed
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
movq 0x148(%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 0xbf6ce
jmp 0xb687e
addq %r12, %r15
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
callq 0xbf6ce
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 0xb6695
movq 0xa0(%rsp), %r14
movq 0xa8(%rsp), %rbx
cmpq %rbx, %r14
je 0xb69ae
movq %r14, %rdi
callq 0x1a3be
addq $0x10, %r14
testl %eax, %eax
je 0xb68ee
pushq $0x1
popq %rbx
jmp 0xb69e5
leaq 0x2e6ee(%rip), %rsi     # 0xe5004
leaq 0x6601d(%rip), %rdx     # 0x11c93a
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2e6fb(%rip), %rsi     # 0xe5034
leaq 0x66074(%rip), %rdx     # 0x11c9b4
leaq 0x920(%rsp), %rdi
movl $0x74e, %ecx            # imm = 0x74E
jmp 0xb698d
leaq 0x2e6ae(%rip), %rsi     # 0xe5004
leaq 0x65fee(%rip), %rdx     # 0x11c94b
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2e6bb(%rip), %rsi     # 0xe5034
leaq 0x66034(%rip), %rdx     # 0x11c9b4
leaq 0x920(%rsp), %rdi
movl $0x74f, %ecx            # imm = 0x74F
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x1128, %rsp           # imm = 0x1128
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 0x120(%rsp), %rdi
callq 0x1a41a
jmp 0xb699a
jmp 0xb6a05
jmp 0xb6a4c
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1adc2
jmp 0xb6a17
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1afb0
leaq 0x88(%rsp), %rdi
callq 0x1afb0
jmp 0xb6a33
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0xb6a45
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x1afb0
jmp 0xb6a70
movq %rax, %rbx
jmp 0xb6a70
movq %rax, %rbx
jmp 0xb6a63
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbf2be
leaq 0x90(%rsp), %rdi
callq 0x1b0e8
leaq 0xa0(%rsp), %rdi
callq 0x1a3f8
leaq 0x120(%rsp), %rdi
callq 0x1a41a
movq %rbx, %rdi
callq 0x8680