// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_selection_sampling
int transfer_selection_sampling(
                                struct precision * ppr,
                                struct background * pba,
                                struct perturbations * ppt,
                                struct transfer * ptr,
                                int bin,
                                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);

  class_test(tau_size <= 0,
             ptr->error_message,
             "should be at least one");

  /* case selection == dirac */
  if (tau_min == tau_max) {
    class_test(tau_size !=1,
               ptr->error_message,
               "for Dirac selection function tau_size should be 1, not %d",tau_size);
    tau0_minus_tau[0] = pba->conformal_age - tau_mean;
  }
  /* for other cases (gaussian, tophat...) define new sampled values
     of (tau0-tau) with even spacing */
  else {
    for (index_tau=0; index_tau<tau_size-1; index_tau++) {
      tau0_minus_tau[index_tau]=pba->conformal_age-tau_min-((double)index_tau)/((double)tau_size-1.)*(tau_max-tau_min);
    }
    tau0_minus_tau[tau_size-1]=pba->conformal_age-tau_max;
  }

  return _SUCCESS_;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1020, %rsp           # imm = 0x1020
movq %r9, %r14
movq %rcx, %rbx
movq %rsi, %r15
leaq 0x8(%rsp), %rax
leaq 0x10(%rsp), %rcx
leaq 0x18(%rsp), %r9
pushq %rax
pushq %rcx
callq 0xaa83f
addq $0x10, %rsp
testl %eax, %eax
je 0xacd71
addq $0x96a, %rbx            # imm = 0x96A
leaq 0x416b6(%rip), %rsi     # 0xee3f0
leaq 0x724df(%rip), %rdx     # 0x11f220
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x412da(%rip), %rsi     # 0xee034
leaq 0x72bdb(%rip), %rdx     # 0x11f93c
movq %rbx, %rdi
movl $0xb28, %ecx            # imm = 0xB28
movq %r14, %r8
jmp 0xace73
movl 0x1040(%rsp), %edx
testl %edx, %edx
jle 0xacdb4
movsd 0x18(%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jne 0xace0c
jp 0xace0c
cmpl $0x1, %edx
jne 0xace1a
movsd 0x310(%r15), %xmm0
subsd 0x10(%rsp), %xmm0
movsd %xmm0, (%r14)
xorl %eax, %eax
jmp 0xace7f
leaq 0x72b9d(%rip), %rsi     # 0x11f958
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x412b1(%rip), %rsi     # 0xee082
leaq 0x72b97(%rip), %rdx     # 0x11f96f
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x96a, %rbx            # imm = 0x96A
leaq 0x41239(%rip), %rsi     # 0xee034
leaq 0x72b3a(%rip), %rdx     # 0x11f93c
movq %rbx, %rdi
movl $0xb2c, %ecx            # imm = 0xB2C
jmp 0xace70
xorl %eax, %eax
cmpl $0x1, %edx
jne 0xace8c
xorl %edx, %edx
jmp 0xaced2
leaq 0x72b5c(%rip), %rsi     # 0x11f97d
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x4124b(%rip), %rsi     # 0xee082
leaq 0x72b79(%rip), %rdx     # 0x11f9b7
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x96a, %rbx            # imm = 0x96A
leaq 0x411d3(%rip), %rsi     # 0xee034
leaq 0x72ad4(%rip), %rdx     # 0x11f93c
movq %rbx, %rdi
movl $0xb32, %ecx            # imm = 0xB32
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1020, %rsp           # imm = 0x1020
popq %rbx
popq %r14
popq %r15
retq
cvtsi2sd %edx, %xmm2
addsd 0x41950(%rip), %xmm2    # 0xee7e8
decl %edx
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
xorl %ecx, %ecx
movsd 0x310(%r15), %xmm4
subsd %xmm1, %xmm4
xorps %xmm5, %xmm5
cvtsi2sd %ecx, %xmm5
divsd %xmm2, %xmm5
mulsd %xmm3, %xmm5
subsd %xmm5, %xmm4
movsd %xmm4, (%r14,%rcx,8)
incq %rcx
cmpq %rcx, %rdx
jne 0xacea4
movsd 0x310(%r15), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%r14,%rdx,8)
jmp 0xace7f