// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/primordial.c
// Function: primordial_analytic_spectrum
int primordial_analytic_spectrum(
                                 struct primordial * ppm,
                                 int index_md,
                                 int index_ic1_ic2,
                                 double k,
                                 double * pk
                                 ) {


  if (ppm->is_non_zero[index_md][index_ic1_ic2] == _TRUE_) {
    // printf("in primordial_spec_init %d %d\n",ppm->is_primordial_Pk_different,ppm->calling_from_pk);
    if(ppm->is_primordial_Pk_different == _TRUE_ && ppm->calling_from_pk == _TRUE_){
      *pk = ppm->A_s_pk
        *exp((ppm->ns_pk-1.)*log(k/ppm->k_pivot)
             + 0.5 * ppm->running_pk * pow(log(k/ppm->k_pivot), 2.));
    }else{
    *pk = ppm->amplitude[index_md][index_ic1_ic2]
      *exp((ppm->tilt[index_md][index_ic1_ic2]-1.)*log(k/ppm->k_pivot)
           + 0.5 * ppm->running[index_md][index_ic1_ic2] * pow(log(k/ppm->k_pivot), 2.));
    }
  }
  else {
    *pk = 0.;
  }

  return _SUCCESS_;

}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movl %edx, 0x58(%rsp)
movsd %xmm0, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq 0x2b0(%rax), %rax
movslq 0x5c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x58(%rsp), %rcx
movswl (%rax,%rcx,2), %eax
cmpl $0x1, %eax
jne 0x111ce2
movq 0x60(%rsp), %rax
movswl 0xb2a(%rax), %eax
cmpl $0x1, %eax
jne 0x111be6
movq 0x60(%rsp), %rax
movswl 0xb2c(%rax), %eax
cmpl $0x1, %eax
jne 0x111be6
movq 0x60(%rsp), %rax
movsd 0xb30(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x60(%rsp), %rax
movsd 0xb38(%rax), %xmm0
movsd 0xc0703(%rip), %xmm1    # 0x1d2248
subsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rax
divsd (%rax), %xmm0
callq 0x82f0
movsd %xmm0, 0x30(%rsp)
movq 0x60(%rsp), %rax
movsd 0xc1112(%rip), %xmm0    # 0x1d2c88
mulsd 0xb40(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rax
divsd (%rax), %xmm0
callq 0x82f0
movsd 0xc10e0(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movsd 0x28(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x38(%rsp), %xmm0
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x48(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x111ce0
movq 0x60(%rsp), %rax
movq 0x2b8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x58(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x60(%rsp), %rax
movq 0x2c0(%rax), %rax
movslq 0x5c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x58(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0xc0616(%rip), %xmm1    # 0x1d2248
subsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rax
divsd (%rax), %xmm0
callq 0x82f0
movsd %xmm0, 0x10(%rsp)
movq 0x60(%rsp), %rax
movq 0x2c8(%rax), %rax
movslq 0x5c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x58(%rsp), %rcx
movsd 0xc1010(%rip), %xmm0    # 0x1d2c88
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x50(%rsp), %xmm0
movq 0x60(%rsp), %rax
divsd (%rax), %xmm0
callq 0x82f0
movsd 0xc0fe1(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x18(%rsp), %xmm0
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x48(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x111cee
movq 0x48(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
xorl %eax, %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)