// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/HMcode/hmcode.c
// Function: hmcode_wnw_split
int hmcode_wnw_split(
                      struct precision *ppr,
                      struct background *pba,
                      struct primordial * ppm,
                      struct fourier *pfo
                      ) {

  int index_pk, index_k, index_tau;
  int last_index=0;
  double ln_k;

  double * lnpk_l;
  double * ddlnpk_l;

  double * ln_k_nw;
  double * pk_nw;
  double * pk_w;

  double * lnpk_nw;
  double * ddlnpk_nw;


  /** - single index for which we want to compute and store the dewiggled spectrum (refers to _cb or _m) */

  index_pk = *(pfo->pk_l_nw_index);

  /** - fill the nowiggle array with the original linear spectrum.
      Later, we will overwrite with the de-wiggled values */

  memcpy(pfo->ln_pk_l_nw_extra, pfo->ln_pk_l_extra[index_pk],
         pfo->ln_tau_size * pfo->k_size_extra * sizeof(double));

  /** - allocate temporary arrays */

  class_alloc(lnpk_l,pfo->k_size_extra*sizeof(double),pfo->error_message);
  class_alloc(ddlnpk_l,pfo->k_size_extra*sizeof(double),pfo->error_message);

  class_alloc(ln_k_nw, pfo->nk_wiggle*sizeof(double), pfo->error_message);
  class_alloc(pk_nw, pfo->nk_wiggle*sizeof(double), pfo->error_message);
  class_alloc(pk_w, pfo->nk_wiggle*sizeof(double), pfo->error_message);

  class_alloc(lnpk_nw, pfo->nk_wiggle*sizeof(double), pfo->error_message);
  class_alloc(ddlnpk_nw, pfo->nk_wiggle*sizeof(double), pfo->error_message);

  /** - loop over times at which we are storing the power spectra */

  for (index_tau=0; index_tau<pfo->ln_tau_size; index_tau++){

    /** - create a temporary copy of ln(P_l) at this time */
    memcpy(lnpk_l, &(pfo->ln_pk_l_extra[index_pk][index_tau*pfo->k_size_extra]),
           pfo->k_size_extra * sizeof(double));

    /** - spline it with respect to k, needed for interpolation inside hmcode_nowiggle() */

    class_call(array_spline_table_columns(pfo->ln_k,
                                          pfo->k_size_extra,
                                          lnpk_l,
                                          1,
                                          ddlnpk_l,
                                          _SPLINE_NATURAL_,
                                          pfo->error_message),
               pfo->error_message,
               pfo->error_message);

    /* - compute P_nowiggle and P_wiggle (here the later is not used,
         only the former). These spectra are sampled over an array
         ln_k_nw determined by the function hmcode_nowiggle() */

    class_call(hmcode_nowiggle(pfo,
                               lnpk_l,
                               ddlnpk_l,
                               pfo->nk_wiggle,
                               ln_k_nw,
                               pk_nw,
                               pk_w),
               pfo->error_message,
               pfo->error_message);

    /* - compute ln(P_nowiggle) */

    for (index_k=0; index_k<pfo->nk_wiggle; index_k++) {
      lnpk_nw[index_k] = log(pk_nw[index_k]);
    }

    /** - spline ln(P_nowiggle) with respect to ln(k) */

    class_call(array_spline_table_columns(ln_k_nw,
                                          pfo->nk_wiggle,
                                          lnpk_nw,
                                          1,
                                          ddlnpk_nw,
                                          _SPLINE_NATURAL_,
                                          pfo->error_message),
               pfo->error_message,
               pfo->error_message);

    /** - interpolate ln(P_nowiggle) at the ln(k) values
          used in the fourier structure */

    for (index_k=0; index_k<pfo->k_size_extra; index_k++) {

      ln_k = pfo->ln_k[index_k];

      if ((ln_k>ln_k_nw[0]) && (ln_k<ln_k_nw[pfo->nk_wiggle-1])) {

        class_call(array_interpolate_spline(ln_k_nw,
                                            pfo->nk_wiggle,
                                            lnpk_nw,
                                            ddlnpk_nw,
                                            1,
                                            ln_k,
                                            &last_index,
                                            &(pfo->ln_pk_l_nw_extra[index_tau * pfo->k_size_extra + index_k]),
                                            1,
                                            pfo->error_message),
                   pfo->error_message,
                   pfo->error_message);
      }
    }
  }

  /** - free temporary arrays */

  free(lnpk_l);
  free(ddlnpk_l);

  free(ln_k_nw);
  free(pk_nw);
  free(pk_w);

  free(lnpk_nw);
  free(ddlnpk_nw);

  return _SUCCESS_;
}

// Assembly:
subq $0x5908, %rsp           # imm = 0x5908
movq %rdi, 0x58f8(%rsp)
movq %rsi, 0x58f0(%rsp)
movq %rdx, 0x58e8(%rsp)
movq %rcx, 0x58e0(%rsp)
movl $0x0, 0x58d0(%rsp)
movq 0x58e0(%rsp), %rax
movq 0x128(%rax), %rax
movl (%rax), %eax
movl %eax, 0x58dc(%rsp)
movq 0x58e0(%rsp), %rax
movq 0x130(%rax), %rdi
movq 0x58e0(%rsp), %rax
movq 0x108(%rax), %rax
movslq 0x58dc(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq 0x58e0(%rsp), %rax
movl 0x90(%rax), %eax
movq 0x58e0(%rsp), %rcx
imull 0x104(%rcx), %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x8300
movq 0x58e0(%rsp), %rax
movslq 0x104(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x58c0(%rsp)
cmpq $0x0, 0x58c0(%rsp)
jne 0x1c0af7
movq 0x58e0(%rsp), %rax
movslq 0x104(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x588c(%rsp)
leaq 0x5080(%rsp), %rdi
movl 0x588c(%rsp), %ecx
leaq 0x1155c(%rip), %rsi     # 0x1d2004
leaq 0x40892(%rip), %rdx     # 0x201341
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x5080(%rsp), %r8
leaq 0x11560(%rip), %rsi     # 0x1d2034
leaq 0x51546(%rip), %rdx     # 0x212021
movl $0x7c6, %ecx            # imm = 0x7C6
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movq 0x58e0(%rsp), %rax
movslq 0x104(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x58b8(%rsp)
cmpq $0x0, 0x58b8(%rsp)
jne 0x1c0ba1
movq 0x58e0(%rsp), %rax
movslq 0x104(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x507c(%rsp)
leaq 0x4870(%rsp), %rdi
movl 0x507c(%rsp), %ecx
leaq 0x114b2(%rip), %rsi     # 0x1d2004
leaq 0x407e6(%rip), %rdx     # 0x20133f
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x4870(%rsp), %r8
leaq 0x114b6(%rip), %rsi     # 0x1d2034
leaq 0x5149c(%rip), %rdx     # 0x212021
movl $0x7c7, %ecx            # imm = 0x7C7
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x58b0(%rsp)
cmpq $0x0, 0x58b0(%rsp)
jne 0x1c0c45
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x486c(%rsp)
leaq 0x4060(%rsp), %rdi
movl 0x486c(%rsp), %ecx
leaq 0x1140e(%rip), %rsi     # 0x1d2004
leaq 0x51435(%rip), %rdx     # 0x212032
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x4060(%rsp), %r8
leaq 0x11412(%rip), %rsi     # 0x1d2034
leaq 0x513f8(%rip), %rdx     # 0x212021
movl $0x7c9, %ecx            # imm = 0x7C9
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x58a8(%rsp)
cmpq $0x0, 0x58a8(%rsp)
jne 0x1c0ce9
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x405c(%rsp)
leaq 0x3850(%rsp), %rdi
movl 0x405c(%rsp), %ecx
leaq 0x1136a(%rip), %rsi     # 0x1d2004
leaq 0x513a2(%rip), %rdx     # 0x212043
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x3850(%rsp), %r8
leaq 0x1136e(%rip), %rsi     # 0x1d2034
leaq 0x51354(%rip), %rdx     # 0x212021
movl $0x7ca, %ecx            # imm = 0x7CA
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x58a0(%rsp)
cmpq $0x0, 0x58a0(%rsp)
jne 0x1c0d8d
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x384c(%rsp)
leaq 0x3040(%rsp), %rdi
movl 0x384c(%rsp), %ecx
leaq 0x112c6(%rip), %rsi     # 0x1d2004
leaq 0x512f5(%rip), %rdx     # 0x21203a
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x3040(%rsp), %r8
leaq 0x112ca(%rip), %rsi     # 0x1d2034
leaq 0x512b0(%rip), %rdx     # 0x212021
movl $0x7cb, %ecx            # imm = 0x7CB
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x5898(%rsp)
cmpq $0x0, 0x5898(%rsp)
jne 0x1c0e31
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x303c(%rsp)
leaq 0x2830(%rsp), %rdi
movl 0x303c(%rsp), %ecx
leaq 0x11222(%rip), %rsi     # 0x1d2004
leaq 0x51258(%rip), %rdx     # 0x212041
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x2830(%rsp), %r8
leaq 0x11226(%rip), %rsi     # 0x1d2034
leaq 0x5120c(%rip), %rdx     # 0x212021
movl $0x7cd, %ecx            # imm = 0x7CD
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x5890(%rsp)
cmpq $0x0, 0x5890(%rsp)
jne 0x1c0ed5
movq 0x58e0(%rsp), %rax
movslq 0x2c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x282c(%rsp)
leaq 0x2020(%rsp), %rdi
movl 0x282c(%rsp), %ecx
leaq 0x1117e(%rip), %rsi     # 0x1d2004
leaq 0x511b2(%rip), %rdx     # 0x21203f
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x2020(%rsp), %r8
leaq 0x11182(%rip), %rsi     # 0x1d2034
leaq 0x51168(%rip), %rdx     # 0x212021
movl $0x7ce, %ecx            # imm = 0x7CE
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movl $0x0, 0x58d4(%rsp)
movl 0x58d4(%rsp), %eax
movq 0x58e0(%rsp), %rcx
cmpl 0x90(%rcx), %eax
jge 0x1c13a7
movq 0x58c0(%rsp), %rdi
movq 0x58e0(%rsp), %rax
movq 0x108(%rax), %rax
movslq 0x58dc(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movl 0x58d4(%rsp), %eax
movq 0x58e0(%rsp), %rcx
imull 0x104(%rcx), %eax
cltq
shlq $0x3, %rax
addq %rax, %rsi
movq 0x58e0(%rsp), %rax
movslq 0x104(%rax), %rdx
shlq $0x3, %rdx
callq 0x8300
movq 0x58e0(%rsp), %rax
movq 0x80(%rax), %rdi
movq 0x58e0(%rsp), %rax
movl 0x104(%rax), %esi
movq 0x58c0(%rsp), %rdx
movq 0x58b8(%rsp), %r8
movq 0x58e0(%rsp), %rax
addq $0x192, %rax            # imm = 0x192
movl $0x1, %ecx
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x1f4b0
cmpl $0x1, %eax
jne 0x1c1013
leaq 0x1820(%rsp), %rdi
movq 0x58e0(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x11414(%rip), %rsi     # 0x1d23d8
leaq 0x5107e(%rip), %rdx     # 0x212049
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1820(%rsp), %r8
leaq 0x11044(%rip), %rsi     # 0x1d2034
leaq 0x5102a(%rip), %rdx     # 0x212021
movl $0x7e2, %ecx            # imm = 0x7E2
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movq 0x58e0(%rsp), %rdi
movq 0x58c0(%rsp), %rsi
movq 0x58b8(%rsp), %rdx
movq 0x58e0(%rsp), %rax
movl 0x2c(%rax), %ecx
movq 0x58b0(%rsp), %r8
movq 0x58a8(%rsp), %r9
movq 0x58a0(%rsp), %rax
movq %rax, (%rsp)
callq 0x1c02a0
cmpl $0x1, %eax
jne 0x1c10c9
leaq 0x1020(%rsp), %rdi
movq 0x58e0(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x1135e(%rip), %rsi     # 0x1d23d8
leaq 0x5102d(%rip), %rdx     # 0x2120ae
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1020(%rsp), %r8
leaq 0x10f8e(%rip), %rsi     # 0x1d2034
leaq 0x50f74(%rip), %rdx     # 0x212021
movl $0x7f0, %ecx            # imm = 0x7F0
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movl $0x0, 0x58d8(%rsp)
movl 0x58d8(%rsp), %eax
movq 0x58e0(%rsp), %rcx
cmpl 0x2c(%rcx), %eax
jge 0x1c112a
movq 0x58a8(%rsp), %rax
movslq 0x58d8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x82f0
movq 0x5898(%rsp), %rax
movslq 0x58d8(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x58d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58d8(%rsp)
jmp 0x1c10d4
movq 0x58b0(%rsp), %rdi
movq 0x58e0(%rsp), %rax
movl 0x2c(%rax), %esi
movq 0x5898(%rsp), %rdx
movq 0x5890(%rsp), %r8
movq 0x58e0(%rsp), %rax
addq $0x192, %rax            # imm = 0x192
movl $0x1, %ecx
xorl %r9d, %r9d
movq %rax, (%rsp)
callq 0x1f4b0
cmpl $0x1, %eax
jne 0x1c11de
leaq 0x820(%rsp), %rdi
movq 0x58e0(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x11249(%rip), %rsi     # 0x1d23d8
leaq 0x50f65(%rip), %rdx     # 0x2120fb
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x820(%rsp), %r8
leaq 0x10e79(%rip), %rsi     # 0x1d2034
leaq 0x50e5f(%rip), %rdx     # 0x212021
movl $0x802, %ecx            # imm = 0x802
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
movl $0x0, 0x58d8(%rsp)
movl 0x58d8(%rsp), %eax
movq 0x58e0(%rsp), %rcx
cmpl 0x104(%rcx), %eax
jge 0x1c138f
movq 0x58e0(%rsp), %rax
movq 0x80(%rax), %rax
movslq 0x58d8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x58c8(%rsp)
movsd 0x58c8(%rsp), %xmm0
movq 0x58b0(%rsp), %rax
ucomisd (%rax), %xmm0
jbe 0x1c1377
movsd 0x58c8(%rsp), %xmm1
movq 0x58b0(%rsp), %rax
movq 0x58e0(%rsp), %rcx
movl 0x2c(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1c1377
movq 0x58b0(%rsp), %rdi
movq 0x58e0(%rsp), %rax
movl 0x2c(%rax), %esi
movq 0x5898(%rsp), %rdx
movq 0x5890(%rsp), %rcx
movsd 0x58c8(%rsp), %xmm0
movq 0x58e0(%rsp), %rax
movq 0x130(%rax), %r10
movl 0x58d4(%rsp), %eax
movq 0x58e0(%rsp), %r8
imull 0x104(%r8), %eax
addl 0x58d8(%rsp), %eax
cltq
shlq $0x3, %rax
addq %rax, %r10
movq 0x58e0(%rsp), %rax
addq $0x192, %rax            # imm = 0x192
movl $0x1, %r8d
leaq 0x58d0(%rsp), %r9
movq %r10, (%rsp)
movl $0x1, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x24220
cmpl $0x1, %eax
jne 0x1c1375
leaq 0x20(%rsp), %rdi
movq 0x58e0(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x110af(%rip), %rsi     # 0x1d23d8
leaq 0x50e2d(%rip), %rdx     # 0x21215d
movb $0x0, %al
callq 0x5b9c0
movq 0x58e0(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x20(%rsp), %r8
leaq 0x10ce2(%rip), %rsi     # 0x1d2034
leaq 0x50cc8(%rip), %rdx     # 0x212021
movl $0x818, %ecx            # imm = 0x818
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5904(%rsp)
jmp 0x1c140d
jmp 0x1c1377
jmp 0x1c1379
movl 0x58d8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58d8(%rsp)
jmp 0x1c11e9
jmp 0x1c1391
movl 0x58d4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58d4(%rsp)
jmp 0x1c0ee0
movq 0x58c0(%rsp), %rdi
callq 0x8420
movq 0x58b8(%rsp), %rdi
callq 0x8420
movq 0x58b0(%rsp), %rdi
callq 0x8420
movq 0x58a8(%rsp), %rdi
callq 0x8420
movq 0x58a0(%rsp), %rdi
callq 0x8420
movq 0x5898(%rsp), %rdi
callq 0x8420
movq 0x5890(%rsp), %rdi
callq 0x8420
movl $0x0, 0x5904(%rsp)
movl 0x5904(%rsp), %eax
addq $0x5908, %rsp           # imm = 0x5908
retq
nopl (%rax)