// File: /workspace/github_c_makefile_star2_O2/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, %ebp
movsd %xmm1, 0x20(%rsp)
movapd %xmm0, %xmm1
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movq 0x1090(%rsp), %r13
testl %ecx, %ecx
je 0x98eb5
movl $0x0, 0x1c(%rsp)
jmp 0x98ec8
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 0x98f08
movq 0x80(%rbx), %rax
movslq 0x6c(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
movq %r9, 0x30(%rsp)
callq 0x86a0
movq 0x30(%rsp), %rax
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x98fa5
movq 0x80(%rbx), %rax
movslq 0x6c(%rbx), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
callq 0x86a0
movapd %xmm0, %xmm2
leaq 0x79b11(%rip), %rsi     # 0x112a3a
leaq 0x50(%rsp), %r14
xorpd %xmm1, %xmm1
movq %r14, %rdi
movsd 0x28(%rsp), %xmm0
movb $0x3, %al
callq 0x2e014
leaq 0x4c139(%rip), %rsi     # 0xe5082
leaq 0x79b05(%rip), %rdx     # 0x112a55
leaq 0x850(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4c0c1(%rip), %rsi     # 0xe5034
leaq 0x79b0b(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x1e5, %ecx            # imm = 0x1E5
movq %r15, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %r12
movl %r12d, %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 0x98fdd
jp 0x98fdd
andq $0x0, (%rax)
xorl %r12d, %r12d
cmpb $0x0, 0x1c(%rsp)
je 0x98f90
movl 0x44(%rbx), %eax
xorl %r12d, %r12d
testl %eax, %eax
cmovlel %r12d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x98f90
andq $0x0, (%r13,%rcx,8)
incq %rcx
jmp 0x98fcd
movslq 0x6c(%rbx), %r13
leaq (,%r13,8), %rdi
callq 0x8490
movq %rax, 0x40(%rsp)
testq %rax, %rax
je 0x99075
cmpb $0x0, 0x1c(%rsp)
je 0x990bb
movslq 0x44(%rbx), %rax
imulq %r13, %rax
movq %rax, 0x38(%rsp)
leaq (,%rax,8), %rdi
callq 0x8490
testq %rax, %rax
movq 0x1090(%rsp), %r13
jne 0x990c5
movq 0x38(%rsp), %rcx
shll $0x3, %ecx
leaq 0x4bfc7(%rip), %rsi     # 0xe5004
leaq 0x79baf(%rip), %rdx     # 0x112bf3
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4bfd3(%rip), %rsi     # 0xe5034
leaq 0x79a1d(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x1ff, %ecx            # imm = 0x1FF
jmp 0x991ce
shll $0x3, %r13d
leaq 0x4bf84(%rip), %rsi     # 0xe5004
leaq 0x79a73(%rip), %rdx     # 0x112afa
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4bf8d(%rip), %rsi     # 0xe5034
leaq 0x799d7(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x1fa, %ecx            # imm = 0x1FA
jmp 0x991ce
xorl %eax, %eax
movq 0x1090(%rsp), %r13
movq %rax, 0x38(%rsp)
movq 0x80(%rbx), %rax
movsd (%rax), %xmm0
callq 0x86a0
movsd 0x28(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x9915f
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
pushq $0x1
popq %r12
movq %r15, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %r14d, %ecx
movsd 0x20(%rsp), %xmm0
movl %ebp, %r8d
movq 0x40(%rsp), %r9
callq 0x98198
testl %eax, %eax
je 0x991d6
addq $0x192, %rbx            # imm = 0x192
leaq 0x4c2c8(%rip), %rsi     # 0xe53f0
leaq 0x7996c(%rip), %rdx     # 0x112a9b
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4beec(%rip), %rsi     # 0xe5034
leaq 0x79936(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x212, %ecx            # imm = 0x212
movq %r14, %r8
jmp 0x9945a
movq 0x38(%rsp), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl %r14d, %ecx
movsd 0x20(%rsp), %xmm0
movl %ebp, %r8d
movq 0x40(%rsp), %r14
movq %r14, %r9
callq 0x98198
testl %eax, %eax
je 0x99262
addq $0x192, %rbx            # imm = 0x192
leaq 0x4c251(%rip), %rsi     # 0xe53f0
leaq 0x79b80(%rip), %rdx     # 0x112d26
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4be75(%rip), %rsi     # 0xe5034
leaq 0x798bf(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x295, %ecx            # imm = 0x295
movq %r14, %r8
jmp 0x98f85
movslq 0x6c(%rbx), %r15
movq %r15, %rdi
shlq $0x3, %rdi
callq 0x8490
testq %rax, %rax
je 0x99330
movq %rax, %r14
movq 0x80(%rbx), %rdi
leaq 0x192(%rbx), %rbp
movq %rbp, (%rsp)
pushq $0x1
popq %r12
movl %r15d, %esi
movq 0x40(%rsp), %rdx
movl %r12d, %ecx
movq %rax, %r8
xorl %r9d, %r9d
callq 0x125a5
cmpl $0x1, %eax
jne 0x993bd
leaq 0x4c1c2(%rip), %rsi     # 0xe53f0
leaq 0x798d1(%rip), %rdx     # 0x112b06
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4bde6(%rip), %rsi     # 0xe5034
leaq 0x79830(%rip), %rdx     # 0x112a85
movq %rbp, %rdi
movl $0x222, %ecx            # imm = 0x222
jmp 0x99457
movsd (%r14), %xmm0
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax)
movslq 0x44(%rbx), %r15
cmpb $0x0, 0x1c(%rsp)
movq 0x38(%rsp), %rdx
je 0x992a4
xorl %eax, %eax
testl %r15d, %r15d
movl $0x0, %ecx
cmovgl %r15d, %ecx
cmpq %rax, %rcx
je 0x992a4
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%r13,%rax,8)
incq %rax
jmp 0x9928e
leaq (,%r15,8), %rdi
callq 0x8490
testq %rax, %rax
je 0x99377
movq %rax, %r14
movw $0x1, 0xb2c(%r12)
movl 0x3c(%rbx), %esi
movq %r12, %rdi
xorl %edx, %edx
movsd 0x28(%rsp), %xmm0
movq %rax, %rcx
callq 0x8f820
cmpl $0x1, %eax
jne 0x99466
addq $0x32a, %r12            # imm = 0x32A
leaq 0x4c0fb(%rip), %rsi     # 0xe53f0
leaq 0x79a82(%rip), %rdx     # 0x112d7e
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4bd18(%rip), %rsi     # 0xe5034
leaq 0x79762(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x2ad, %ecx            # imm = 0x2AD
jmp 0x991ce
leal (,%r15,8), %ecx
leaq 0x4bcc5(%rip), %rsi     # 0xe5004
leaq 0x797b2(%rip), %rdx     # 0x112af8
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4bcd1(%rip), %rsi     # 0xe5034
leaq 0x7971b(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x218, %ecx            # imm = 0x218
jmp 0x99157
shll $0x3, %r15d
leaq 0x4bc82(%rip), %rsi     # 0xe5004
leaq 0x876bd(%rip), %rdx     # 0x120a46
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4bc8b(%rip), %rsi     # 0xe5034
leaq 0x796d5(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x2a4, %ecx            # imm = 0x2A4
jmp 0x991ce
movq 0x80(%rbx), %r15
movl 0x6c(%rbx), %r13d
movsd 0x28(%rsp), %xmm0
callq 0x82e0
movq %rbp, 0x10(%rsp)
movq %rbp, 0x20(%rsp)
movq 0x30(%rsp), %rbp
movq %rbp, (%rsp)
movl $0x1, 0x8(%rsp)
pushq $0x1
popq %r12
leaq 0x850(%rsp), %r9
movq %r15, %rdi
movq 0x40(%rsp), %r15
movl %r13d, %esi
movq %r15, %rdx
movq %r14, %rcx
movl %r12d, %r8d
callq 0x1604b
cmpl $0x1, %eax
jne 0x99516
leaq 0x4bfcd(%rip), %rsi     # 0xe53f0
leaq 0x79743(%rip), %rdx     # 0x112b6d
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4bbec(%rip), %rsi     # 0xe5034
leaq 0x79636(%rip), %rdx     # 0x112a85
movq %r14, %rdi
movl $0x22f, %ecx            # imm = 0x22F
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
jmp 0x98f90
andw $0x0, 0xb2c(%r12)
movq 0x80(%rbx), %rax
movsd (%rax), %xmm0
callq 0x86a0
movsd %xmm0, 0x20(%rsp)
movslq 0x44(%rbx), %r13
leaq (,%r13,8), %rdi
callq 0x8490
testq %rax, %rax
je 0x995cc
movq %rax, %r15
movw $0x1, 0xb2c(%r12)
movl 0x3c(%rbx), %esi
movq %r12, %rdi
xorl %edx, %edx
movsd 0x20(%rsp), %xmm0
movq %rax, %rcx
callq 0x8f820
cmpl $0x1, %eax
jne 0x99612
addq $0x32a, %r12            # imm = 0x32A
leaq 0x4bf15(%rip), %rsi     # 0xe53f0
leaq 0x79900(%rip), %rdx     # 0x112de2
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4bb32(%rip), %rsi     # 0xe5034
leaq 0x7957c(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x2be, %ecx            # imm = 0x2BE
jmp 0x991ce
movq %r14, %rdi
callq 0x8430
movsd (%rbp), %xmm0
callq 0x86a0
movsd %xmm0, (%rbp)
cmpb $0x0, 0x1c(%rsp)
je 0x996bf
movl 0x44(%rbx), %r13d
movl 0x6c(%rbx), %r14d
movl %r13d, %r15d
imull %r14d, %r15d
movslq %r15d, %rdi
shlq $0x3, %rdi
callq 0x8490
testq %rax, %rax
je 0x996cf
movq 0x80(%rbx), %rdi
movq 0x20(%rsp), %rbp
movq %rbp, (%rsp)
movl %r14d, %esi
movq 0x38(%rsp), %r15
movq %r15, %rdx
movl %r13d, %ecx
movq %rax, %r14
movq %rax, %r8
xorl %r9d, %r9d
callq 0x125a5
cmpl $0x1, %eax
jne 0x99710
leaq 0x4be58(%rip), %rsi     # 0xe53f0
leaq 0x79663(%rip), %rdx     # 0x112c02
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4ba7c(%rip), %rsi     # 0xe5034
leaq 0x794c6(%rip), %rdx     # 0x112a85
movq %rbp, %rdi
movl $0x257, %ecx            # imm = 0x257
jmp 0x99457
shll $0x3, %r13d
leaq 0x4ba2d(%rip), %rsi     # 0xe5004
leaq 0x797f1(%rip), %rdx     # 0x112dcf
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x4ba36(%rip), %rsi     # 0xe5034
leaq 0x79480(%rip), %rdx     # 0x112a85
movq %rbx, %rdi
movl $0x2b5, %ecx            # imm = 0x2B5
jmp 0x991ce
andw $0x0, 0xb2c(%r12)
movsd (%r14), %xmm0
movsd 0x28(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd 0x20(%rsp), %xmm2
divsd %xmm2, %xmm0
divsd (%r15), %xmm0
movq 0x30(%rsp), %rax
mulsd (%rax), %xmm0
movsd %xmm0, (%rax)
cmpb $0x0, 0x1c(%rsp)
movq 0x1090(%rsp), %rdx
je 0x99688
movl 0x44(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x99688
movsd (%r14,%rcx,8), %xmm0
mulsd %xmm1, %xmm0
divsd %xmm2, %xmm0
divsd (%r15,%rcx,8), %xmm0
mulsd (%rdx,%rcx,8), %xmm0
movsd %xmm0, (%rdx,%rcx,8)
incq %rcx
jmp 0x99660
movq %r14, %rdi
callq 0x8430
movq %r15, %rdi
callq 0x8430
movq 0x40(%rsp), %rdi
callq 0x8430
xorl %r12d, %r12d
cmpb $0x0, 0x1c(%rsp)
je 0x98f90
movq 0x38(%rsp), %rdi
callq 0x8430
jmp 0x98f90
movq %r15, %rdi
callq 0x8430
xorl %r12d, %r12d
jmp 0x98f90
shll $0x3, %r15d
leaq 0x4b92a(%rip), %rsi     # 0xe5004
leaq 0x79510(%rip), %rdx     # 0x112bf1
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x4b93a(%rip), %rsi     # 0xe5034
leaq 0x79384(%rip), %rdx     # 0x112a85
movq 0x20(%rsp), %rdi
movl $0x24d, %ecx            # imm = 0x24D
jmp 0x99457
movq 0x80(%rbx), %rax
movq %rax, 0x48(%rsp)
movl 0x44(%rbx), %eax
movl %eax, 0x30(%rsp)
movl 0x6c(%rbx), %r13d
movsd 0x28(%rsp), %xmm0
callq 0x82e0
movl 0x44(%rbx), %eax
movq %rbp, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq 0x1090(%rsp), %rax
movq %rax, (%rsp)
leaq 0x850(%rsp), %r9
movq 0x48(%rsp), %rdi
movl %r13d, %esi
movq %r15, %rdx
movq %r14, %rcx
movl 0x30(%rsp), %r8d
callq 0x1604b
cmpl $0x1, %eax
jne 0x997aa
leaq 0x4bc7a(%rip), %rsi     # 0xe53f0
leaq 0x79500(%rip), %rdx     # 0x112c7d
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x4b89e(%rip), %rsi     # 0xe5034
leaq 0x792e8(%rip), %rdx     # 0x112a85
movq %rbp, %rdi
movl $0x264, %ecx            # imm = 0x264
jmp 0x99457
movq %r14, %rdi
callq 0x8430
xorl %ecx, %ecx
movq 0x1090(%rsp), %r15
movl 0x40(%rbx), %eax
cmpl %eax, %ecx
jge 0x997ea
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 0x86a0
movsd %xmm0, (%r15,%r14,8)
movl %ebp, %ecx
jmp 0x997bc
pushq $0x2
popq %rcx
movl %ecx, 0x20(%rsp)
xorl %edx, %edx
xorpd %xmm1, %xmm1
xorl %r15d, %r15d
cmpl %eax, %r15d
jge 0x99698
movl %edx, 0x30(%rsp)
movl %edx, %r13d
shrl %r13d
negl %r13d
leal 0x1(%r15), %ecx
movl %ecx, %r12d
imull %r15d, %r12d
shrl %r12d
movl %ecx, 0x48(%rsp)
cmpl %eax, %ecx
jge 0x998be
leal 0x1(%rcx), %r14d
movl %r14d, %edx
imull %ecx, %edx
shrl %edx
cmpl %ecx, %r15d
jbe 0x99847
movl %eax, %esi
imull %ecx, %esi
addl %r15d, %esi
subl %edx, %esi
jmp 0x99852
movl %r15d, %esi
imull %eax, %esi
addl %r13d, %esi
addl %ecx, %esi
incl %eax
movl %eax, %edi
imull %r15d, %edi
subl %r12d, %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 0x9988d
sqrtsd %xmm0, %xmm0
jmp 0x998a2
movsd %xmm2, 0x28(%rsp)
callq 0x82d0
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
jmp 0x99822
movl 0x20(%rsp), %ecx
movl 0x30(%rsp), %edx
addl %ecx, %edx
addl $0x2, %ecx
movl %ecx, 0x20(%rsp)
movl 0x48(%rsp), %ecx
movl %ecx, %r15d
jmp 0x997fa