// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_perturbation_source_spline
int transfer_perturbation_source_spline(
                                        struct perturbations * ppt,
                                        struct transfer * ptr,
                                        double *** sources,
                                        double *** sources_spline
                                        ) {
  int index_md;
  int index_ic;
  int index_tp;

  for (index_md = 0; index_md < ptr->md_size; index_md++) {

    class_alloc(sources_spline[index_md],
                ppt->ic_size[index_md]*ppt->tp_size[index_md]*sizeof(double*),
                ptr->error_message);

    for (index_ic = 0; index_ic < ppt->ic_size[index_md]; index_ic++) {

      for (index_tp = 0; index_tp < ppt->tp_size[index_md]; index_tp++) {

        class_alloc(sources_spline[index_md][index_ic * ppt->tp_size[index_md] + index_tp],
                    ppt->k_size[index_md]*ppt->tau_size*sizeof(double),
                    ptr->error_message);

        class_call(array_spline_table_columns2(ppt->k[index_md],
                                               ppt->k_size[index_md],
                                               sources[index_md][index_ic * ppt->tp_size[index_md] + index_tp],
                                               ppt->tau_size,
                                               sources_spline[index_md][index_ic * ppt->tp_size[index_md] + index_tp],
                                               _SPLINE_EST_DERIV_,
                                               ptr->error_message),
                   ptr->error_message,
                   ptr->error_message);

      }
    }
  }

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movq %rcx, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
movl 0x8a4(%rsi), %ebx
testl %ebx, %ebx
jle 0xa55a8
movq %rsi, %r14
movq %rdi, %r15
leaq 0x96a(%rsi), %rax
movq %rax, 0x8(%rsp)
movq 0x870(%rdi), %rdx
xorl %r13d, %r13d
movslq (%rdx,%r13,4), %rax
movq 0x998(%r15), %rcx
movslq (%rcx,%r13,4), %rdi
imulq %rax, %rdi
shlq $0x3, %rdi
callq 0x8460
movq 0x10(%rsp), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x870(%r15), %rdx
movl (%rdx,%r13,4), %ecx
testq %rax, %rax
je 0xa5653
testl %ecx, %ecx
jle 0xa5599
movq %r14, 0x18(%rsp)
movq 0x998(%r15), %rax
xorl %ebx, %ebx
movl (%rax,%r13,4), %r14d
testl %r14d, %r14d
jle 0xa5581
movslq %ebx, %rax
movq %rax, 0x28(%rsp)
xorl %r12d, %r12d
movq 0x9c8(%r15), %rax
movslq (%rax,%r13,4), %rdi
movslq 0x9f8(%r15), %rbp
imulq %rbp, %rdi
shlq $0x3, %rdi
callq 0x8460
movq 0x10(%rsp), %rsi
movq (%rsi,%r13,8), %rcx
imull %ebx, %r14d
movslq %r14d, %rdx
addq %r12, %rdx
movq %rax, (%rcx,%rdx,8)
movq (%rsi,%r13,8), %rcx
movq 0x998(%r15), %rax
movslq (%rax,%r13,4), %rax
imulq 0x28(%rsp), %rax
addq %r12, %rax
movq (%rcx,%rax,8), %r8
testq %r8, %r8
je 0xa55af
movq 0x9c8(%r15), %rcx
movq 0x9d0(%r15), %rdx
movq (%rdx,%r13,8), %rdi
movl (%rcx,%r13,4), %esi
movq 0x20(%rsp), %rcx
movq (%rcx,%r13,8), %rcx
movq (%rcx,%rax,8), %rdx
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movl %ebp, %ecx
movl $0x1, %r9d
callq 0x160b8
cmpl $0x1, %eax
je 0xa55f7
movq 0x998(%r15), %rax
movl (%rax,%r13,4), %r14d
incq %r12
cmpl %r14d, %r12d
jl 0xa54c6
movq 0x870(%r15), %rdx
incl %ebx
cmpl (%rdx,%r13,4), %ebx
jl 0xa54ae
movq 0x18(%rsp), %r14
movl 0x8a4(%r14), %ebx
incq %r13
movslq %ebx, %rax
cmpq %rax, %r13
jl 0xa545f
xorl %eax, %eax
jmp 0xa5641
movq 0x9c8(%r15), %rax
movl (%rax,%r13,4), %ecx
imull %ebp, %ecx
shll $0x3, %ecx
leaq 0x48a3d(%rip), %rsi     # 0xee004
leaq 0x79695(%rip), %rdx     # 0x11ec63
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x48a50(%rip), %rsi     # 0xee034
leaq 0x79654(%rip), %rdx     # 0x11ec3f
movq 0x8(%rsp), %rdi
movl $0x2ed, %ecx            # imm = 0x2ED
jmp 0xa5632
leaq 0x48df2(%rip), %rsi     # 0xee3f0
leaq 0x796a5(%rip), %rdx     # 0x11ecaa
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x48a11(%rip), %rsi     # 0xee034
leaq 0x79615(%rip), %rdx     # 0x11ec3f
movq %rbx, %rdi
movl $0x2f7, %ecx            # imm = 0x2F7
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x998(%r15), %rax
imull (%rax,%r13,4), %ecx
shll $0x3, %ecx
leaq 0x4899b(%rip), %rsi     # 0xee004
leaq 0x795b6(%rip), %rdx     # 0x11ec26
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x489ae(%rip), %rsi     # 0xee034
leaq 0x795b2(%rip), %rdx     # 0x11ec3f
movq 0x8(%rsp), %rdi
movl $0x2e5, %ecx            # imm = 0x2E5
jmp 0xa5632