// File: millanek[P]Dsuite/KolmogorovSmirnovDist.cpp
// Function: mPower(double*, int, double*, int*, int, int)
static void mPower (double *A, int eA, double *V, int *eV, int m, int n)
{
   double *B;
   int eB, i;
   if (n == 1) {
      for (i = 0; i < m * m; i++)
         V[i] = A[i];
      *eV = eA;
      return;
   }
   mPower (A, eA, V, eV, m, n / 2);
   B = (double *) malloc ((m * m) * sizeof (double));
   mMultiply (V, V, B, m);
   eB = 2 * (*eV);
   if (B[(m / 2) * m + (m / 2)] > NORM)
      renormalize (B, m, &eB);

   if (n % 2 == 0) {
      for (i = 0; i < m * m; i++)
         V[i] = B[i];
      *eV = eB;
   } else {
      mMultiply (A, B, V, m);
      *eV = eA + eB;
   }

   if (V[(m / 2) * m + (m / 2)] > NORM)
      renormalize (V, m, eV);
   free (B);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
cmpl $0x1, -0x28(%rbp)
jne 0x87b1d
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x87b0f
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x87adc
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x87ca5
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %eax
movl $0x2, %r9d
cltd
idivl %r9d
movq -0x48(%rbp), %rdx
movl %eax, %r9d
callq 0x87ab0
movl -0x24(%rbp), %eax
imull -0x24(%rbp), %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x8780
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x87cb0
movq -0x20(%rbp), %rax
movl (%rax), %eax
shll %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
imull -0x24(%rbp), %ecx
movl -0x24(%rbp), %eax
movl $0x2, %esi
cltd
idivl %esi
movl %eax, %edx
movq -0x40(%rbp), %rax
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x5ad9(%rip), %xmm1     # 0x8d698
ucomisd %xmm1, %xmm0
jbe 0x87bd5
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq -0x34(%rbp), %rdx
callq 0x87d90
movl -0x28(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x87c2a
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x87c1f
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x87bec
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x87c4a
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x87cb0
movl -0xc(%rbp), %ecx
addl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
imull -0x24(%rbp), %ecx
movl -0x24(%rbp), %eax
movl $0x2, %esi
cltd
idivl %esi
movl %eax, %edx
movq -0x50(%rbp), %rax
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x5a12(%rip), %xmm1     # 0x8d698
ucomisd %xmm1, %xmm0
jbe 0x87c9c
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x87d90
movq -0x30(%rbp), %rdi
callq 0x86d0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)