// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x1088, %rsp           # imm = 0x1088
movq %rdi, 0x1078(%rsp)
movq %rsi, 0x1070(%rsp)
movq %rdx, 0x1068(%rsp)
movl %ecx, 0x1064(%rsp)
movsd %xmm0, 0x1058(%rsp)
movsd %xmm1, 0x1050(%rsp)
movl %r8d, 0x104c(%rsp)
movq %r9, 0x1040(%rsp)
movq 0x1068(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x1068(%rsp), %rcx
movl 0x6c(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x1068(%rsp), %rax
movq 0x80(%rax), %rax
movq 0x1068(%rsp), %rcx
movl 0x6c(%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1038(%rsp)
movq 0x1078(%rsp), %rdi
movq 0x1070(%rsp), %rsi
movq 0x1068(%rsp), %rdx
movl 0x1064(%rsp), %ecx
movsd 0x1058(%rsp), %xmm0
movsd 0xaaa7d(%rip), %xmm1    # 0x1d2248
addsd 0x1038(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd 0x1050(%rsp), %xmm1
movl 0x104c(%rsp), %r8d
leaq 0x1030(%rsp), %r9
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x125160
cmpl $0x1, %eax
jne 0x127872
leaq 0x820(%rsp), %rdi
movq 0x1068(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0xaabb5(%rip), %rsi     # 0x1d23d8
leaq 0xd8d6b(%rip), %rdx     # 0x200595
movb $0x0, %al
callq 0x5b9c0
movq 0x1068(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x820(%rsp), %r8
leaq 0xaa7e5(%rip), %rsi     # 0x1d2034
leaq 0xd8d9f(%rip), %rdx     # 0x2005f5
movl $0x425, %ecx            # imm = 0x425
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1084(%rsp)
jmp 0x1279bb
movq 0x1078(%rsp), %rdi
movq 0x1070(%rsp), %rsi
movq 0x1068(%rsp), %rdx
movl 0x1064(%rsp), %ecx
movsd 0x1058(%rsp), %xmm0
movsd 0xaa9a6(%rip), %xmm1    # 0x1d2248
addsd 0x1038(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x1050(%rsp), %xmm1
movl 0x104c(%rsp), %r8d
leaq 0x1028(%rsp), %r9
xorl %eax, %eax
movq $0x0, (%rsp)
callq 0x125160
cmpl $0x1, %eax
jne 0x127940
leaq 0x20(%rsp), %rdi
movq 0x1068(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0xaaae1(%rip), %rsi     # 0x1d23d8
leaq 0xd8d12(%rip), %rdx     # 0x200610
movb $0x0, %al
callq 0x5b9c0
movq 0x1068(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x20(%rsp), %r8
leaq 0xaa714(%rip), %rsi     # 0x1d2034
leaq 0xd8cce(%rip), %rdx     # 0x2005f5
movl $0x431, %ecx            # imm = 0x431
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1084(%rsp)
jmp 0x1279bb
movsd 0x1028(%rsp), %xmm0
callq 0x82f0
movsd %xmm0, 0x10(%rsp)
movsd 0x1030(%rsp), %xmm0
callq 0x82f0
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0xaa8cb(%rip), %xmm0    # 0x1d2248
addsd 0x1038(%rsp), %xmm0
callq 0x82f0
movaps %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
movsd 0xab2e4(%rip), %xmm1    # 0x1d2c80
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq 0x1040(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x1084(%rsp)
movl 0x1084(%rsp), %eax
addq $0x1088, %rsp           # imm = 0x1088
retq
nopw (%rax,%rax)