// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/fourier.c
// Function: fourier_get_k_list
int fourier_get_k_list(
                       struct precision *ppr,
                       struct primordial * ppm,
                       struct perturbations * ppt,
                       struct fourier * pfo
                       ) {

  double k=0;
  double k_max,exponent;
  int index_k;

  pfo->k_size = ppt->k_size[pfo->index_md_scalars];
  pfo->k_size_pk = ppt->k_size_pk;
  k_max = ppt->k[pfo->index_md_scalars][pfo->k_size-1];

  /** - if k extrapolation necessary, compute number of required extra values */
  if ((pfo->method == nl_HMcode) || (pfo->has_pk_numerical_nowiggle == _TRUE_)){
    index_k=0;
    while(k < ppr->hmcode_max_k_extra && index_k < _MAX_NUM_EXTRAPOLATION_){
      index_k++;
      k = k_max * pow(10,(double)index_k/ppr->k_per_decade_for_pk);
    }
    class_test(index_k == _MAX_NUM_EXTRAPOLATION_,
               pfo->error_message,
               "could not reach extrapolated value k = %.10e starting from k = %.10e with k_per_decade of %.10e in _MAX_NUM_INTERPOLATION_=%i steps",
               ppr->hmcode_max_k_extra,k_max,ppr->k_per_decade_for_pk,_MAX_NUM_EXTRAPOLATION_
               );

    pfo->k_size_extra = pfo->k_size+index_k;
  }
  /** - otherwise, same number of values as in perturbation module */
  else {
    pfo->k_size_extra = pfo->k_size;
  }

  /** - allocate array of k */
  class_alloc(pfo->k,   pfo->k_size_extra*sizeof(double),pfo->error_message);
  class_alloc(pfo->ln_k,pfo->k_size_extra*sizeof(double),pfo->error_message);

  /** - fill array of k (not extrapolated) */
  for (index_k=0; index_k<pfo->k_size; index_k++) {
    k = ppt->k[pfo->index_md_scalars][index_k];
    pfo->k[index_k] = k;
    pfo->ln_k[index_k] = log(k);
  }

  /** - fill additional values of k (extrapolated) */
  for (index_k=pfo->k_size; index_k<pfo->k_size_extra; index_k++) {
    exponent = (double)(index_k-(pfo->k_size-1))/ppr->k_per_decade_for_pk;
    pfo->k[index_k] = k * pow(10,exponent);
    pfo->ln_k[index_k] = log(k) + exponent*log(10.);
  }

  class_test(pfo->k[pfo->k_size_extra-1]>exp(ppm->lnk[ppm->lnk_size-1]) && ppm->primordial_spec_type != analytic_Pk,
             pfo->error_message,
             "Setting the output to HMcode with a large 'hmcode_max_k_extra' and using the primordial spectrum to not analytic is incompatible. Either use the analytic power spectrum or set a smaller 'hmcode_max_k_extra' (k_max_hmcode=%.5e , k_max_primordial=%.5e)",
             pfo->k[pfo->k_size_extra-1],
             exp(ppm->lnk[ppm->lnk_size-1])
             );

  return _SUCCESS_;
}

// Assembly:
subq $0x30a8, %rsp           # imm = 0x30A8
movq %rdi, 0x3098(%rsp)
movq %rsi, 0x3090(%rsp)
movq %rdx, 0x3088(%rsp)
movq %rcx, 0x3080(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x3078(%rsp)
movq 0x3088(%rsp), %rax
movq 0x9c8(%rax), %rax
movq 0x3080(%rsp), %rcx
movslq 0x3c(%rcx), %rcx
movl (%rax,%rcx,4), %ecx
movq 0x3080(%rsp), %rax
movl %ecx, 0x6c(%rax)
movq 0x3088(%rsp), %rax
movl 0x9c0(%rax), %ecx
movq 0x3080(%rsp), %rax
movl %ecx, 0x70(%rax)
movq 0x3088(%rsp), %rax
movq 0x9d0(%rax), %rax
movq 0x3080(%rsp), %rcx
movslq 0x3c(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x3080(%rsp), %rcx
movl 0x6c(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x3070(%rsp)
movq 0x3080(%rsp), %rax
cmpl $0x2, (%rax)
je 0x12e915
movq 0x3080(%rsp), %rax
movswl 0x3a(%rax), %eax
cmpl $0x1, %eax
jne 0x12ea9f
movl $0x0, 0x3064(%rsp)
movsd 0x3078(%rsp), %xmm1
movq 0x3098(%rsp), %rax
movsd 0x888(%rax), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, 0x3f(%rsp)
jbe 0x12e957
cmpl $0x186a0, 0x3064(%rsp) # imm = 0x186A0
setl %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x12e961
jmp 0x12e9c2
movl 0x3064(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3064(%rsp)
movsd 0x3070(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
cvtsi2sdl 0x3064(%rsp), %xmm1
movq 0x3098(%rsp), %rax
divsd 0x540(%rax), %xmm1
movsd 0xa3e3e(%rip), %xmm0    # 0x1d27e0
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x3078(%rsp)
jmp 0x12e920
cmpl $0x186a0, 0x3064(%rsp) # imm = 0x186A0
jne 0x12ea7d
leaq 0x2860(%rsp), %rdi
movq 0x3098(%rsp), %rax
movsd 0x888(%rax), %xmm0
movsd 0x3070(%rsp), %xmm1
movq 0x3098(%rsp), %rax
movsd 0x540(%rax), %xmm2
leaq 0xd33ed(%rip), %rsi     # 0x201df8
movl $0x186a0, %edx          # imm = 0x186A0
movb $0x3, %al
callq 0x5b9c0
leaq 0x2060(%rsp), %rdi
leaq 0x2860(%rsp), %rcx
leaq 0xa3654(%rip), %rsi     # 0x1d2082
leaq 0xd3447(%rip), %rdx     # 0x201e7c
movb $0x0, %al
callq 0x5b9c0
movq 0x3080(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x2060(%rsp), %r8
leaq 0xa35da(%rip), %rsi     # 0x1d2034
leaq 0xd343e(%rip), %rdx     # 0x201e9f
movl $0x873, %ecx            # imm = 0x873
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30a4(%rsp)
jmp 0x12ef6b
movq 0x3080(%rsp), %rax
movl 0x6c(%rax), %ecx
addl 0x3064(%rsp), %ecx
movq 0x3080(%rsp), %rax
movl %ecx, 0x104(%rax)
jmp 0x12eab8
movq 0x3080(%rsp), %rax
movl 0x6c(%rax), %ecx
movq 0x3080(%rsp), %rax
movl %ecx, 0x104(%rax)
movq 0x3080(%rsp), %rax
movslq 0x104(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, %rcx
movq 0x3080(%rsp), %rax
movq %rcx, 0x78(%rax)
movq 0x3080(%rsp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x12eb6d
movq 0x3080(%rsp), %rax
movslq 0x104(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x205c(%rsp)
leaq 0x1850(%rsp), %rdi
movl 0x205c(%rsp), %ecx
leaq 0xa34e6(%rip), %rsi     # 0x1d2004
leaq 0xd338d(%rip), %rdx     # 0x201eb2
movb $0x0, %al
callq 0x5b9c0
movq 0x3080(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1850(%rsp), %r8
leaq 0xa34ea(%rip), %rsi     # 0x1d2034
leaq 0xd334e(%rip), %rdx     # 0x201e9f
movl $0x87d, %ecx            # imm = 0x87D
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30a4(%rsp)
jmp 0x12ef6b
movq 0x3080(%rsp), %rax
movslq 0x104(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, %rcx
movq 0x3080(%rsp), %rax
movq %rcx, 0x80(%rax)
movq 0x3080(%rsp), %rax
cmpq $0x0, 0x80(%rax)
jne 0x12ec28
movq 0x3080(%rsp), %rax
movslq 0x104(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x184c(%rsp)
leaq 0x1040(%rsp), %rdi
movl 0x184c(%rsp), %ecx
leaq 0xa342b(%rip), %rsi     # 0x1d2004
leaq 0xd32d9(%rip), %rdx     # 0x201eb9
movb $0x0, %al
callq 0x5b9c0
movq 0x3080(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1040(%rsp), %r8
leaq 0xa342f(%rip), %rsi     # 0x1d2034
leaq 0xd3293(%rip), %rdx     # 0x201e9f
movl $0x87e, %ecx            # imm = 0x87E
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30a4(%rsp)
jmp 0x12ef6b
movl $0x0, 0x3064(%rsp)
movl 0x3064(%rsp), %eax
movq 0x3080(%rsp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x12ece2
movq 0x3088(%rsp), %rax
movq 0x9d0(%rax), %rax
movq 0x3080(%rsp), %rcx
movslq 0x3c(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x3064(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x3078(%rsp)
movsd 0x3078(%rsp), %xmm0
movq 0x3080(%rsp), %rax
movq 0x78(%rax), %rax
movslq 0x3064(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x3078(%rsp), %xmm0
callq 0x82f0
movq 0x3080(%rsp), %rax
movq 0x80(%rax), %rax
movslq 0x3064(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3064(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3064(%rsp)
jmp 0x12ec33
movq 0x3080(%rsp), %rax
movl 0x6c(%rax), %eax
movl %eax, 0x3064(%rsp)
movl 0x3064(%rsp), %eax
movq 0x3080(%rsp), %rcx
cmpl 0x104(%rcx), %eax
jge 0x12ee07
movl 0x3064(%rsp), %eax
movq 0x3080(%rsp), %rcx
movl 0x6c(%rcx), %ecx
subl $0x1, %ecx
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movq 0x3098(%rsp), %rax
divsd 0x540(%rax), %xmm0
movsd %xmm0, 0x3068(%rsp)
movsd 0x3078(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x3068(%rsp), %xmm1
movsd 0xa3a7d(%rip), %xmm0    # 0x1d27e0
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x3080(%rsp), %rax
movq 0x78(%rax), %rax
movslq 0x3064(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x3078(%rsp), %xmm0
callq 0x82f0
movsd %xmm0, 0x20(%rsp)
movsd 0x3068(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0xa3a27(%rip), %xmm0    # 0x1d27e0
callq 0x82f0
movsd 0x20(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x28(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x3080(%rsp), %rax
movq 0x80(%rax), %rax
movslq 0x3064(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3064(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3064(%rsp)
jmp 0x12ecf4
movq 0x3080(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x3080(%rsp), %rcx
movl 0x104(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x3090(%rsp), %rax
movq 0x298(%rax), %rax
movq 0x3090(%rsp), %rcx
movl 0x290(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x12ef60
movq 0x3090(%rsp), %rax
cmpl $0x0, 0x18(%rax)
je 0x12ef60
leaq 0x840(%rsp), %rax
movq %rax, (%rsp)
movq 0x3080(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x3080(%rsp), %rcx
movl 0x104(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x3090(%rsp), %rax
movq 0x298(%rax), %rax
movq 0x3090(%rsp), %rcx
movl 0x290(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x8670
movq (%rsp), %rdi
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
leaq 0xd2fc7(%rip), %rsi     # 0x201ec3
movb $0x2, %al
callq 0x5b9c0
leaq 0x40(%rsp), %rdi
leaq 0x840(%rsp), %rcx
leaq 0xa316b(%rip), %rsi     # 0x1d2082
leaq 0xd30a0(%rip), %rdx     # 0x201fbe
movb $0x0, %al
callq 0x5b9c0
movq 0x3080(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x40(%rsp), %r8
leaq 0xa30f4(%rip), %rsi     # 0x1d2034
leaq 0xd2f58(%rip), %rdx     # 0x201e9f
movl $0x893, %ecx            # imm = 0x893
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30a4(%rsp)
jmp 0x12ef6b
movl $0x0, 0x30a4(%rsp)
movl 0x30a4(%rsp), %eax
addq $0x30a8, %rsp           # imm = 0x30A8
retq
nopw (%rax,%rax)