// File: /workspace/github_c_makefile_star2_O2/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 $0x10f8, %rsp           # imm = 0x10F8
movq %rcx, 0xc8(%rsp)
movl %esi, %ebp
movq %rdi, 0xc0(%rsp)
movl %edx, 0x4c(%rsp)
movslq %edx, %rbx
leaq (,%rbx,8), %r12
movq %r12, %rdi
callq 0x8490
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0xb816f
movq %r12, %rdi
callq 0x8490
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0xb8474
movq %r12, %rdi
callq 0x8490
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0xb84b4
pushq $0x4
popq %r14
xorpd %xmm2, %xmm2
cmpq %rbx, %r14
jge 0xb81b2
cvtsi2sd %r14d, %xmm4
addsd %xmm4, %xmm4
movapd %xmm4, %xmm3
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
addpd 0x61577(%rip), %xmm3    # 0x1195b0
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 0x2d791(%rip), %xmm4    # 0xe57e8
movdqa %xmm5, %xmm1
paddd 0x6158d(%rip), %xmm1    # 0x1195f0
cvtdq2pd %xmm1, %xmm6
paddd 0x61591(%rip), %xmm5    # 0x119600
punpckldq 0x300b9(%rip), %xmm5 # xmm5 = xmm5[0],mem[0],xmm5[1],mem[1]
movdqa 0x61561(%rip), %xmm1    # 0x1195e0
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, 0x60(%rsp)
jb 0xb80a9
sqrtsd %xmm0, %xmm0
jmp 0xb80ee
movapd %xmm4, 0xb0(%rsp)
movapd %xmm5, 0xe0(%rsp)
movapd %xmm6, 0xd0(%rsp)
callq 0x82d0
movapd 0xd0(%rsp), %xmm6
movapd 0xe0(%rsp), %xmm5
movapd 0xb0(%rsp), %xmm4
movapd 0x60(%rsp), %xmm3
xorpd %xmm2, %xmm2
movq 0x40(%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 0xb8121
sqrtsd %xmm0, %xmm0
jmp 0xb8130
callq 0x82d0
movapd 0x60(%rsp), %xmm3
xorpd %xmm2, %xmm2
movq 0x38(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
movsd 0x2db9d(%rip), %xmm0    # 0xe5ce0
divsd %xmm3, %xmm0
ucomisd %xmm2, %xmm0
jb 0xb8153
sqrtsd %xmm0, %xmm0
jmp 0xb815c
callq 0x82d0
xorpd %xmm2, %xmm2
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
jmp 0xb8017
leaq 0x2ce8e(%rip), %rsi     # 0xe5004
leaq 0x647a7(%rip), %rdx     # 0x11c924
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2ce9b(%rip), %rsi     # 0xe5034
leaq 0x64808(%rip), %rdx     # 0x11c9a8
leaq 0x8f0(%rsp), %rdi
movl $0x710, %ecx            # imm = 0x710
jmp 0xb84f2
callq 0x1a2a0
leaq 0xf0(%rsp), %rdi
movl %eax, %esi
callq 0x1a33e
xorpd %xmm0, %xmm0
leaq 0x90(%rsp), %rax
andq $0x0, 0x10(%rax)
movapd %xmm0, (%rax)
xorl %ebx, %ebx
testl %ebp, %ebp
cmovlel %ebx, %ebp
movl %ebp, 0x60(%rsp)
leaq 0xd(%rsp), %r14
leaq 0x8902e(%rip), %rax     # 0x141220
addq $0x10, %rax
movq %rax, 0xb0(%rsp)
leaq 0x20(%rsp), %r12
cmpl 0x60(%rsp), %ebx
je 0xb8443
andq $0x0, 0x50(%rsp)
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x1b0f6
movq %rax, %r13
movq %r14, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x8(%rax)
movq 0xb0(%rsp), %rax
movq %rax, (%r13)
pushq $0x70
popq %rdi
callq 0x83d0
movq %rax, %rbp
leaq 0xf(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %rbp, 0x28(%rsp)
movq %r14, 0x8(%rbp)
leaq 0x8a750(%rip), %rax     # 0x1429c0
movq %rax, (%rbp)
movq %rbp, %r14
addq $0x10, %r14
movq %r14, %rdi
leaq 0xe(%rsp), %rsi
callq 0x1b18a
movq %r13, %r15
addq $0x10, %r15
leaq 0x8a77a(%rip), %rax     # 0x142a10
movq %rax, 0x10(%rbp)
movq 0xc8(%rsp), %rax
movq %rax, 0x38(%rbp)
movl %ebx, 0x40(%rbp)
movq 0xc0(%rsp), %rax
movq %rax, 0x48(%rbp)
movl 0x4c(%rsp), %eax
movl %eax, 0x50(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0x58(%rbp)
movq 0x38(%rsp), %rax
movq %rax, 0x60(%rbp)
movq 0x30(%rsp), %rax
movq %rax, 0x68(%rbp)
andq $0x0, 0x28(%rsp)
movq %r12, %rdi
callq 0xbed08
movq %r14, 0x10(%r13)
andq $0x0, 0x18(%rsp)
movq %rbp, 0x18(%r13)
andq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x1afb0
andq $0x0, 0x88(%rsp)
movq %r13, 0x58(%rsp)
movq %r15, 0x50(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x1b0e8
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0x1b09c
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x1b986
pushq $0x1
popq %rax
movl %eax, %r13d
lock
xaddl %r13d, 0x110(%rsp)
xorl %r14d, %r14d
movl 0xf0(%rsp), %ecx
cmpl %ecx, %r14d
jae 0xb839c
leal (%r14,%r13), %eax
xorl %edx, %edx
divl %ecx
movq 0x118(%rsp), %rbp
imulq $0xb0, %rdx, %r15
leaq (%r15,%rbp), %rdi
addq $0x58, %rdi
movq %rdi, 0x20(%rsp)
callq 0x1add8
movb %al, 0x28(%rsp)
testb %al, %al
jne 0xb83e3
movq %r12, %rdi
callq 0x1adc2
incl %r14d
jmp 0xb8352
movl %r13d, %eax
xorl %edx, %edx
divl %ecx
movq 0x118(%rsp), %r15
imulq $0xb0, %rdx, %r14
leaq (%r15,%r14), %rsi
addq $0x58, %rsi
movq %r12, %rdi
callq 0x1ae48
addq %r14, %r15
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0xbf110
movq %r12, %rdi
callq 0x1adc2
subq $-0x80, %r15
movq %r15, %rdi
jmp 0xb8402
addq %r15, %rbp
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
callq 0xbf110
movq %r12, %rdi
callq 0x1adc2
subq $-0x80, %rbp
movq %rbp, %rdi
callq 0x81e0
leaq 0x18(%rsp), %rdi
callq 0x1afb0
leaq 0x58(%rsp), %rdi
callq 0x1afb0
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x1bb4a
leaq 0x78(%rsp), %rdi
callq 0x1afb0
incl %ebx
leaq 0xd(%rsp), %r14
jmp 0xb8203
movq 0x90(%rsp), %r14
movq 0x98(%rsp), %rbx
cmpq %rbx, %r14
je 0xb8501
movq %r14, %rdi
callq 0x1a3be
addq $0x10, %r14
testl %eax, %eax
je 0xb8453
pushq $0x1
popq %rbx
jmp 0xb852e
leaq 0x2cb89(%rip), %rsi     # 0xe5004
leaq 0x644b8(%rip), %rdx     # 0x11c93a
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2cb96(%rip), %rsi     # 0xe5034
leaq 0x64503(%rip), %rdx     # 0x11c9a8
leaq 0x8f0(%rsp), %rdi
movl $0x711, %ecx            # imm = 0x711
jmp 0xb84f2
leaq 0x2cb49(%rip), %rsi     # 0xe5004
leaq 0x64489(%rip), %rdx     # 0x11c94b
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x2cb56(%rip), %rsi     # 0xe5034
leaq 0x644c3(%rip), %rdx     # 0x11c9a8
leaq 0x8f0(%rsp), %rdi
movl $0x712, %ecx            # imm = 0x712
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbx
jmp 0xb8548
leaq 0x90(%rsp), %rdi
callq 0x1a3f0
movq 0x40(%rsp), %rdi
callq 0x8430
movq 0x38(%rsp), %rdi
callq 0x8430
movq 0x30(%rsp), %rdi
callq 0x8430
xorl %ebx, %ebx
leaq 0x90(%rsp), %rdi
callq 0x1a3f8
leaq 0xf0(%rsp), %rdi
callq 0x1a41a
movl %ebx, %eax
addq $0x10f8, %rsp           # imm = 0x10F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb8560
jmp 0xb85a1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1adc2
jmp 0xb8572
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x1afb0
leaq 0x78(%rsp), %rdi
callq 0x1afb0
jmp 0xb858b
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0xb859a
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x1afb0
jmp 0xb85c5
movq %rax, %rbx
jmp 0xb85c5
movq %rax, %rbx
jmp 0xb85b8
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xbed08
leaq 0x80(%rsp), %rdi
callq 0x1b0e8
leaq 0x90(%rsp), %rdi
callq 0x1a3f8
leaq 0xf0(%rsp), %rdi
callq 0x1a41a
movq %rbx, %rdi
callq 0x8680