// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x2868, %rsp           # imm = 0x2868
movl 0x2870(%rsp), %eax
movq %rdi, 0x2858(%rsp)
movq %rsi, 0x2850(%rsp)
movq %rdx, 0x2848(%rsp)
movq %rcx, 0x2840(%rsp)
movl %r8d, 0x283c(%rsp)
movq %r9, 0x2830(%rsp)
movq 0x2858(%rsp), %rdi
movq 0x2850(%rsp), %rsi
movq 0x2848(%rsp), %rdx
movq 0x2840(%rsp), %rcx
movl 0x283c(%rsp), %r8d
leaq 0x2820(%rsp), %r9
leaq 0x2818(%rsp), %r10
leaq 0x2810(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x13c9b0
cmpl $0x1, %eax
jne 0x14147e
leaq 0x2010(%rsp), %rdi
movq 0x2840(%rsp), %rcx
addq $0x96a, %rcx            # imm = 0x96A
leaq 0x90fa9(%rip), %rsi     # 0x1d23d8
leaq 0xc219a(%rip), %rdx     # 0x2035d0
movb $0x0, %al
callq 0x5b9c0
movq 0x2840(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x2010(%rsp), %r8
leaq 0x90bd9(%rip), %rsi     # 0x1d2034
leaq 0xc2a44(%rip), %rdx     # 0x203ea6
movl $0xb28, %ecx            # imm = 0xB28
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2864(%rsp)
jmp 0x1416cc
cmpl $0x0, 0x2870(%rsp)
jg 0x141504
leaq 0x1810(%rsp), %rdi
leaq 0xc2a2b(%rip), %rsi     # 0x203ec2
movb $0x0, %al
callq 0x5b9c0
leaq 0x1010(%rsp), %rdi
leaq 0x1810(%rsp), %rcx
leaq 0x90bcd(%rip), %rsi     # 0x1d2082
leaq 0xc2a1d(%rip), %rdx     # 0x203ed9
movb $0x0, %al
callq 0x5b9c0
movq 0x2840(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x1010(%rsp), %r8
leaq 0x90b53(%rip), %rsi     # 0x1d2034
leaq 0xc29be(%rip), %rdx     # 0x203ea6
movl $0xb2c, %ecx            # imm = 0xB2C
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2864(%rsp)
jmp 0x1416cc
movsd 0x2820(%rsp), %xmm0
ucomisd 0x2810(%rsp), %xmm0
jne 0x1415d3
jp 0x1415d3
cmpl $0x1, 0x2870(%rsp)
je 0x1415a9
leaq 0x810(%rsp), %rdi
movl 0x2870(%rsp), %edx
leaq 0xc29a5(%rip), %rsi     # 0x203ee7
movb $0x0, %al
callq 0x5b9c0
leaq 0x10(%rsp), %rdi
leaq 0x810(%rsp), %rcx
leaq 0x90b25(%rip), %rsi     # 0x1d2082
leaq 0xc29bd(%rip), %rdx     # 0x203f21
movb $0x0, %al
callq 0x5b9c0
movq 0x2840(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x10(%rsp), %r8
leaq 0x90aae(%rip), %rsi     # 0x1d2034
leaq 0xc2919(%rip), %rdx     # 0x203ea6
movl $0xb32, %ecx            # imm = 0xB32
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2864(%rsp)
jmp 0x1416cc
movq 0x2850(%rsp), %rax
movsd 0x310(%rax), %xmm0
subsd 0x2818(%rsp), %xmm0
movq 0x2830(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x1416c1
movl $0x0, 0x282c(%rsp)
movl 0x282c(%rsp), %eax
movl 0x2870(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x14168e
movq 0x2850(%rsp), %rax
movsd 0x310(%rax), %xmm1
subsd 0x2820(%rsp), %xmm1
cvtsi2sdl 0x282c(%rsp), %xmm0
cvtsi2sdl 0x2870(%rsp), %xmm2
movsd 0x90c1e(%rip), %xmm3    # 0x1d2248
subsd %xmm3, %xmm2
divsd %xmm2, %xmm0
movsd 0x2810(%rsp), %xmm2
subsd 0x2820(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x2830(%rsp), %rax
movslq 0x282c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x282c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x282c(%rsp)
jmp 0x1415de
movq 0x2850(%rsp), %rax
movsd 0x310(%rax), %xmm0
subsd 0x2810(%rsp), %xmm0
movq 0x2830(%rsp), %rax
movl 0x2870(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, 0x2864(%rsp)
movl 0x2864(%rsp), %eax
addq $0x2868, %rsp           # imm = 0x2868
retq
nopl (%rax,%rax)