// File: /workspace/github_c_makefile_star2_O3/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 0x9b27e
movq %rax, %r12
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x9b2c5
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 0x9b109
cmpl $0x2, %eax
jne 0x9b11c
movslq 0x2d8(%rbx), %rax
movsd (%rbp,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
cmpl $0x0, 0x290(%rbx)
movq 0x8(%rsp), %r15
jle 0x9b30c
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 0x9a126
addq $0x10, %rsp
testl %eax, %eax
jne 0x9b34a
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 0x9b3e7
testl %eax, %eax
jne 0x9b389
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x544d8(%rip), %xmm1    # 0xef680
callq 0x8620
mulsd 0x7d303(%rip), %xmm0    # 0x1184b8
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 0x55df0(%rip), %xmm0    # 0xf0fd8
divsd %xmm0, %xmm2
mulsd 0x7d2cc(%rip), %xmm2    # 0x1184c0
mulsd %xmm0, %xmm2
movsd 0x54480(%rip), %xmm1    # 0xef680
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), %rcx
movslq 0x84c(%r14), %rax
movq (%rcx,%rax,8), %rcx
movsd %xmm0, (%rcx,%rbp,8)
incq %rbp
movslq 0x290(%rbx), %rcx
cmpq %rcx, %rbp
jl 0x9b130
jmp 0x9b313
leal (,%r15,8), %ecx
leaq 0x52d77(%rip), %rsi     # 0xee004
leaq 0x5618a(%rip), %rdx     # 0xf141e
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52d83(%rip), %rsi     # 0xee034
leaq 0x7e800(%rip), %rdx     # 0x119ab8
movq %rbx, %rdi
movl $0x62e, %ecx            # imm = 0x62E
jmp 0x9b3c6
leal (,%r15,8), %ecx
leaq 0x52d30(%rip), %rsi     # 0xee004
leaq 0x7b7a2(%rip), %rdx     # 0x116a7d
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52d3c(%rip), %rsi     # 0xee034
leaq 0x7e7b9(%rip), %rdx     # 0x119ab8
movq %rbx, %rdi
movl $0x62f, %ecx            # imm = 0x62F
jmp 0x9b3c6
movslq 0x84c(%r14), %rax
movq 0x2b0(%rbx), %rcx
movslq 0x848(%r14), %rdx
movq (%rcx,%rdx,8), %rdx
movslq 0x858(%r14), %rsi
movw $0x1, %di
movw %di, (%rdx,%rsi,2)
movq (%rcx,%rax,8), %rax
movslq 0x86c(%r14), %rcx
movw %di, (%rax,%rcx,2)
xorl %eax, %eax
jmp 0x9b3d5
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53098(%rip), %rsi     # 0xee3f0
leaq 0x7e77f(%rip), %rdx     # 0x119ade
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x52cbc(%rip), %rsi     # 0xee034
leaq 0x7e739(%rip), %rdx     # 0x119ab8
movq %rbx, %rdi
movl $0x647, %ecx            # imm = 0x647
jmp 0x9b3c6
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x53059(%rip), %rsi     # 0xee3f0
leaq 0x7e798(%rip), %rdx     # 0x119b36
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x52c7d(%rip), %rsi     # 0xee034
leaq 0x7e6fa(%rip), %rdx     # 0x119ab8
movq %rbx, %rdi
movl $0x64f, %ecx            # imm = 0x64F
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x848, %rsp            # imm = 0x848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq