// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/primordial.c
// Function: primordial_inflation_analytic_spectra
int primordial_inflation_analytic_spectra(
                                          struct perturbations * ppt,
                                          struct primordial * ppm,
                                          struct precision * ppr,
                                          double * y_ini
                                          ) {
  double * y;
  double * dy;
  int index_k;
  double k,phi_k;
  double curvature,tensors;
  double V,dV,ddV;

  /** Summary */
  /** - allocate vectors for background/perturbed quantities */
  class_alloc(y,ppm->in_size*sizeof(double),ppm->error_message);
  class_alloc(dy,ppm->in_size*sizeof(double),ppm->error_message);

  /** - initialize the background part of the running vector */
  y[ppm->index_in_a] = y_ini[ppm->index_in_a];
  y[ppm->index_in_phi] = y_ini[ppm->index_in_phi];
  if ((ppm->primordial_spec_type == inflation_V) || (ppm->primordial_spec_type == inflation_V_end))
    y[ppm->index_in_dphi] = y_ini[ppm->index_in_dphi];

  /** - loop over Fourier wavenumbers */
  for (index_k=0; index_k < ppm->lnk_size; index_k++) {

    k = exp(ppm->lnk[index_k]);

    /* evolve background until k=aH is reached */
    class_call(primordial_inflation_evolve_background(ppm,
                                                      ppr,
                                                      y,
                                                      dy,
                                                      _aH_,
                                                      k,
                                                      _FALSE_,
                                                      forward,
                                                      conformal),
               ppm->error_message,
               ppm->error_message);

    /** - read value of phi at time when k=aH */
    phi_k = y[ppm->index_in_phi];

    /** - get potential (and its derivatives) at this value */
    class_call(primordial_inflation_check_potential(ppm,phi_k,&V,&dV,&ddV),
               ppm->error_message,
               ppm->error_message);

    /** - calculate the analytic slow-roll formula for the spectra */
    curvature = 128.*_PI_/3.*pow(V,3)/pow(dV,2);
    tensors = pow(dV/V,2)/_PI_*128.*_PI_/3.*pow(V,3)/pow(dV,2);

    /** - store the obtained result for curvature and tensor perturbations */
    ppm->lnpk[ppt->index_md_scalars][index_k] = log(curvature);
    ppm->lnpk[ppt->index_md_tensors][index_k] = log(tensors);
  }

  ppm->is_non_zero[ppt->index_md_scalars][ppt->index_ic_ad] = _TRUE_;
  ppm->is_non_zero[ppt->index_md_tensors][ppt->index_ic_ten] = _TRUE_;

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x848, %rsp            # imm = 0x848
movq %rcx, %rbp
movq %rdx, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x300(%rsi), %r15
movq %r15, %r13
shlq $0x3, %r13
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x9e112
movq %rax, %r12
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x9e159
movq %rax, %r13
movslq 0x2d0(%rbx), %rax
movsd (%rbp,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
movslq 0x2d4(%rbx), %rax
movsd (%rbp,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
movl 0x18(%rbx), %eax
cmpl $0x4, %eax
je 0x9df64
cmpl $0x2, %eax
jne 0x9df77
movslq 0x2d8(%rbx), %rax
movsd (%rbp,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
cmpl $0x0, 0x290(%rbx)
movq 0x8(%rsp), %r15
jle 0x9e0d4
xorl %ebp, %ebp
movq 0x298(%rbx), %rax
movsd (%rax,%rbp,8), %xmm0
callq 0x8670
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x1
callq 0x9cf0c
addq $0x10, %rsp
testl %eax, %eax
jne 0x9e19d
movslq 0x2d4(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0x9e23a
testl %eax, %eax
jne 0x9e1dc
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x5467d(%rip), %xmm1    # 0xf2680
callq 0x8620
mulsd 0x7d468(%rip), %xmm0    # 0x11b478
movsd 0x28(%rsp), %xmm2
movapd %xmm2, %xmm1
mulsd %xmm2, %xmm1
movsd %xmm1, (%rsp)
divsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm3
divsd %xmm3, %xmm2
mulsd %xmm2, %xmm2
movsd 0x55f85(%rip), %xmm0    # 0xf3fc8
divsd %xmm0, %xmm2
mulsd 0x7d431(%rip), %xmm2    # 0x11b480
mulsd %xmm0, %xmm2
movsd 0x54625(%rip), %xmm1    # 0xf2680
divsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rsp)
movapd %xmm3, %xmm0
callq 0x8620
mulsd 0x10(%rsp), %xmm0
divsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x82c0
movq 0x2a0(%rbx), %rax
movslq 0x848(%r14), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax,%rbp,8)
movsd (%rsp), %xmm0
callq 0x82c0
movq 0x2a0(%rbx), %rax
movslq 0x84c(%r14), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax,%rbp,8)
incq %rbp
movslq 0x290(%rbx), %rax
cmpq %rax, %rbp
jl 0x9df8b
movq 0x2b0(%rbx), %rax
movslq 0x848(%r14), %rcx
movq (%rax,%rcx,8), %rcx
movslq 0x858(%r14), %rdx
movw $0x1, %si
movw %si, (%rcx,%rdx,2)
movslq 0x84c(%r14), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x86c(%r14), %rcx
movw %si, (%rax,%rcx,2)
xorl %eax, %eax
jmp 0x9e228
leal (,%r15,8), %ecx
leaq 0x52ee3(%rip), %rsi     # 0xf1004
leaq 0x562e6(%rip), %rdx     # 0xf440e
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52eef(%rip), %rsi     # 0xf1034
leaq 0x7e92c(%rip), %rdx     # 0x11ca78
movq %rbx, %rdi
movl $0x62e, %ecx            # imm = 0x62E
jmp 0x9e219
leal (,%r15,8), %ecx
leaq 0x52e9c(%rip), %rsi     # 0xf1004
leaq 0x7b8ce(%rip), %rdx     # 0x119a3d
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52ea8(%rip), %rsi     # 0xf1034
leaq 0x7e8e5(%rip), %rdx     # 0x11ca78
movq %rbx, %rdi
movl $0x62f, %ecx            # imm = 0x62F
jmp 0x9e219
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53245(%rip), %rsi     # 0xf13f0
leaq 0x7e8ec(%rip), %rdx     # 0x11ca9e
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x52e69(%rip), %rsi     # 0xf1034
leaq 0x7e8a6(%rip), %rdx     # 0x11ca78
movq %rbx, %rdi
movl $0x647, %ecx            # imm = 0x647
jmp 0x9e219
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53206(%rip), %rsi     # 0xf13f0
leaq 0x7e905(%rip), %rdx     # 0x11caf6
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x52e2a(%rip), %rsi     # 0xf1034
leaq 0x7e867(%rip), %rdx     # 0x11ca78
movq %rbx, %rdi
movl $0x64f, %ecx            # imm = 0x64F
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x848, %rsp            # imm = 0x848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq