// File: /workspace/github_c_makefile_star2_O1/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)
cmpl $0x0, 0x8a4(%rsi)
jle 0xa84b3
movq %rdi, %r15
leaq 0x96a(%rsi), %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movq %rsi, 0x18(%rsp)
movq 0x870(%r15), %rax
movq 0x998(%r15), %rcx
movslq (%rax,%r13,4), %rax
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), %rcx
movl (%rcx,%r13,4), %ecx
testq %rax, %rax
je 0xa855e
testl %ecx, %ecx
jle 0xa849b
xorl %ebx, %ebx
movq 0x998(%r15), %rax
movl (%rax,%r13,4), %r14d
testl %r14d, %r14d
jle 0xa8488
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 0xa84ba
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 0x15f89
cmpl $0x1, %eax
je 0xa8502
movq 0x998(%r15), %rax
movl (%rax,%r13,4), %r14d
incq %r12
cmpl %r14d, %r12d
jl 0xa83d4
incl %ebx
movq 0x870(%r15), %rax
cmpl (%rax,%r13,4), %ebx
jl 0xa83b5
incq %r13
movq 0x18(%rsp), %rbx
movslq 0x8a4(%rbx), %rax
cmpq %rax, %r13
jl 0xa836b
xorl %eax, %eax
jmp 0xa854c
movq 0x9c8(%r15), %rax
movl (%rax,%r13,4), %ecx
imull %ebp, %ecx
shll $0x3, %ecx
leaq 0x48b32(%rip), %rsi     # 0xf1004
leaq 0x7974a(%rip), %rdx     # 0x121c23
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x48b45(%rip), %rsi     # 0xf1034
leaq 0x79709(%rip), %rdx     # 0x121bff
movq 0x8(%rsp), %rdi
movl $0x2ed, %ecx            # imm = 0x2ED
jmp 0xa853d
leaq 0x48ee7(%rip), %rsi     # 0xf13f0
leaq 0x7975a(%rip), %rdx     # 0x121c6a
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x48b06(%rip), %rsi     # 0xf1034
leaq 0x796ca(%rip), %rdx     # 0x121bff
movq %rbx, %rdi
movl $0x2f7, %ecx            # imm = 0x2F7
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
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 0x48a90(%rip), %rsi     # 0xf1004
leaq 0x7966b(%rip), %rdx     # 0x121be6
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x48aa3(%rip), %rsi     # 0xf1034
leaq 0x79667(%rip), %rdx     # 0x121bff
movq 0x8(%rsp), %rdi
movl $0x2e5, %ecx            # imm = 0x2E5
jmp 0xa853d