// File: millanek[P]Dsuite/kstest.cpp
// Function: mPower(double*, int, double*, int*, int, int)
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(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)]>1e140) {for(i=0;i<m*m;i++) V[i]=V[i]*1e-140;*eV+=140;}
    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 0x8371d
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8370f
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 0x836dc
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x83893
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %eax
movl $0x2, %r9d
cltd
idivl %r9d
movq -0x40(%rbp), %rdx
movl %eax, %r9d
callq 0x836b0
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 0x835d0
movq -0x20(%rbp), %rax
movl (%rax), %eax
shll %eax
movl %eax, -0x34(%rbp)
movl -0x28(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x837d8
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x837cd
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 0x8379a
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x837f8
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x835d0
movl -0xc(%rbp), %ecx
addl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%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 -0x48(%rbp), %rax
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd 0x9e64(%rip), %xmm1     # 0x8d698
ucomisd %xmm1, %xmm0
jbe 0x8388a
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8387c
movq -0x18(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsd 0x9e41(%rip), %xmm0     # 0x8d6a0
mulsd (%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 0x83841
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x8c, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rdi
callq 0x86d0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)