// File: /workspace/github_c_makefile_star2_O3/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 0x4efe6(%rip), %xmm2    # 0xee260
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 0x9dd77
testl %eax, %eax
je 0x9f2e8
addq $0x192, %rbx            # imm = 0x192
leaq 0x4f139(%rip), %rsi     # 0xee3f0
leaq 0x7cff7(%rip), %rdx     # 0x11c2b5
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x4ed5d(%rip), %rsi     # 0xee034
leaq 0x7d037(%rip), %rdx     # 0x11c315
movq %rbx, %rdi
movl $0x425, %ecx            # imm = 0x425
jmp 0x9f35c
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 0x9dd77
testl %eax, %eax
je 0x9f37d
addq $0x192, %rbx            # imm = 0x192
leaq 0x4f0c3(%rip), %rsi     # 0xee3f0
leaq 0x7cffc(%rip), %rdx     # 0x11c330
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x4ece7(%rip), %rsi     # 0xee034
leaq 0x7cfc1(%rip), %rdx     # 0x11c315
movq %rbx, %rdi
movl $0x431, %ecx            # imm = 0x431
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
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 0x9f36b