// File: /workspace/github_c_makefile_star2_O1/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
xorpd %xmm0, %xmm0
movslq %r8d, %r12
testl %eax, %eax
jne 0xad91c
movsd 0x390(%rbx,%r12,8), %xmm0
mulsd 0x808(%r15), %xmm0
addsd 0x70(%rbx,%r12,8), %xmm0
cmpl $0x1, %eax
jne 0xad94c
movsd 0x808(%r15), %xmm0
mulsd 0x828(%r15), %xmm0
addsd 0x43925(%rip), %xmm0    # 0xf1260
mulsd 0x390(%rbx,%r12,8), %xmm0
addsd 0x70(%rbx,%r12,8), %xmm0
cmpl $0x2, %eax
jne 0xad958
movsd 0x70(%rbx,%r12,8), %xmm0
movq %r14, %rdi
movsd %xmm0, 0x8(%rsp)
movq %r9, %rsi
callq 0x5efb7
cmpl $0x1, %eax
jne 0xad9b7
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x43a74(%rip), %rsi     # 0xf13f0
leaq 0x750df(%rip), %rdx     # 0x122a62
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x43691(%rip), %rsi     # 0xf1034
leaq 0x750dd(%rip), %rdx     # 0x122a87
movq %rbx, %rdi
movl $0xbec, %ecx            # imm = 0xBEC
jmp 0xadaf5
movl 0x68(%rbx), %eax
testl %eax, %eax
movsd 0x8(%rsp), %xmm0
jne 0xad9ea
movsd 0x390(%rbx,%r12,8), %xmm0
mulsd 0x808(%r15), %xmm0
movsd 0x70(%rbx,%r12,8), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
maxsd %xmm1, %xmm0
cmpl $0x1, %eax
jne 0xada26
movsd 0x808(%r15), %xmm0
mulsd 0x828(%r15), %xmm0
addsd 0x43857(%rip), %xmm0    # 0xf1260
mulsd 0x390(%rbx,%r12,8), %xmm0
movsd 0x70(%rbx,%r12,8), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
maxsd %xmm1, %xmm0
movq 0x848(%rsp), %rsi
cmpl $0x2, %eax
jne 0xada3a
movsd 0x70(%rbx,%r12,8), %xmm0
movq %r14, %rdi
callq 0x5efb7
cmpl $0x1, %eax
jne 0xada8d
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x4399b(%rip), %rsi     # 0xf13f0
leaq 0x75044(%rip), %rdx     # 0x122aa0
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x435b8(%rip), %rsi     # 0xf1034
leaq 0x75004(%rip), %rdx     # 0x122a87
movq %rbx, %rdi
movl $0xbfe, %ecx            # imm = 0xBFE
jmp 0xadaf5
movq 0x840(%rsp), %rsi
xorpd %xmm0, %xmm0
maxsd 0x70(%rbx,%r12,8), %xmm0
movq %r14, %rdi
callq 0x5efb7
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0xadb04
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x43931(%rip), %rsi     # 0xf13f0
leaq 0x74fff(%rip), %rdx     # 0x122ac5
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x4354e(%rip), %rsi     # 0xf1034
leaq 0x74f9a(%rip), %rdx     # 0x122a87
movq %rbx, %rdi
movl $0xc08, %ecx            # imm = 0xC08
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r14
popq %r15
retq