// File: /workspace/github_c_makefile_star2_O2/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, %r12
movq %rdx, 0x20(%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x96a(%rsi), %rax
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
pushq $0x1
popq %rax
movl %eax, 0x8(%rsp)
movslq 0x8a4(%r14), %rax
cmpq %rax, %rbx
jge 0xa0653
movq 0x870(%r15), %rax
movq 0x998(%r15), %rcx
movslq (%rax,%rbx,4), %rax
movslq (%rcx,%rbx,4), %rdi
imulq %rax, %rdi
shlq $0x3, %rdi
callq 0x8490
movq %rax, (%r12,%rbx,8)
testq %rax, %rax
je 0xa065d
xorl %ecx, %ecx
movq %r14, 0x18(%rsp)
movq 0x870(%r15), %rax
cmpl (%rax,%rbx,4), %ecx
jge 0xa05a9
movl %ecx, 0xc(%rsp)
movslq %ecx, %rax
movq %rax, 0x28(%rsp)
xorl %r13d, %r13d
movq 0x998(%r15), %rax
movl (%rax,%rbx,4), %r14d
cmpl %r14d, %r13d
jge 0xa0599
movq 0x9c8(%r15), %rax
movslq (%rax,%rbx,4), %rdi
movslq 0x9f8(%r15), %rbp
imulq %rbp, %rdi
shlq $0x3, %rdi
callq 0x8490
movq (%r12,%rbx,8), %rcx
imull 0xc(%rsp), %r14d
addl %r13d, %r14d
movslq %r14d, %rdx
movq %rax, (%rcx,%rdx,8)
movq (%r12,%rbx,8), %rcx
movq 0x998(%r15), %rax
movslq (%rax,%rbx,4), %rax
imulq 0x28(%rsp), %rax
addq %r13, %rax
movq (%rcx,%rax,8), %r8
testq %r8, %r8
je 0xa05b1
movq 0x9c8(%r15), %rcx
movq 0x9d0(%r15), %rdx
movq (%rdx,%rbx,8), %rdi
movl (%rcx,%rbx,4), %esi
movq 0x20(%rsp), %rcx
movq (%rcx,%rbx,8), %rcx
movq (%rcx,%rax,8), %rdx
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movl %ebp, %ecx
pushq $0x1
popq %r9
callq 0x141fa
incq %r13
cmpl $0x1, %eax
jne 0xa04ed
jmp 0xa05f8
movl 0xc(%rsp), %ecx
incl %ecx
movq 0x18(%rsp), %r14
jmp 0xa04ce
incq %rbx
jmp 0xa0487
movq 0x9c8(%r15), %rax
movl (%rax,%rbx,4), %ecx
imull %ebp, %ecx
shll $0x3, %ecx
leaq 0x44a3c(%rip), %rsi     # 0xe5004
leaq 0x75524(%rip), %rdx     # 0x115af3
leaq 0x30(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x44a4f(%rip), %rsi     # 0xe5034
leaq 0x754e3(%rip), %rdx     # 0x115acf
movq 0x10(%rsp), %rdi
movl $0x2ed, %ecx            # imm = 0x2ED
jmp 0xa0633
leaq 0x44df1(%rip), %rsi     # 0xe53f0
leaq 0x75534(%rip), %rdx     # 0x115b3a
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x44a10(%rip), %rsi     # 0xe5034
leaq 0x754a4(%rip), %rdx     # 0x115acf
movq %rbx, %rdi
movl $0x2f7, %ecx            # imm = 0x2F7
movq %r15, %r8
xorl %eax, %eax
callq 0x2e014
movl 0x8(%rsp), %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, 0x8(%rsp)
jmp 0xa063d
movq 0x870(%r15), %rax
movq 0x998(%r15), %rdx
movl (%rax,%rbx,4), %ecx
imull (%rdx,%rbx,4), %ecx
shll $0x3, %ecx
leaq 0x44988(%rip), %rsi     # 0xe5004
leaq 0x75433(%rip), %rdx     # 0x115ab6
leaq 0x30(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x4499b(%rip), %rsi     # 0xe5034
leaq 0x7542f(%rip), %rdx     # 0x115acf
movq 0x10(%rsp), %rdi
movl $0x2e5, %ecx            # imm = 0x2E5
jmp 0xa0633