// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/fourier.c
// Function: fourier_k_nl_at_z
int fourier_k_nl_at_z(
                      struct background *pba,
                      struct fourier * pfo,
                      double z,
                      double * k_nl,
                      double * k_nl_cb
                      ) {

  double tau;

  /** - convert input redshift into a conformal time */

  class_call(background_tau_of_z(pba,
                                 z,
                                 &tau),
             pba->error_message,
             pfo->error_message);

  /** - interpolate the precomputed k_nl array at the needed valuetime */

  if (pfo->has_pk_m == _TRUE_) {

    if (pfo->tau_size == 1) {
      *k_nl = pfo->k_nl[pfo->index_pk_m][0];
    }
    else {
      class_call(array_interpolate_two(pfo->tau,
                                       1,
                                       0,
                                       pfo->k_nl[pfo->index_pk_m],
                                       1,
                                       pfo->tau_size,
                                       tau,
                                       k_nl,
                                       1,
                                       pfo->error_message),
                 pfo->error_message,
                 pfo->error_message);
    }
  }

  /** - if needed, do the same for the baryon part only */

  if (pfo->has_pk_cb == _TRUE_) {

    if (pfo->tau_size == 1) {
      *k_nl_cb = pfo->k_nl[pfo->index_pk_cb][0];
    }
    else {
      class_call(array_interpolate_two(pfo->tau,
                                       1,
                                       0,
                                       pfo->k_nl[pfo->index_pk_cb],
                                       1,
                                       pfo->tau_size,
                                       tau,
                                       k_nl_cb,
                                       1,
                                       pfo->error_message),
                 pfo->error_message,
                 pfo->error_message);
    }
  }

  /* otherwise, return the same for k_nl_cb as for k_nl */

  else{
    *k_nl_cb = *k_nl;
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x8(%rsp), %rsi
callq 0x58adb
cmpl $0x1, %eax
jne 0x9ae01
addq $0xd1c, %r12            # imm = 0xD1C
leaq 0x4a637(%rip), %rsi     # 0xe53f0
leaq 0x6df1f(%rip), %rdx     # 0x108cdf
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4a254(%rip), %rsi     # 0xe5034
leaq 0x7857d(%rip), %rdx     # 0x113364
movq %rbx, %rdi
movl $0x4ad, %ecx            # imm = 0x4AD
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbp
jmp 0x9aef2
cmpw $0x1, 0x50(%rbx)
jne 0x9aebd
movl 0x140(%rbx), %r9d
cmpl $0x1, %r9d
jne 0x9ae36
movq 0x158(%rbx), %rax
movslq 0x54(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%r15)
jmp 0x9aebd
movq 0x148(%rbx), %rdi
movq 0x158(%rbx), %rax
movslq 0x54(%rbx), %rcx
movq (%rax,%rcx,8), %rcx
movsd 0x8(%rsp), %xmm0
leaq 0x192(%rbx), %r12
subq $0x8, %rsp
pushq $0x1
popq %rbp
movl %ebp, %esi
xorl %edx, %edx
movl %ebp, %r8d
pushq %r12
pushq $0x1
pushq %r15
callq 0x17f36
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0x9aebd
leaq 0x4a56e(%rip), %rsi     # 0xe53f0
leaq 0x784ed(%rip), %rdx     # 0x113376
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4a192(%rip), %rsi     # 0xe5034
leaq 0x784bb(%rip), %rdx     # 0x113364
movq %r12, %rdi
movl $0x4c2, %ecx            # imm = 0x4C2
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
jmp 0x9aef2
cmpw $0x1, 0x52(%rbx)
jne 0x9aee6
movl 0x140(%rbx), %r9d
cmpl $0x1, %r9d
jne 0x9af04
movq 0x158(%rbx), %rax
movslq 0x58(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
jmp 0x9aeeb
movsd (%r15), %xmm0
movsd %xmm0, (%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x148(%rbx), %rdi
movq 0x158(%rbx), %rax
movslq 0x58(%rbx), %rcx
movq (%rax,%rcx,8), %rcx
movsd 0x8(%rsp), %xmm0
addq $0x192, %rbx            # imm = 0x192
subq $0x8, %rsp
xorl %ebp, %ebp
pushq $0x1
popq %r15
movl %r15d, %esi
xorl %edx, %edx
movl %r15d, %r8d
pushq %rbx
pushq $0x1
pushq %r14
callq 0x17f36
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0x9aef2
leaq 0x4a49d(%rip), %rsi     # 0xe53f0
leaq 0x78492(%rip), %rdx     # 0x1133ec
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4a0c1(%rip), %rsi     # 0xe5034
leaq 0x783ea(%rip), %rdx     # 0x113364
movq %rbx, %rdi
movl $0x4d9, %ecx            # imm = 0x4D9
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
movl %r15d, %ebp
jmp 0x9aef2