// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/perturbations.c
// Function: perturbations_sources_at_tau
int perturbations_sources_at_tau(
                                 struct perturbations * ppt,
                                 int index_md,
                                 int index_ic,
                                 int index_tp,
                                 double tau,
                                 double * psource_at_tau
                                 ) {

  /** Summary: */

  /** - define local variables */

  int last_index;
  double logtau;

  short do_spline = _FALSE_;

  logtau = log(tau);

  /** - If we have defined a z_max_pk > 0, then we have already an
     array of sources and of their second derivative with respect to
     time in the range 0 < z < z_max_pk, that can be used for an
     accurate spline interpolation at a given tau. Check whether we
     are in this situation and whether the value of tau is in the
     right range. */

  if (ppt->ln_tau_size > 1) {
    if (logtau >= ppt->ln_tau[0]) {
      do_spline = _TRUE_;
    }
  }

  /** - If yes, we do such a spline */

  if (do_spline == _TRUE_) {

    class_call(array_interpolate_spline(ppt->ln_tau,
                                        ppt->ln_tau_size,
                                        ppt->late_sources[index_md][index_ic * ppt->tp_size[index_md] + index_tp],
                                        ppt->ddlate_sources[index_md][index_ic*ppt->tp_size[index_md] + index_tp],
                                        ppt->k_size[index_md],
                                        logtau,
                                        &last_index,
                                        psource_at_tau,
                                        ppt->k_size[index_md],
                                        ppt->error_message),
               ppt->error_message,
               ppt->error_message);
  }


  /** - otherwise, we just go for a quick linear interpolation. This
        is made available for developpers for completeness, but it is
        actually never used by the default version of CLASS */

  else {

    class_call(array_interpolate_two_bis(ppt->tau_sampling,
                                         1,
                                         0,
                                         ppt->sources[index_md][index_ic*ppt->tp_size[index_md]+index_tp],
                                         ppt->k_size[index_md],
                                         ppt->tau_size,
                                         tau,
                                         psource_at_tau,
                                         ppt->k_size[index_md],
                                         ppt->error_message),
               ppt->error_message,
               ppt->error_message);
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x1068, %rsp           # imm = 0x1068
movq %rdi, 0x1058(%rsp)
movl %esi, 0x1054(%rsp)
movl %edx, 0x1050(%rsp)
movl %ecx, 0x104c(%rsp)
movsd %xmm0, 0x1040(%rsp)
movq %r8, 0x1038(%rsp)
movw $0x0, 0x1026(%rsp)
movsd 0x1040(%rsp), %xmm0
callq 0x82f0
movsd %xmm0, 0x1028(%rsp)
movq 0x1058(%rsp), %rax
cmpl $0x1, 0xa60(%rax)
jle 0xc77b1
movsd 0x1028(%rsp), %xmm0
movq 0x1058(%rsp), %rax
movq 0xa58(%rax), %rax
ucomisd (%rax), %xmm0
jb 0xc77af
movw $0x1, 0x1026(%rsp)
jmp 0xc77b1
movswl 0x1026(%rsp), %eax
cmpl $0x1, %eax
jne 0xc795e
movq 0x1058(%rsp), %rax
movq 0xa58(%rax), %rdi
movq 0x1058(%rsp), %rax
movl 0xa60(%rax), %esi
movq 0x1058(%rsp), %rax
movq 0xa68(%rax), %rax
movslq 0x1054(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1050(%rsp), %ecx
movq 0x1058(%rsp), %rdx
movq 0x998(%rdx), %rdx
movslq 0x1054(%rsp), %r8
imull (%rdx,%r8,4), %ecx
addl 0x104c(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq 0x1058(%rsp), %rax
movq 0xa70(%rax), %rax
movslq 0x1054(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1050(%rsp), %ecx
movq 0x1058(%rsp), %r8
movq 0x998(%r8), %r8
movslq 0x1054(%rsp), %r9
imull (%r8,%r9,4), %ecx
addl 0x104c(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x1058(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x1054(%rsp), %r8
movl (%rax,%r8,4), %r8d
movsd 0x1028(%rsp), %xmm0
movq 0x1038(%rsp), %r11
movq 0x1058(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x1054(%rsp), %r9
movl (%rax,%r9,4), %r10d
movq 0x1058(%rsp), %rax
addq $0x6c8a, %rax           # imm = 0x6C8A
leaq 0x1034(%rsp), %r9
movq %r11, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x24220
cmpl $0x1, %eax
jne 0xc7959
leaq 0x820(%rsp), %rdi
movq 0x1058(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0x10aace(%rip), %rsi    # 0x1d23d8
leaq 0x12f078(%rip), %rdx    # 0x1f6989
movb $0x0, %al
callq 0x5b9c0
movq 0x1058(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x820(%rsp), %r8
leaq 0x10a6fe(%rip), %rsi    # 0x1d2034
leaq 0x12f181(%rip), %rdx    # 0x1f6abe
movl $0x5e, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1064(%rsp)
jmp 0xc7aac
jmp 0xc7aa1
movq 0x1058(%rsp), %rax
movq 0x9f0(%rax), %rdi
movq 0x1058(%rsp), %rax
movq 0xa38(%rax), %rax
movslq 0x1054(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x1050(%rsp), %ecx
movq 0x1058(%rsp), %rdx
movq 0x998(%rdx), %rdx
movslq 0x1054(%rsp), %rsi
imull (%rdx,%rsi,4), %ecx
addl 0x104c(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
movq 0x1058(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x1054(%rsp), %rdx
movl (%rax,%rdx,4), %r8d
movq 0x1058(%rsp), %rax
movl 0x9f8(%rax), %r9d
movsd 0x1040(%rsp), %xmm0
movq 0x1038(%rsp), %r11
movq 0x1058(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x1054(%rsp), %rdx
movl (%rax,%rdx,4), %r10d
movq 0x1058(%rsp), %rax
addq $0x6c8a, %rax           # imm = 0x6C8A
movl $0x1, %esi
xorl %edx, %edx
movq %r11, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x287d0
cmpl $0x1, %eax
jne 0xc7a9f
leaq 0x20(%rsp), %rdi
movq 0x1058(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0x10a982(%rip), %rsi    # 0x1d23d8
leaq 0x12f07e(%rip), %rdx    # 0x1f6adb
movb $0x0, %al
callq 0x5b9c0
movq 0x1058(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x20(%rsp), %r8
leaq 0x10a5b5(%rip), %rsi    # 0x1d2034
leaq 0x12f038(%rip), %rdx    # 0x1f6abe
movl $0x73, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1064(%rsp)
jmp 0xc7aac
jmp 0xc7aa1
movl $0x0, 0x1064(%rsp)
movl 0x1064(%rsp), %eax
addq $0x1068, %rsp           # imm = 0x1068
retq
nopl (%rax,%rax)