// File: /workspace/github_c_makefile_star2_O1/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 0x4f114(%rip), %xmm2    # 0xf1260
movsd %xmm0, 0x18(%rsp)
movsd %xmm2, 0x10(%rsp)
divsd %xmm2, %xmm0
movq $0x0, (%rsp)
leaq 0x28(%rsp), %r9
movl %r15d, %ecx
movsd %xmm1, 0x8(%rsp)
callq 0xa0c63
testl %eax, %eax
je 0xa21ba
addq $0x192, %rbx            # imm = 0x192
leaq 0x4f267(%rip), %rsi     # 0xf13f0
leaq 0x7d0e5(%rip), %rdx     # 0x11f275
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x4ee8b(%rip), %rsi     # 0xf1034
leaq 0x7d125(%rip), %rdx     # 0x11f2d5
movq %rbx, %rdi
movl $0x425, %ecx            # imm = 0x425
jmp 0xa222e
movsd 0x18(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movq $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 0xa0c63
testl %eax, %eax
je 0xa224f
addq $0x192, %rbx            # imm = 0x192
leaq 0x4f1f1(%rip), %rsi     # 0xf13f0
leaq 0x7d0ea(%rip), %rdx     # 0x11f2f0
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x4ee15(%rip), %rsi     # 0xf1034
leaq 0x7d0af(%rip), %rdx     # 0x11f2d5
movq %rbx, %rdi
movl $0x431, %ecx            # imm = 0x431
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
movsd 0x20(%rsp), %xmm0
callq 0x82c0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x82c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x82c0
addsd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%r14)
xorl %eax, %eax
jmp 0xa223d