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

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

  /** 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];

  /** - evolve the background until the relevant initial time for
      integrating perturbations */
  class_call(primordial_inflation_evolve_background(ppm,
                                                    ppr,
                                                    y,
                                                    dy,
                                                    _aH_,
                                                    k/ppr->primordial_inflation_ratio_min,
                                                    _FALSE_,
                                                    forward,
                                                    conformal),
             ppm->error_message,
             ppm->error_message);

  /** - evolve the background/perturbation equations from this time and
      until some time after Horizon crossing */
  class_call(primordial_inflation_one_k(ppm,
                                        ppr,
                                        k,
                                        y,
                                        dy,
                                        &curvature,
                                        &tensors),
             ppm->error_message,
             ppm->error_message);

  free(y);
  free(dy);

  class_test(curvature<=0.,
             ppm->error_message,
             "negative curvature spectrum");

  class_test(tensors<=0.,
             ppm->error_message,
             "negative tensor spectrum");

  /** - 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);

  /* uncomment if you want to print here the spectra for testing */
  /* fprintf(stderr,"%e %e %e\n", */
  /* 	    ppm->lnk[index_k], */
  /* 	    ppm->lnpk[ppt->index_md_scalars][index_k], */
  /* 	    ppm->lnpk[ppt->index_md_tensors][index_k]); */

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
movq 0x298(%rsi), %rax
movslq %r8d, %rcx
movq %rcx, 0x18(%rsp)
movsd (%rax,%rcx,8), %xmm0
callq 0x8670
movsd %xmm0, 0x8(%rsp)
movslq 0x300(%rbx), %r14
movq %r14, %r13
shlq $0x3, %r13
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x9b66e
movq %rax, %r12
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x9b6b5
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 0x9b5e3
cmpl $0x2, %eax
jne 0x9b5f6
movslq 0x2d8(%rbx), %rax
movsd (%rbp,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
movsd 0x8(%rsp), %xmm0
divsd 0x688(%r15), %xmm0
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
je 0x9b6f9
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52db6(%rip), %rsi     # 0xee3f0
leaq 0x7e555(%rip), %rdx     # 0x119b96
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x529da(%rip), %rsi     # 0xee034
leaq 0x7e511(%rip), %rdx     # 0x119b72
movq %rbx, %rdi
movl $0x6bc, %ecx            # imm = 0x6BC
jmp 0x9b75b
leal (,%r14,8), %ecx
leaq 0x52987(%rip), %rsi     # 0xee004
leaq 0x55d9a(%rip), %rdx     # 0xf141e
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52993(%rip), %rsi     # 0xee034
leaq 0x7e4ca(%rip), %rdx     # 0x119b72
movq %rbx, %rdi
movl $0x6a7, %ecx            # imm = 0x6A7
jmp 0x9b75b
leal (,%r14,8), %ecx
leaq 0x52940(%rip), %rsi     # 0xee004
leaq 0x7b3b2(%rip), %rdx     # 0x116a7d
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x5294c(%rip), %rsi     # 0xee034
leaq 0x7e483(%rip), %rdx     # 0x119b72
movq %rbx, %rdi
movl $0x6a8, %ecx            # imm = 0x6A8
jmp 0x9b75b
leaq 0x28(%rsp), %r8
leaq 0x20(%rsp), %r9
movq %rbx, %rdi
movq %r15, %rsi
movsd 0x8(%rsp), %xmm0
movq %r12, %rdx
movq %r13, %rcx
callq 0x9b8b9
testl %eax, %eax
je 0x9b77c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52cc4(%rip), %rsi     # 0xee3f0
leaq 0x7e4df(%rip), %rdx     # 0x119c12
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x528e8(%rip), %rsi     # 0xee034
leaq 0x7e41f(%rip), %rdx     # 0x119b72
movq %rbx, %rdi
movl $0x6c8, %ecx            # imm = 0x6C8
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x8410
movq %r13, %rdi
callq 0x8410
movsd 0x28(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x9b803
movsd 0x20(%rsp), %xmm2
ucomisd %xmm2, %xmm1
jae 0x9b85b
movsd %xmm2, 0x8(%rsp)
callq 0x82c0
movq 0x2a0(%rbx), %rax
movq 0x10(%rsp), %r15
movslq 0x848(%r15), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rsp), %r14
movsd %xmm0, (%rax,%r14,8)
movsd 0x8(%rsp), %xmm0
callq 0x82c0
movq 0x2a0(%rbx), %rax
movslq 0x84c(%r15), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax,%r14,8)
xorl %eax, %eax
jmp 0x9b76a
leaq 0x7e44d(%rip), %rsi     # 0x119c57
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x52862(%rip), %rsi     # 0xee082
leaq 0x7e44c(%rip), %rdx     # 0x119c73
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x527ea(%rip), %rsi     # 0xee034
leaq 0x7e321(%rip), %rdx     # 0x119b72
movq %rbx, %rdi
movl $0x6cf, %ecx            # imm = 0x6CF
jmp 0x9b8b1
leaq 0x7e41f(%rip), %rsi     # 0x119c81
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x5280a(%rip), %rsi     # 0xee082
leaq 0x7e41b(%rip), %rdx     # 0x119c9a
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52792(%rip), %rsi     # 0xee034
leaq 0x7e2c9(%rip), %rdx     # 0x119b72
movq %rbx, %rdi
movl $0x6d3, %ecx            # imm = 0x6D3
movq %r15, %r8
jmp 0x9b75e