// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_selection_times
int transfer_selection_times(
                             struct precision * ppr,
                             struct background * pba,
                             struct perturbations * ppt,
                             struct transfer * ptr,
                             int bin,
                             double * tau_min,
                             double * tau_mean,
                             double * tau_max) {

  /* a value of redshift */
  double z=0.;

  /* lower edge of time interval for this bin */
  /* the few lines below should be consistent with their counterpart in input.c */
  if (ppt->selection==gaussian) {
    z = ppt->selection_mean[bin]+ppt->selection_width[bin]*ppr->selection_cut_at_sigma;
  }
  if (ppt->selection==tophat) {
    z = ppt->selection_mean[bin]+(1.+ppr->selection_cut_at_sigma*ppr->selection_tophat_edge)*ppt->selection_width[bin];
  }
  if (ppt->selection==dirac) {
    z = ppt->selection_mean[bin];
  }

  class_call(background_tau_of_z(pba,
                                 z,
                                 tau_min),
             pba->error_message,
             ppt->error_message);

  /* higher edge of time interval for this bin */

  if (ppt->selection==gaussian) {
    z = MAX(ppt->selection_mean[bin]-ppt->selection_width[bin]*ppr->selection_cut_at_sigma,0.);
  }
  if (ppt->selection==tophat) {
    z = MAX(ppt->selection_mean[bin]-(1.+ppr->selection_cut_at_sigma*ppr->selection_tophat_edge)*ppt->selection_width[bin],0.);
  }
  if (ppt->selection==dirac) {
    z = ppt->selection_mean[bin];
  }

  class_call(background_tau_of_z(pba,
                                 z,
                                 tau_max),
             pba->error_message,
             ppt->error_message);

  /* central value of time interval for this bin */

  z = MAX(ppt->selection_mean[bin],0.);

  class_call(background_tau_of_z(pba,
                                 z,
                                 tau_mean),
             pba->error_message,
             ppt->error_message);

  return _SUCCESS_;

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x68(%rdx), %eax
movslq %r8d, %r12
cmpl $0x2, %eax
je 0xa5441
cmpl $0x1, %eax
je 0xa5414
xorpd %xmm0, %xmm0
testl %eax, %eax
jne 0xa5448
movsd 0x390(%rbx,%r12,8), %xmm0
mulsd 0x808(%r15), %xmm0
jmp 0xa5438
movsd 0x808(%r15), %xmm0
mulsd 0x828(%r15), %xmm0
addsd 0x3fe32(%rip), %xmm0    # 0xe5260
mulsd 0x390(%rbx,%r12,8), %xmm0
addsd 0x70(%rbx,%r12,8), %xmm0
jmp 0xa5448
movsd 0x70(%rbx,%r12,8), %xmm0
movq %r14, %rdi
movsd %xmm0, 0x8(%rsp)
movq %r9, %rsi
callq 0x58adb
cmpl $0x1, %eax
jne 0xa54a7
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x3ff84(%rip), %rsi     # 0xe53f0
leaq 0x714bf(%rip), %rdx     # 0x116932
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x3fba1(%rip), %rsi     # 0xe5034
leaq 0x714bd(%rip), %rdx     # 0x116957
movq %rbx, %rdi
movl $0xbec, %ecx            # imm = 0xBEC
jmp 0xa55d6
movq 0x848(%rsp), %rsi
movl 0x68(%rbx), %eax
cmpl $0x2, %eax
je 0xa5514
cmpl $0x1, %eax
je 0xa54db
testl %eax, %eax
movsd 0x8(%rsp), %xmm0
jne 0xa551b
movsd 0x390(%rbx,%r12,8), %xmm0
mulsd 0x808(%r15), %xmm0
jmp 0xa54ff
movsd 0x808(%r15), %xmm0
mulsd 0x828(%r15), %xmm0
addsd 0x3fd6b(%rip), %xmm0    # 0xe5260
mulsd 0x390(%rbx,%r12,8), %xmm0
movsd 0x70(%rbx,%r12,8), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
maxsd %xmm1, %xmm0
jmp 0xa551b
movsd 0x70(%rbx,%r12,8), %xmm0
movq %r14, %rdi
callq 0x58adb
cmpl $0x1, %eax
jne 0xa556e
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x3feba(%rip), %rsi     # 0xe53f0
leaq 0x71433(%rip), %rdx     # 0x116970
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x3fad7(%rip), %rsi     # 0xe5034
leaq 0x713f3(%rip), %rdx     # 0x116957
movq %rbx, %rdi
movl $0xbfe, %ecx            # imm = 0xBFE
jmp 0xa55d6
movq 0x840(%rsp), %rsi
xorpd %xmm0, %xmm0
maxsd 0x70(%rbx,%r12,8), %xmm0
movq %r14, %rdi
callq 0x58adb
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0xa55e3
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x3fe50(%rip), %rsi     # 0xe53f0
leaq 0x713ee(%rip), %rdx     # 0x116995
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x3fa6d(%rip), %rsi     # 0xe5034
leaq 0x71389(%rip), %rdx     # 0x116957
movq %rbx, %rdi
movl $0xc08, %ecx            # imm = 0xC08
movq %r15, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r14
popq %r15
retq