// File: /workspace/github_c_makefile_star2_O2/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 $0x1048, %rsp           # imm = 0x1048
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, 0x20(%rsp)
movq 0x298(%rsi), %rax
movslq %r8d, %rcx
movq %rcx, 0x28(%rsp)
movsd (%rax,%rcx,8), %xmm0
callq 0x86a0
movsd %xmm0, 0x18(%rsp)
movslq 0x300(%rbx), %r14
movq %r14, %r13
shlq $0x3, %r13
movq %r13, %rdi
callq 0x8490
testq %rax, %rax
je 0x968c2
movq %rax, %r12
movq %r13, %rdi
callq 0x8490
testq %rax, %rax
je 0x96909
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 0x96833
cmpl $0x2, %eax
jne 0x96846
movslq 0x2d8(%rbx), %rax
movsd (%rbp,%rax,8), %xmm0
movsd %xmm0, (%r12,%rax,8)
movsd 0x18(%rsp), %xmm0
divsd 0x688(%r15), %xmm0
andl $0x0, 0x8(%rsp)
movl $0x1, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x953b4
testl %eax, %eax
je 0x9694d
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x4eb62(%rip), %rsi     # 0xe53f0
leaq 0x7a1a1(%rip), %rdx     # 0x110a36
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4e786(%rip), %rsi     # 0xe5034
leaq 0x7a15d(%rip), %rdx     # 0x110a12
movq %rbx, %rdi
movl $0x6bc, %ecx            # imm = 0x6BC
jmp 0x969af
leal (,%r14,8), %ecx
leaq 0x4e733(%rip), %rsi     # 0xe5004
leaq 0x51b06(%rip), %rdx     # 0xe83de
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x4e73f(%rip), %rsi     # 0xe5034
leaq 0x7a116(%rip), %rdx     # 0x110a12
movq %rbx, %rdi
movl $0x6a7, %ecx            # imm = 0x6A7
jmp 0x969af
leal (,%r14,8), %ecx
leaq 0x4e6ec(%rip), %rsi     # 0xe5004
leaq 0x76ffe(%rip), %rdx     # 0x10d91d
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x4e6f8(%rip), %rsi     # 0xe5034
leaq 0x7a0cf(%rip), %rdx     # 0x110a12
movq %rbx, %rdi
movl $0x6a8, %ecx            # imm = 0x6A8
jmp 0x969af
leaq 0x38(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %rbx, %rdi
movq %r15, %rsi
movsd 0x18(%rsp), %xmm0
movq %r12, %rdx
movq %r13, %rcx
callq 0x96b0b
testl %eax, %eax
je 0x969ce
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x4ea70(%rip), %rsi     # 0xe53f0
leaq 0x7a12b(%rip), %rdx     # 0x110ab2
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4e694(%rip), %rsi     # 0xe5034
leaq 0x7a06b(%rip), %rdx     # 0x110a12
movq %rbx, %rdi
movl $0x6c8, %ecx            # imm = 0x6C8
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x8430
movq %r13, %rdi
callq 0x8430
movsd 0x38(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x96a55
movsd 0x30(%rsp), %xmm2
ucomisd %xmm2, %xmm1
jae 0x96aad
movsd %xmm2, 0x18(%rsp)
callq 0x82e0
movq 0x2a0(%rbx), %rax
movq 0x20(%rsp), %r15
movslq 0x848(%r15), %rcx
movq (%rax,%rcx,8), %rax
movq 0x28(%rsp), %r14
movsd %xmm0, (%rax,%r14,8)
movsd 0x18(%rsp), %xmm0
callq 0x82e0
movq 0x2a0(%rbx), %rax
movslq 0x84c(%r15), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax,%r14,8)
xorl %eax, %eax
jmp 0x969bc
leaq 0x7a09b(%rip), %rsi     # 0x110af7
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x4e610(%rip), %rsi     # 0xe5082
leaq 0x7a09a(%rip), %rdx     # 0x110b13
leaq 0x840(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x4e598(%rip), %rsi     # 0xe5034
leaq 0x79f6f(%rip), %rdx     # 0x110a12
movq %rbx, %rdi
movl $0x6cf, %ecx            # imm = 0x6CF
jmp 0x96b03
leaq 0x7a06d(%rip), %rsi     # 0x110b21
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x4e5b8(%rip), %rsi     # 0xe5082
leaq 0x7a069(%rip), %rdx     # 0x110b3a
leaq 0x840(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x4e540(%rip), %rsi     # 0xe5034
leaq 0x79f17(%rip), %rdx     # 0x110a12
movq %rbx, %rdi
movl $0x6d3, %ecx            # imm = 0x6D3
movq %r15, %r8
jmp 0x969b2