// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/fourier.c
// Function: fourier_pk_at_k_and_z
int fourier_pk_at_k_and_z(
                          struct background * pba,
                          struct primordial * ppm,
                          struct fourier *pfo,
                          enum pk_outputs pk_output,
                          double k,
                          double z,
                          int index_pk,
                          double * out_pk, // number *out_pk_l
                          double * out_pk_ic // array out_pk_ic_l[index_ic_ic]
                          ) {

  double * out_pk_at_z;
  double * out_pk_ic_at_z = NULL;
  double * ddout_pk_at_z;
  double * ddout_pk_ic_at_z;
  int last_index;
  int index_ic1;
  int index_ic2;
  int index_ic1_ic1;
  int index_ic2_ic2;
  int index_ic1_ic2;
  double kmin;
  double * pk_primordial_k;
  double * pk_primordial_kmin;
  short do_ic = _FALSE_;

  /** - preliminary: check whether we need the decomposition into contributions from each initial condition */

  if ((pk_output == pk_linear) && (pfo->ic_size > 1) && (out_pk_ic != NULL))
    do_ic = _TRUE_;

  /** - first step: check that k is in valid range [0:kmax]
      (the test for z will be done when calling fourier_pk_linear_at_z()) */

  class_test((k < 0.) || (k > exp(pfo->ln_k[pfo->k_size-1])),
             pfo->error_message,
             "k=%e out of bounds [%e:%e]",k,0.,exp(pfo->ln_k[pfo->k_size-1]));

  /** - deal with case k = 0 for which P(k) is set to zero
      (this non-physical result can be useful for interpolations) */

  if (k == 0.) {
    *out_pk = 0.;

    if (do_ic == _TRUE_) {
      for (index_ic1_ic2=0; index_ic1_ic2<pfo->ic_ic_size; index_ic1_ic2++) {
        out_pk_ic[index_ic1_ic2] = 0.;
      }
    }
  }

  /** - deal with 0 < k <= kmax */

  else {

    class_alloc(out_pk_at_z,
                pfo->k_size*sizeof(double),
                pfo->error_message);

    if (do_ic == _TRUE_) {
      class_alloc(out_pk_ic_at_z,
                  pfo->k_size*pfo->ic_ic_size*sizeof(double),
                  pfo->error_message);
    }

    /** - deal with standard case kmin <= k <= kmax */

    if (k > exp(pfo->ln_k[0])) {

      /** --> First, get P(k) at the right z (in logarithmic format for more accurate interpolation, and then convert to linear format) */

      class_call(fourier_pk_at_z(pba,
                                 pfo,
                                 logarithmic,
                                 pk_output,
                                 z,
                                 index_pk,
                                 out_pk_at_z,
                                 out_pk_ic_at_z
                                 ),
                 pfo->error_message,
                 pfo->error_message);

      /** --> interpolate total spectrum */

      class_alloc(ddout_pk_at_z,
                  pfo->k_size*sizeof(double),
                  pfo->error_message);

      class_call(array_spline_table_lines(pfo->ln_k,
                                          pfo->k_size,
                                          out_pk_at_z,
                                          1,
                                          ddout_pk_at_z,
                                          _SPLINE_NATURAL_,
                                          pfo->error_message),
                 pfo->error_message,
                 pfo->error_message);

      class_call(array_interpolate_spline(pfo->ln_k,
                                          pfo->k_size,
                                          out_pk_at_z,
                                          ddout_pk_at_z,
                                          1,
                                          log(k),
                                          &last_index,
                                          out_pk,
                                          1,
                                          pfo->error_message),
                 pfo->error_message,
                 pfo->error_message);

      free(ddout_pk_at_z);

      // uncomment this part if you prefer a linear interpolation

      /*
        class_call(array_interpolate_linear(pfo->ln_k,
        pfo->k_size,
        out_pk_at_z,
        1,
        log(k),
        &last_index,
        out_pk,
        1,
        pfo->error_message),
        pfo->error_message,
        pfo->error_message);
      */

      /** --> convert from logarithmic to linear format */

      *out_pk = exp(*out_pk);

      /** --> interpolate each ic component */

      if (do_ic == _TRUE_) {

        class_alloc(ddout_pk_ic_at_z,
                    pfo->k_size*pfo->ic_ic_size*sizeof(double),
                    pfo->error_message);

        class_call(array_spline_table_lines(pfo->ln_k,
                                            pfo->k_size,
                                            out_pk_ic_at_z,
                                            pfo->ic_ic_size,
                                            ddout_pk_ic_at_z,
                                            _SPLINE_NATURAL_,
                                            pfo->error_message),
                   pfo->error_message,
                   pfo->error_message);

        class_call(array_interpolate_spline(pfo->ln_k,
                                            pfo->k_size,
                                            out_pk_ic_at_z,
                                            ddout_pk_ic_at_z,
                                            pfo->ic_ic_size,
                                            log(k),
                                            &last_index,
                                            out_pk_ic,
                                            pfo->ic_ic_size,
                                            pfo->error_message),
                   pfo->error_message,
                   pfo->error_message);

        free(ddout_pk_ic_at_z);

        /** --> convert each ic component from logarithmic to linear format */

        for (index_ic1=0; index_ic1 < pfo->ic_size; index_ic1++) {
          index_ic1_ic1 = index_symmetric_matrix(index_ic1,index_ic1,pfo->ic_size);
          out_pk_ic[index_ic1_ic1] = exp(out_pk_ic[index_ic1_ic1]);
        }
        for (index_ic1=0; index_ic1 < pfo->ic_size; index_ic1++) {
          for (index_ic2=index_ic1+1; index_ic2 < pfo->ic_size; index_ic2++) {
            index_ic1_ic1 = index_symmetric_matrix(index_ic1,index_ic1,pfo->ic_size);
            index_ic2_ic2 = index_symmetric_matrix(index_ic2,index_ic2,pfo->ic_size);
            index_ic1_ic2 = index_symmetric_matrix(index_ic1,index_ic2,pfo->ic_size);
            out_pk_ic[index_ic1_ic2]
              = out_pk_ic[index_ic1_ic2]*sqrt(out_pk_ic[index_ic1_ic1]*out_pk_ic[index_ic2_ic2]);
          }
        }
      }
    }

    /** --> deal with case 0 < k < kmin that requires extrapolation
     *    P(k) = [some number] * k  * P_primordial(k)
     *    so
     *    P(k) = P(kmin) * (k P_primordial(k)) / (kmin P_primordial(kmin))
     *    (note that the result is accurate only if kmin is such that [a0 kmin] << H0)
     *
     *    This is accurate for the synchronous gauge; TODO: write
     *    newtonian gauge case. Also, In presence of isocurvature
     *    modes, we assumes for simplicity that the mode with
     *    index_ic1_ic2=0 dominates at small k: exact treatment should be
     *    written if needed.
     */

    else {

      /** --> First, get P(k) at the right z (in linear format) */

      class_call(fourier_pk_at_z(pba,
                                 pfo,
                                 linear,
                                 pk_output,
                                 z,
                                 index_pk,
                                 out_pk_at_z,
                                 out_pk_ic_at_z
                                 ),
                 pfo->error_message,
                 pfo->error_message);

      /* get P(kmin) */
      *out_pk = out_pk_at_z[0];

      if (do_ic == _TRUE_) {
        for (index_ic1_ic2=0; index_ic1_ic2<pfo->ic_ic_size; index_ic1_ic2++) {
          out_pk_ic[index_ic1_ic2] = out_pk_ic_at_z[index_ic1_ic2];
        }
      }

      /* compute P_primordial(k) */

      class_alloc(pk_primordial_k,
                  sizeof(double)*pfo->ic_ic_size,
                  pfo->error_message);

      ppm->calling_from_pk = _TRUE_;
      class_call(primordial_spectrum_at_k(ppm,
                                          pfo->index_md_scalars,
                                          linear,
                                          k,
                                          pk_primordial_k),
                 ppm->error_message,
                 pfo->error_message);
      ppm->calling_from_pk = _FALSE_;
      /* compute P_primordial(kmin) */

      kmin = exp(pfo->ln_k[0]);

      class_alloc(pk_primordial_kmin,
                  sizeof(double)*pfo->ic_ic_size,
                  pfo->error_message);

      ppm->calling_from_pk = _TRUE_;
      class_call(primordial_spectrum_at_k(ppm,
                                          pfo->index_md_scalars,
                                          linear,
                                          kmin,
                                          pk_primordial_kmin),
                 ppm->error_message,
                 pfo->error_message);
      ppm->calling_from_pk = _FALSE_;
      /* finally, infer P(k) */

      *out_pk *= (k*pk_primordial_k[0]/kmin/pk_primordial_kmin[0]);

      if (do_ic == _TRUE_) {
        for (index_ic1_ic2=0; index_ic1_ic2<pfo->ic_ic_size; index_ic1_ic2++) {
          out_pk_ic[index_ic1_ic2] *= (k*pk_primordial_k[index_ic1_ic2]
                                       /kmin/pk_primordial_kmin[index_ic1_ic2]);
        }
      }

      free(pk_primordial_k);
      free(pk_primordial_kmin);
    }

    free(out_pk_at_z);
    if (do_ic == _TRUE_) {
      free(out_pk_ic_at_z);
    }
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1058, %rsp           # imm = 0x1058
movl %r8d, %r12d
movsd %xmm1, 0x20(%rsp)
movapd %xmm0, %xmm1
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, %r14
movq 0x1090(%rsp), %r13
testl %ecx, %ecx
je 0xa0ca3
movl $0x0, 0x1c(%rsp)
jmp 0xa0cb6
cmpl $0x2, 0x40(%rbx)
setge %al
testq %r13, %r13
setne %cl
andb %al, %cl
movl %ecx, 0x1c(%rsp)
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
movsd %xmm1, 0x28(%rsp)
ja 0xa0cf6
movq 0x80(%rbx), %rax
movslq 0x6c(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
movq %r9, 0x38(%rsp)
callq 0x8670
movq 0x38(%rsp), %rax
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xa0d93
movq 0x80(%rbx), %rax
movslq 0x6c(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
callq 0x8670
movapd %xmm0, %xmm2
leaq 0x7de43(%rip), %rsi     # 0x11eb5a
leaq 0x50(%rsp), %r14
xorpd %xmm1, %xmm1
movq %r14, %rdi
movsd 0x28(%rsp), %xmm0
movb $0x3, %al
callq 0x30c2c
leaq 0x5034b(%rip), %rsi     # 0xf1082
leaq 0x7de37(%rip), %rdx     # 0x11eb75
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x502d3(%rip), %rsi     # 0xf1034
leaq 0x7de3d(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x1e5, %ecx            # imm = 0x1E5
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0xa0dca
jp 0xa0dca
movq $0x0, (%rax)
xorl %ebp, %ebp
cmpb $0x0, 0x1c(%rsp)
je 0xa0d7f
movslq 0x44(%rbx), %rdx
testq %rdx, %rdx
jle 0xa0d7f
shlq $0x3, %rdx
xorl %ebp, %ebp
movq %r13, %rdi
xorl %esi, %esi
callq 0x8200
jmp 0xa0d7f
movslq 0x6c(%rbx), %r13
leaq (,%r13,8), %rdi
callq 0x8460
movq %rax, 0x48(%rsp)
testq %rax, %rax
je 0xa0e62
cmpb $0x0, 0x1c(%rsp)
je 0xa0ea8
movslq 0x44(%rbx), %rax
imulq %r13, %rax
movq %rax, 0x30(%rsp)
leaq (,%rax,8), %rdi
callq 0x8460
testq %rax, %rax
movq 0x1090(%rsp), %r13
jne 0xa0eb2
movq 0x30(%rsp), %rcx
shll $0x3, %ecx
leaq 0x501da(%rip), %rsi     # 0xf1004
leaq 0x7dee2(%rip), %rdx     # 0x11ed13
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x501e6(%rip), %rsi     # 0xf1034
leaq 0x7dd50(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x1ff, %ecx            # imm = 0x1FF
jmp 0xa0fcc
shll $0x3, %r13d
leaq 0x50197(%rip), %rsi     # 0xf1004
leaq 0x7dda6(%rip), %rdx     # 0x11ec1a
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x501a0(%rip), %rsi     # 0xf1034
leaq 0x7dd0a(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x1fa, %ecx            # imm = 0x1FA
jmp 0xa0fcc
xorl %eax, %eax
movq 0x1090(%rsp), %r13
movq %rax, 0x30(%rsp)
movq 0x80(%rbx), %rax
movsd (%rax), %xmm0
callq 0x8670
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0xa0f5d
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movl $0x1, %ebp
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl %r15d, %ecx
movsd 0x20(%rsp), %xmm0
movl %r12d, %r8d
movq 0x48(%rsp), %r12
movq %r12, %r9
callq 0x9ff68
testl %eax, %eax
je 0xa0fd4
addq $0x192, %rbx            # imm = 0x192
leaq 0x504d1(%rip), %rsi     # 0xf13f0
leaq 0x7dc95(%rip), %rdx     # 0x11ebbb
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x500f5(%rip), %rsi     # 0xf1034
leaq 0x7dc5f(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x212, %ecx            # imm = 0x212
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
jmp 0xa0d7f
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl %r15d, %ecx
movsd 0x20(%rsp), %xmm0
movl %r12d, %r8d
movq 0x48(%rsp), %r14
movq %r14, %r9
callq 0x9ff68
testl %eax, %eax
je 0xa1061
addq $0x192, %rbx            # imm = 0x192
leaq 0x50453(%rip), %rsi     # 0xf13f0
leaq 0x7dea2(%rip), %rdx     # 0x11ee46
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x50077(%rip), %rsi     # 0xf1034
leaq 0x7dbe1(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x295, %ecx            # imm = 0x295
movq %r14, %r8
jmp 0xa0d73
movslq 0x6c(%rbx), %r15
movq %r15, %rdi
shlq $0x3, %rdi
callq 0x8460
testq %rax, %rax
je 0xa111e
movq %rax, %r14
movq 0x80(%rbx), %rdi
leaq 0x192(%rbx), %r13
movq %r13, (%rsp)
movl $0x1, %ebp
movl %r15d, %esi
movq %r12, %rdx
movl $0x1, %ecx
movq %rax, %r8
xorl %r9d, %r9d
callq 0x14191
cmpl $0x1, %eax
jne 0xa11ab
leaq 0x503c3(%rip), %rsi     # 0xf13f0
leaq 0x7dbf2(%rip), %rdx     # 0x11ec26
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x4ffe7(%rip), %rsi     # 0xf1034
leaq 0x7db51(%rip), %rdx     # 0x11eba5
movq %r13, %rdi
movl $0x222, %ecx            # imm = 0x222
jmp 0xa1246
movsd (%r14), %xmm0
movq 0x38(%rsp), %rax
movsd %xmm0, (%rax)
cmpb $0x0, 0x1c(%rsp)
je 0xa1090
movslq 0x44(%rbx), %rdx
testq %rdx, %rdx
jle 0xa1090
shlq $0x3, %rdx
movq %r13, %rdi
movq 0x30(%rsp), %rsi
callq 0x82d0
movslq 0x44(%rbx), %r14
leaq (,%r14,8), %rdi
callq 0x8460
testq %rax, %rax
je 0xa1165
movq %rax, %r15
movw $0x1, 0xb2c(%rbp)
movl 0x3c(%rbx), %esi
movq %rbp, %rdi
xorl %edx, %edx
movsd 0x28(%rsp), %xmm0
movq %rax, %rcx
callq 0x97030
cmpl $0x1, %eax
jne 0xa124e
addq $0x32a, %rbp            # imm = 0x32A
leaq 0x5030d(%rip), %rsi     # 0xf13f0
leaq 0x7ddb4(%rip), %rdx     # 0x11ee9e
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x4ff2a(%rip), %rsi     # 0xf1034
leaq 0x7da94(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x2ad, %ecx            # imm = 0x2AD
jmp 0xa0fcc
leal (,%r15,8), %ecx
leaq 0x4fed7(%rip), %rsi     # 0xf1004
leaq 0x7dae4(%rip), %rdx     # 0x11ec18
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x4fee3(%rip), %rsi     # 0xf1034
leaq 0x7da4d(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x218, %ecx            # imm = 0x218
jmp 0xa0f4e
shll $0x3, %r14d
leaq 0x4fe94(%rip), %rsi     # 0xf1004
leaq 0x8b9ff(%rip), %rdx     # 0x12cb76
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x4fe9d(%rip), %rsi     # 0xf1034
leaq 0x7da07(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x2a4, %ecx            # imm = 0x2A4
jmp 0xa0d70
movq 0x80(%rbx), %rax
movq %rax, 0x20(%rsp)
movl 0x6c(%rbx), %r12d
movsd 0x28(%rsp), %xmm0
callq 0x82c0
movq %r13, 0x10(%rsp)
movq 0x38(%rsp), %r15
movq %r15, (%rsp)
movl $0x1, 0x8(%rsp)
movl $0x1, %ebp
leaq 0x850(%rsp), %r9
movq 0x20(%rsp), %rdi
movl %r12d, %esi
movq 0x48(%rsp), %r12
movq %r12, %rdx
movq %r14, %rcx
movl $0x1, %r8d
callq 0x17ee6
cmpl $0x1, %eax
jne 0xa12fb
leaq 0x501d9(%rip), %rsi     # 0xf13f0
leaq 0x7da6f(%rip), %rdx     # 0x11ec8d
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x4fdfd(%rip), %rsi     # 0xf1034
leaq 0x7d967(%rip), %rdx     # 0x11eba5
movq %r13, %rdi
movl $0x22f, %ecx            # imm = 0x22F
movq %rbx, %r8
jmp 0xa0f51
movw $0x0, 0xb2c(%rbp)
movq 0x80(%rbx), %rax
movsd (%rax), %xmm0
callq 0x8670
movsd %xmm0, 0x20(%rsp)
movslq 0x44(%rbx), %r12
leaq (,%r12,8), %rdi
callq 0x8460
testq %rax, %rax
je 0xa13ac
movq %rax, %r14
movw $0x1, 0xb2c(%rbp)
movl 0x3c(%rbx), %esi
movq %rbp, %rdi
xorl %edx, %edx
movsd 0x20(%rsp), %xmm0
movq %rax, %rcx
callq 0x97030
cmpl $0x1, %eax
jne 0xa13f2
addq $0x32a, %rbp            # imm = 0x32A
leaq 0x50130(%rip), %rsi     # 0xf13f0
leaq 0x7dc3b(%rip), %rdx     # 0x11ef02
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x4fd4d(%rip), %rsi     # 0xf1034
leaq 0x7d8b7(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x2be, %ecx            # imm = 0x2BE
jmp 0xa0fcc
movq %r14, %rdi
callq 0x8410
movsd (%r15), %xmm0
callq 0x8670
movsd %xmm0, (%r15)
cmpb $0x0, 0x1c(%rsp)
je 0xa1498
movl 0x44(%rbx), %r15d
movl 0x6c(%rbx), %r12d
movl %r15d, %ebp
imull %r12d, %ebp
movslq %ebp, %rdi
shlq $0x3, %rdi
callq 0x8460
testq %rax, %rax
je 0xa14a7
movq %rax, %r14
movq 0x80(%rbx), %rdi
movq %r13, (%rsp)
movl %r12d, %esi
movq 0x30(%rsp), %rbp
movq %rbp, %rdx
movl %r15d, %ecx
movq %rax, %r8
xorl %r9d, %r9d
callq 0x14191
cmpl $0x1, %eax
jne 0xa14e4
leaq 0x50078(%rip), %rsi     # 0xf13f0
leaq 0x7d9a3(%rip), %rdx     # 0x11ed22
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x4fc9c(%rip), %rsi     # 0xf1034
leaq 0x7d806(%rip), %rdx     # 0x11eba5
movq %r13, %rdi
movl $0x257, %ecx            # imm = 0x257
jmp 0xa1572
shll $0x3, %r12d
leaq 0x4fc4d(%rip), %rsi     # 0xf1004
leaq 0x7db31(%rip), %rdx     # 0x11eeef
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x192, %rbx            # imm = 0x192
leaq 0x4fc56(%rip), %rsi     # 0xf1034
leaq 0x7d7c0(%rip), %rdx     # 0x11eba5
movq %rbx, %rdi
movl $0x2b5, %ecx            # imm = 0x2B5
jmp 0xa0fcc
movw $0x0, 0xb2c(%rbp)
movsd (%r15), %xmm0
movsd 0x28(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x20(%rsp), %xmm2
divsd %xmm2, %xmm0
divsd (%r14), %xmm0
movq 0x38(%rsp), %rax
mulsd (%rax), %xmm0
movsd %xmm0, (%rax)
cmpb $0x0, 0x1c(%rsp)
je 0xa1462
movslq 0x44(%rbx), %rax
testq %rax, %rax
jle 0xa1462
xorl %ecx, %ecx
movsd (%r15,%rcx,8), %xmm0
mulsd %xmm1, %xmm0
divsd %xmm2, %xmm0
divsd (%r14,%rcx,8), %xmm0
mulsd (%r13,%rcx,8), %xmm0
movsd %xmm0, (%r13,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0xa1438
movq %r15, %rdi
callq 0x8410
movq %r14, %rdi
callq 0x8410
movq 0x48(%rsp), %rdi
callq 0x8410
xorl %ebp, %ebp
cmpb $0x0, 0x1c(%rsp)
je 0xa0d7f
movq 0x30(%rsp), %rdi
callq 0x8410
jmp 0xa0d7f
movq %r12, %rdi
callq 0x8410
xorl %ebp, %ebp
jmp 0xa0d7f
shll $0x3, %ebp
leaq 0x4fb53(%rip), %rsi     # 0xf1004
leaq 0x7d859(%rip), %rdx     # 0x11ed11
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0x4fb64(%rip), %rsi     # 0xf1034
leaq 0x7d6ce(%rip), %rdx     # 0x11eba5
movq %r13, %rdi
movl $0x24d, %ecx            # imm = 0x24D
jmp 0xa1572
movq 0x80(%rbx), %r15
movl 0x44(%rbx), %eax
movl %eax, 0x20(%rsp)
movl 0x6c(%rbx), %r12d
movsd 0x28(%rsp), %xmm0
callq 0x82c0
movl 0x44(%rbx), %eax
movq %r13, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq 0x1090(%rsp), %rax
movq %rax, (%rsp)
leaq 0x850(%rsp), %r9
movq %r15, %rdi
movl %r12d, %esi
movq %rbp, %rdx
movq %r14, %rcx
movl 0x20(%rsp), %r8d
callq 0x17ee6
cmpl $0x1, %eax
jne 0xa157a
leaq 0x4fead(%rip), %rsi     # 0xf13f0
leaq 0x7d853(%rip), %rdx     # 0x11ed9d
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x4fad1(%rip), %rsi     # 0xf1034
leaq 0x7d63b(%rip), %rdx     # 0x11eba5
movq %r13, %rdi
movl $0x264, %ecx            # imm = 0x264
movq %rbx, %r8
jmp 0xa0d73
movq %r14, %rdi
callq 0x8410
movl 0x40(%rbx), %eax
testl %eax, %eax
movq 0x1090(%rsp), %r15
jle 0xa15bf
xorl %ecx, %ecx
incl %eax
imull %ecx, %eax
leal 0x1(%rcx), %ebp
imull %ebp, %ecx
shrl %ecx
subl %ecx, %eax
movslq %eax, %r14
movsd (%r15,%r14,8), %xmm0
callq 0x8670
movsd %xmm0, (%r15,%r14,8)
movl 0x40(%rbx), %eax
movl %ebp, %ecx
cmpl %eax, %ebp
jl 0xa1593
cmpl $0x0, 0x40(%rbx)
jle 0xa1472
movl $0x2, 0x38(%rsp)
movl $0x0, 0x44(%rsp)
xorpd %xmm1, %xmm1
xorl %eax, %eax
movl %eax, %r12d
leal 0x1(%r12), %ecx
movl 0x40(%rbx), %eax
movl %ecx, 0x20(%rsp)
cmpl %eax, %ecx
jge 0xa16a9
movl 0x44(%rsp), %ecx
movl %ecx, %r13d
shrl %r13d
negl %r13d
movl 0x20(%rsp), %ecx
movl %ecx, %r15d
imull %r12d, %r15d
shrl %r15d
leal 0x1(%rcx), %r14d
movl %r14d, %edx
imull %ecx, %edx
shrl %edx
cmpl %ecx, %r12d
jbe 0xa162e
movl %eax, %esi
imull %ecx, %esi
addl %r12d, %esi
subl %edx, %esi
jmp 0xa1639
movl %r12d, %esi
imull %eax, %esi
addl %r13d, %esi
addl %ecx, %esi
incl %eax
movl %eax, %edi
imull %r12d, %edi
subl %r15d, %edi
imull %ecx, %eax
subl %edx, %eax
movslq %esi, %rbp
movq 0x1090(%rsp), %rdx
movsd (%rdx,%rbp,8), %xmm2
movslq %edi, %rcx
movsd (%rdx,%rcx,8), %xmm0
cltq
mulsd (%rdx,%rax,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0xa1674
sqrtsd %xmm0, %xmm0
jmp 0xa1689
movsd %xmm2, 0x28(%rsp)
callq 0x82b0
movsd 0x28(%rsp), %xmm2
xorpd %xmm1, %xmm1
mulsd %xmm0, %xmm2
movq 0x1090(%rsp), %rax
movsd %xmm2, (%rax,%rbp,8)
movl 0x40(%rbx), %eax
movl %r14d, %ecx
cmpl %eax, %r14d
jl 0xa1611
movl 0x38(%rsp), %eax
addl %eax, 0x44(%rsp)
addl $0x2, %eax
movl %eax, 0x38(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x40(%rbx), %eax
jl 0xa15df
jmp 0xa1472