// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/fourier.c
// Function: fourier_pk_tilt_at_k_and_z
int fourier_pk_tilt_at_k_and_z(
                               struct background * pba,
                               struct primordial * ppm,
                               struct fourier * pfo,
                               enum pk_outputs pk_output,
                               double k,
                               double z,
                               int index_pk,
                               double * pk_tilt
                               ) {

  double dlnk;
  double out_pk1,out_pk2;

  /* typical step dln(k) on which we believe that out results are not
     dominated by numerical errors and that the P(k,z) is slowly
     varying */

  dlnk = pfo->ln_k[pfo->k_size-1] - pfo->ln_k[pfo->k_size-2];

  class_call(fourier_pk_at_k_and_z(pba,
                                   ppm,
                                   pfo,
                                   pk_output,
                                   k/(1.+dlnk),
                                   z,
                                   index_pk,
                                   &out_pk1,
                                   NULL),
             pfo->error_message,
             pfo->error_message);

  class_call(fourier_pk_at_k_and_z(pba,
                                   ppm,
                                   pfo,
                                   pk_output,
                                   k*(1.+dlnk),
                                   z,
                                   index_pk,
                                   &out_pk2,
                                   NULL),
             pfo->error_message,
             pfo->error_message);

  /* logarithmic derivative: n_eff = (logPk2 - logPk1)/(logk2-logk1) */

  *pk_tilt = (log(out_pk2)-log(out_pk1))/(2.*log(1.+dlnk));

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movq %r9, %r14
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r13
movq 0x80(%rdx), %rax
movslq 0x6c(%rdx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm2
subsd -0x10(%rax,%rcx,8), %xmm2
addsd 0x4af91(%rip), %xmm2    # 0xe5260
movsd %xmm0, 0x18(%rsp)
movsd %xmm2, 0x10(%rsp)
divsd %xmm2, %xmm0
andq $0x0, (%rsp)
leaq 0x28(%rsp), %r9
movl %r15d, %ecx
movsd %xmm1, 0x8(%rsp)
callq 0x98e75
testl %eax, %eax
je 0x9a33a
addq $0x192, %rbx            # imm = 0x192
leaq 0x4b0e7(%rip), %rsi     # 0xe53f0
leaq 0x78e45(%rip), %rdx     # 0x113155
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4ad0b(%rip), %rsi     # 0xe5034
leaq 0x78e85(%rip), %rdx     # 0x1131b5
movq %rbx, %rdi
movl $0x425, %ecx            # imm = 0x425
jmp 0x9a3ab
movsd 0x18(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
andq $0x0, (%rsp)
leaq 0x20(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl %r15d, %ecx
movsd 0x8(%rsp), %xmm1
movl %ebp, %r8d
callq 0x98e75
testl %eax, %eax
je 0x9a3ca
addq $0x192, %rbx            # imm = 0x192
leaq 0x4b074(%rip), %rsi     # 0xe53f0
leaq 0x78e4d(%rip), %rdx     # 0x1131d0
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4ac98(%rip), %rsi     # 0xe5034
leaq 0x78e12(%rip), %rdx     # 0x1131b5
movq %rbx, %rdi
movl $0x431, %ecx            # imm = 0x431
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x20(%rsp), %xmm0
callq 0x82e0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x82e0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x82e0
addsd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%r14)
xorl %eax, %eax
jmp 0x9a3b8