// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/perturbations.c
// Function: perturbations_sources_at_k_and_z
int perturbations_sources_at_k_and_z(
                                     struct background * pba,
                                     struct perturbations * ppt,
                                     int index_md,
                                     int index_ic,
                                     int index_tp,
                                     double k,
                                     double z,
                                     double * psource_at_k_and_z
                                     ) {

  double * sources;
  double * ddsources_dk2;
  int last_index;

  class_alloc(sources,
              ppt->k_size[index_md]*sizeof(double),
              ppt->error_message);

  class_alloc(ddsources_dk2,
              ppt->k_size[index_md]*sizeof(double),
              ppt->error_message);

  class_call(perturbations_sources_at_z(pba,ppt,index_md,index_ic,index_tp,z,sources),
             ppt->error_message,
             ppt->error_message);

  class_call(array_spline_table_lines(ppt->k[index_md],
                                      ppt->k_size[index_md],
                                      sources,
                                      1,
                                      ddsources_dk2,
                                      _SPLINE_EST_DERIV_,
                                      ppt->error_message),
             ppt->error_message,
             ppt->error_message);

  class_call(array_interpolate_spline(ppt->k[index_md],
                                      ppt->k_size[index_md],
                                      sources,
                                      ddsources_dk2,
                                      1,
                                      k,
                                      &last_index,
                                      psource_at_k_and_z,
                                      1,
                                      ppt->error_message),
             ppt->error_message,
             ppt->error_message);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movq %r9, 0x10(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x8(%rsp)
movl %r8d, 0x4(%rsp)
movl %ecx, (%rsp)
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, 0x18(%rsp)
movq 0x9c8(%rsi), %rax
movslq %edx, %r15
movslq (%rax,%r15,4), %r13
movq %r13, %rbp
shlq $0x3, %rbp
movq %rbp, %rdi
callq 0x8460
testq %rax, %rax
je 0x74621
movq %rax, %r12
movq %rbp, %rdi
callq 0x8460
testq %rax, %rax
je 0x74665
movq %rax, %rbp
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movl %r14d, %edx
movl (%rsp), %ecx
movl 0x4(%rsp), %r8d
movsd 0x20(%rsp), %xmm0
movq %r12, %r9
callq 0x7444d
testl %eax, %eax
je 0x746ca
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x7ce03(%rip), %rsi     # 0xf13f0
leaq 0xa1871(%rip), %rdx     # 0x115e65
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x7ca27(%rip), %rsi     # 0xf1034
leaq 0xa1822(%rip), %rdx     # 0x115e36
movq %rbx, %rdi
movl $0xcc, %ecx
jmp 0x746a7
leal (,%r13,8), %ecx
leaq 0x7c9d4(%rip), %rsi     # 0xf1004
leaq 0xa6c60(%rip), %rdx     # 0x11b297
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x7c9e0(%rip), %rsi     # 0xf1034
leaq 0xa17db(%rip), %rdx     # 0x115e36
movq %rbx, %rdi
movl $0xc4, %ecx
jmp 0x746a7
leal (,%r13,8), %ecx
leaq 0x7c990(%rip), %rsi     # 0xf1004
leaq 0xa17dc(%rip), %rdx     # 0x115e57
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x7c99c(%rip), %rsi     # 0xf1034
leaq 0xa1797(%rip), %rdx     # 0x115e36
movq %rbx, %rdi
movl $0xc8, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9c8(%rbx), %rax
movq 0x9d0(%rbx), %rcx
movq (%rcx,%r15,8), %rdi
movl (%rax,%r15,4), %esi
leaq 0x6c8a(%rbx), %r14
subq $0x8, %rsp
movq %rbp, %r13
movl $0x1, %ebp
movq %r12, %rdx
movl $0x1, %ecx
movq %r13, %r8
movl $0x1, %r9d
pushq %r14
callq 0x14191
addq $0x10, %rsp
cmpl $0x1, %eax
jne 0x74759
leaq 0x7ccd5(%rip), %rsi     # 0xf13f0
leaq 0xa178c(%rip), %rdx     # 0x115eae
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x7c8f9(%rip), %rsi     # 0xf1034
leaq 0xa16f4(%rip), %rdx     # 0x115e36
movq %r14, %rdi
movl $0xd6, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
jmp 0x746b6
movq 0x9c8(%rbx), %rax
movq 0x9d0(%rbx), %rcx
movq (%rcx,%r15,8), %rdi
movl (%rax,%r15,4), %esi
subq $0x8, %rsp
leaq 0x34(%rsp), %r9
movq %r12, %rdx
movq %r13, %rcx
movl $0x1, %r8d
movsd 0x10(%rsp), %xmm0
pushq %r14
pushq $0x1
pushq 0x28(%rsp)
callq 0x17ee6
addq $0x20, %rsp
xorl %ebp, %ebp
cmpl $0x1, %eax
jne 0x746b6
leaq 0x7cc43(%rip), %rsi     # 0xf13f0
leaq 0xa176e(%rip), %rdx     # 0x115f22
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x7c867(%rip), %rsi     # 0xf1034
leaq 0xa1662(%rip), %rdx     # 0x115e36
movq %r14, %rdi
movl $0xe3, %ecx
movq %rbx, %r8
jmp 0x746aa