// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movl %r8d, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x68(%rdx), %eax
cmpl $0x2, %eax
je 0xaa8b2
cmpl $0x1, %eax
je 0xaa884
xorpd %xmm0, %xmm0
testl %eax, %eax
jne 0xaa8bb
movslq %ebp, %rax
movsd 0x390(%rbx,%rax,8), %xmm0
mulsd 0x808(%r15), %xmm0
jmp 0xaa8aa
movslq %ebp, %rax
movsd 0x808(%r15), %xmm0
mulsd 0x828(%r15), %xmm0
addsd 0x439bf(%rip), %xmm0    # 0xee260
mulsd 0x390(%rbx,%rax,8), %xmm0
addsd 0x70(%rbx,%rax,8), %xmm0
jmp 0xaa8bb
movslq %ebp, %rax
movsd 0x70(%rbx,%rax,8), %xmm0
movq %r14, %rdi
movsd %xmm0, 0x8(%rsp)
movq %r9, %rsi
callq 0x5c896
cmpl $0x1, %eax
jne 0xaa91a
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x43b11(%rip), %rsi     # 0xee3f0
leaq 0x751bc(%rip), %rdx     # 0x11faa2
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x4372e(%rip), %rsi     # 0xee034
leaq 0x751ba(%rip), %rdx     # 0x11fac7
movq %rbx, %rdi
movl $0xbec, %ecx            # imm = 0xBEC
jmp 0xaaa50
movq 0x848(%rsp), %rsi
movl 0x68(%rbx), %eax
cmpl $0x2, %eax
je 0xaa98a
cmpl $0x1, %eax
je 0xaa950
testl %eax, %eax
movsd 0x8(%rsp), %xmm0
jne 0xaa993
movslq %ebp, %rax
movsd 0x390(%rbx,%rax,8), %xmm0
mulsd 0x808(%r15), %xmm0
jmp 0xaa976
movslq %ebp, %rax
movsd 0x808(%r15), %xmm0
mulsd 0x828(%r15), %xmm0
addsd 0x438f3(%rip), %xmm0    # 0xee260
mulsd 0x390(%rbx,%rax,8), %xmm0
movsd 0x70(%rbx,%rax,8), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
maxsd %xmm1, %xmm0
jmp 0xaa993
movslq %ebp, %rax
movsd 0x70(%rbx,%rax,8), %xmm0
movq %r14, %rdi
callq 0x5c896
cmpl $0x1, %eax
jne 0xaa9e6
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x43a42(%rip), %rsi     # 0xee3f0
leaq 0x7512b(%rip), %rdx     # 0x11fae0
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x4365f(%rip), %rsi     # 0xee034
leaq 0x750eb(%rip), %rdx     # 0x11fac7
movq %rbx, %rdi
movl $0xbfe, %ecx            # imm = 0xBFE
jmp 0xaaa50
movq 0x840(%rsp), %rsi
movslq %ebp, %rax
xorpd %xmm0, %xmm0
maxsd 0x70(%rbx,%rax,8), %xmm0
movq %r14, %rdi
callq 0x5c896
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0xaaa5f
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x439d6(%rip), %rsi     # 0xee3f0
leaq 0x750e4(%rip), %rdx     # 0x11fb05
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x435f3(%rip), %rsi     # 0xee034
leaq 0x7507f(%rip), %rdx     # 0x11fac7
movq %rbx, %rdi
movl $0xc08, %ecx            # imm = 0xC08
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r14
popq %r15
popq %rbp
retq