// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_lensing_sampling
int transfer_lensing_sampling(
                              struct precision * ppr,
                              struct background * pba,
                              struct perturbations * ppt,
                              struct transfer * ptr,
                              int bin,
                              double tau0,
                              double * tau0_minus_tau,
                              int tau_size) {

  /* running index on time */
  int index_tau;

  /* minimum and maximal value of time in new sampled interval */
  double tau_min,tau_mean,tau_max;

  /* time interval for this bin */
  class_call(transfer_selection_times(ppr,
                                      pba,
                                      ppt,
                                      ptr,
                                      bin,
                                      &tau_min,
                                      &tau_mean,
                                      &tau_max),
             ptr->error_message,
             ptr->error_message);

  for (index_tau=0; index_tau<tau_size; index_tau++) {
    //tau0_minus_tau[index_tau]=pba->conformal_age-tau_min-((double)index_tau)/((double)tau_size-1.)*(tau0-tau_min);
    tau0_minus_tau[index_tau]=((double)(tau_size-1-index_tau))/((double)(tau_size-1))*(tau0-tau_min);
  }

  return _SUCCESS_;

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movq %r9, %rbx
movsd %xmm0, (%rsp)
movq %rcx, %r14
leaq 0x10(%rsp), %rax
leaq 0x18(%rsp), %rcx
leaq 0x8(%rsp), %r9
pushq %rax
pushq %rcx
callq 0xad8dd
addq $0x10, %rsp
testl %eax, %eax
je 0xb0124
addq $0x96a, %r14            # imm = 0x96A
leaq 0x4130f(%rip), %rsi     # 0xf13f0
leaq 0x720f8(%rip), %rdx     # 0x1221e0
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x40f33(%rip), %rsi     # 0xf1034
leaq 0x7287c(%rip), %rdx     # 0x122984
movq %r14, %rdi
movl $0xb6d, %ecx            # imm = 0xB6D
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
jmp 0xb020f
movsd (%rsp), %xmm9
movl 0x840(%rsp), %eax
testl %eax, %eax
jle 0xb020d
leal -0x1(%rax), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
subsd 0x8(%rsp), %xmm9
movl %eax, %edx
leal 0x1(%rax), %ecx
decq %rdx
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
shrl %ecx
shlq $0x4, %rcx
addl $-0x2, %eax
movdqa 0x41b13(%rip), %xmm2    # 0xf1c80
xorl %edx, %edx
movdqa 0x41b19(%rip), %xmm3    # 0xf1c90
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x425f9(%rip), %xmm5    # 0xf2780
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm1, %xmm7
pcmpeqd %xmm1, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0xb01d4
leal 0x1(%rax), %esi
xorps %xmm7, %xmm7
cvtsi2sd %esi, %xmm7
divsd %xmm0, %xmm7
mulsd %xmm9, %xmm7
movsd %xmm7, (%rbx,%rdx)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0xb01f9
xorps %xmm6, %xmm6
cvtsi2sd %eax, %xmm6
divsd %xmm0, %xmm6
mulsd %xmm9, %xmm6
movsd %xmm6, 0x8(%rbx,%rdx)
paddq %xmm5, %xmm2
addq $0x10, %rdx
addl $-0x2, %eax
cmpq %rdx, %rcx
jne 0xb0187
xorl %eax, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r14
retq