// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x2888, %rsp           # imm = 0x2888
movq %rdi, 0x2878(%rsp)
movq %rsi, 0x2870(%rsp)
movl %edx, 0x286c(%rsp)
movl %ecx, 0x2868(%rsp)
movl %r8d, 0x2864(%rsp)
movsd %xmm0, 0x2858(%rsp)
movsd %xmm1, 0x2850(%rsp)
movq %r9, 0x2848(%rsp)
movq 0x2870(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x286c(%rsp), %rcx
movslq (%rax,%rcx,4), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x2840(%rsp)
cmpq $0x0, 0x2840(%rsp)
jne 0xc7d4d
movq 0x2870(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x286c(%rsp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x3, %rax
movl %eax, 0x2830(%rsp)
leaq 0x2030(%rsp), %rdi
movl 0x2830(%rsp), %ecx
leaq 0x10a306(%rip), %rsi    # 0x1d2004
leaq 0x13069c(%rip), %rdx    # 0x1f83a1
movb $0x0, %al
callq 0x5b9c0
movq 0x2870(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x2030(%rsp), %r8
leaq 0x10a30a(%rip), %rsi    # 0x1d2034
leaq 0x12eeee(%rip), %rdx    # 0x1f6c1f
movl $0xc4, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2884(%rsp)
jmp 0xc8094
movq 0x2870(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x286c(%rsp), %rcx
movslq (%rax,%rcx,4), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x2838(%rsp)
cmpq $0x0, 0x2838(%rsp)
jne 0xc7e13
movq 0x2870(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x286c(%rsp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x3, %rax
movl %eax, 0x202c(%rsp)
leaq 0x1820(%rsp), %rdi
movl 0x202c(%rsp), %ecx
leaq 0x10a240(%rip), %rsi    # 0x1d2004
leaq 0x12ee75(%rip), %rdx    # 0x1f6c40
movb $0x0, %al
callq 0x5b9c0
movq 0x2870(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x1820(%rsp), %r8
leaq 0x10a244(%rip), %rsi    # 0x1d2034
leaq 0x12ee28(%rip), %rdx    # 0x1f6c1f
movl $0xc8, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2884(%rsp)
jmp 0xc8094
movq 0x2878(%rsp), %rdi
movq 0x2870(%rsp), %rsi
movl 0x286c(%rsp), %edx
movl 0x2868(%rsp), %ecx
movl 0x2864(%rsp), %r8d
movsd 0x2850(%rsp), %xmm0
movq 0x2840(%rsp), %r9
callq 0xc7ac0
cmpl $0x1, %eax
jne 0xc7ec1
leaq 0x1020(%rsp), %rdi
movq 0x2870(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0x10a566(%rip), %rsi    # 0x1d23d8
leaq 0x12edd5(%rip), %rdx    # 0x1f6c4e
movb $0x0, %al
callq 0x5b9c0
movq 0x2870(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x1020(%rsp), %r8
leaq 0x10a196(%rip), %rsi    # 0x1d2034
leaq 0x12ed7a(%rip), %rdx    # 0x1f6c1f
movl $0xcc, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2884(%rsp)
jmp 0xc8094
movq 0x2870(%rsp), %rax
movq 0x9d0(%rax), %rax
movslq 0x286c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x2870(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x286c(%rsp), %rcx
movl (%rax,%rcx,4), %esi
movq 0x2840(%rsp), %rdx
movq 0x2838(%rsp), %r8
movq 0x2870(%rsp), %rax
addq $0x6c8a, %rax           # imm = 0x6C8A
movl $0x1, %r9d
movl %r9d, %ecx
movq %rax, (%rsp)
callq 0x1cf90
cmpl $0x1, %eax
jne 0xc7f98
leaq 0x820(%rsp), %rdi
movq 0x2870(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0x10a48f(%rip), %rsi    # 0x1d23d8
leaq 0x12ed47(%rip), %rdx    # 0x1f6c97
movb $0x0, %al
callq 0x5b9c0
movq 0x2870(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x820(%rsp), %r8
leaq 0x10a0bf(%rip), %rsi    # 0x1d2034
leaq 0x12eca3(%rip), %rdx    # 0x1f6c1f
movl $0xd6, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2884(%rsp)
jmp 0xc8094
movq 0x2870(%rsp), %rax
movq 0x9d0(%rax), %rax
movslq 0x286c(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
movq 0x2870(%rsp), %rax
movq 0x9c8(%rax), %rax
movslq 0x286c(%rsp), %rcx
movl (%rax,%rcx,4), %esi
movq 0x2840(%rsp), %rdx
movq 0x2838(%rsp), %rcx
movsd 0x2858(%rsp), %xmm0
movq 0x2848(%rsp), %r10
movq 0x2870(%rsp), %rax
addq $0x6c8a, %rax           # imm = 0x6C8A
movl $0x1, %r8d
leaq 0x2834(%rsp), %r9
movq %r10, (%rsp)
movl $0x1, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x24220
cmpl $0x1, %eax
jne 0xc8089
leaq 0x20(%rsp), %rdi
movq 0x2870(%rsp), %rcx
addq $0x6c8a, %rcx           # imm = 0x6C8A
leaq 0x10a398(%rip), %rsi    # 0x1d23d8
leaq 0x12ecc4(%rip), %rdx    # 0x1f6d0b
movb $0x0, %al
callq 0x5b9c0
movq 0x2870(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x20(%rsp), %r8
leaq 0x109fcb(%rip), %rsi    # 0x1d2034
leaq 0x12ebaf(%rip), %rdx    # 0x1f6c1f
movl $0xe3, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2884(%rsp)
jmp 0xc8094
movl $0x0, 0x2884(%rsp)
movl 0x2884(%rsp), %eax
addq $0x2888, %rsp           # imm = 0x2888
retq
nopw %cs:(%rax,%rax)