// File: /workspace/github_c_makefile_star2_O1/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 0x9e4c1
movq %rax, %r12
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0x9e508
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 0x9e436
cmpl $0x2, %eax
jne 0x9e449
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 0x9cf0c
addq $0x10, %rsp
testl %eax, %eax
je 0x9e54c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52f63(%rip), %rsi     # 0xf13f0
leaq 0x7e6c2(%rip), %rdx     # 0x11cb56
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x52b87(%rip), %rsi     # 0xf1034
leaq 0x7e67e(%rip), %rdx     # 0x11cb32
movq %rbx, %rdi
movl $0x6bc, %ecx            # imm = 0x6BC
jmp 0x9e5ae
leal (,%r14,8), %ecx
leaq 0x52b34(%rip), %rsi     # 0xf1004
leaq 0x55f37(%rip), %rdx     # 0xf440e
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52b40(%rip), %rsi     # 0xf1034
leaq 0x7e637(%rip), %rdx     # 0x11cb32
movq %rbx, %rdi
movl $0x6a7, %ecx            # imm = 0x6A7
jmp 0x9e5ae
leal (,%r14,8), %ecx
leaq 0x52aed(%rip), %rsi     # 0xf1004
leaq 0x7b51f(%rip), %rdx     # 0x119a3d
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52af9(%rip), %rsi     # 0xf1034
leaq 0x7e5f0(%rip), %rdx     # 0x11cb32
movq %rbx, %rdi
movl $0x6a8, %ecx            # imm = 0x6A8
jmp 0x9e5ae
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 0x9e70c
testl %eax, %eax
je 0x9e5cf
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52e71(%rip), %rsi     # 0xf13f0
leaq 0x7e64c(%rip), %rdx     # 0x11cbd2
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x52a95(%rip), %rsi     # 0xf1034
leaq 0x7e58c(%rip), %rdx     # 0x11cb32
movq %rbx, %rdi
movl $0x6c8, %ecx            # imm = 0x6C8
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
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 0x9e656
movsd 0x20(%rsp), %xmm2
ucomisd %xmm2, %xmm1
jae 0x9e6ae
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 0x9e5bd
leaq 0x7e5ba(%rip), %rsi     # 0x11cc17
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x52a0f(%rip), %rsi     # 0xf1082
leaq 0x7e5b9(%rip), %rdx     # 0x11cc33
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x52997(%rip), %rsi     # 0xf1034
leaq 0x7e48e(%rip), %rdx     # 0x11cb32
movq %rbx, %rdi
movl $0x6cf, %ecx            # imm = 0x6CF
jmp 0x9e704
leaq 0x7e58c(%rip), %rsi     # 0x11cc41
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x529b7(%rip), %rsi     # 0xf1082
leaq 0x7e588(%rip), %rdx     # 0x11cc5a
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x5293f(%rip), %rsi     # 0xf1034
leaq 0x7e436(%rip), %rdx     # 0x11cb32
movq %rbx, %rdi
movl $0x6d3, %ecx            # imm = 0x6D3
movq %r15, %r8
jmp 0x9e5b1