#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double log(double);
void LogifySubstitutionMatrix(double smx[20][20]) {
  int child, root;
  for (root = 0; root < 20; root++)
    for (child = 0; child < 20; child++)
      smx[root][child] = log(smx[root][child]);
}


x86 assembly (clang, -O0):
<LogifySubstitutionMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    119a <LogifySubstitutionMatrix+0x8a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1187 <LogifySubstitutionMatrix+0x77>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0xa0,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <log@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0xa0,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <LogifySubstitutionMatrix+0x24>
jmp    118c <LogifySubstitutionMatrix+0x7c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <LogifySubstitutionMatrix+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogifySubstitutionMatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x98,%ebx
nopl   0x0(%rax)
movsd  -0x98(%r14,%rbx,1),%xmm0
ff ff ff
call   1030 <log@plt>
movsd  %xmm0,-0x98(%r14,%rbx,1)
ff ff ff
movsd  -0x90(%r14,%rbx,1),%xmm0
ff ff ff
call   1030 <log@plt>
movsd  %xmm0,-0x90(%r14,%rbx,1)
ff ff ff
movsd  -0x88(%r14,%rbx,1),%xmm0
ff ff ff
call   1030 <log@plt>
movsd  %xmm0,-0x88(%r14,%rbx,1)
ff ff ff
movsd  -0x80(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x80(%r14,%rbx,1)
movsd  -0x78(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x78(%r14,%rbx,1)
movsd  -0x70(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x70(%r14,%rbx,1)
movsd  -0x68(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x68(%r14,%rbx,1)
movsd  -0x60(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x60(%r14,%rbx,1)
movsd  -0x58(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x58(%r14,%rbx,1)
movsd  -0x50(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x50(%r14,%rbx,1)
movsd  -0x48(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x48(%r14,%rbx,1)
movsd  -0x40(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x40(%r14,%rbx,1)
movsd  -0x38(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x38(%r14,%rbx,1)
movsd  -0x30(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x30(%r14,%rbx,1)
movsd  -0x28(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x28(%r14,%rbx,1)
movsd  -0x20(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x20(%r14,%rbx,1)
movsd  -0x18(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x18(%r14,%rbx,1)
movsd  -0x10(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%r14,%rbx,1)
movsd  -0x8(%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x8(%r14,%rbx,1)
movsd  (%r14,%rbx,1),%xmm0
call   1030 <log@plt>
movsd  %xmm0,(%r14,%rbx,1)
add    $0xa0,%rbx
cmp    $0xd18,%rbx
jne    1120 <LogifySubstitutionMatrix+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LogifySubstitutionMatrix([20 x double]* %0) {
%2 = alloca [20 x double]*
%3 = alloca i32
%4 = alloca i32
store [20 x double]* %0, [20 x double]** %2
store i32 0, i32* %4
br label %5
5: ; preds = %33, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %36
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %29, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = load [20 x double]*, [20 x double]** %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [20 x double], [20 x double]* %13, i64 %15
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [20 x double], [20 x double]* %16, i64 0, i64 %18
%20 = load double, double* %19
%21 = call double @log(double %20)
%22 = load [20 x double]*, [20 x double]** %2
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [20 x double], [20 x double]* %22, i64 %24
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [20 x double], [20 x double]* %25, i64 0, i64 %27
store double %21, double* %28
br label %29
29: ; preds = %12
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %9
32: ; preds = %9
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %5
36: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @LogifySubstitutionMatrix([20 x double]* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %64, %2 ]
%4 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 0
%5 = load double, double* %4
%6 = tail call double @log(double %5)
store double %6, double* %4
%7 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 1
%8 = load double, double* %7
%9 = tail call double @log(double %8)
store double %9, double* %7
%10 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 2
%11 = load double, double* %10
%12 = tail call double @log(double %11)
store double %12, double* %10
%13 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 3
%14 = load double, double* %13
%15 = tail call double @log(double %14)
store double %15, double* %13
%16 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 4
%17 = load double, double* %16
%18 = tail call double @log(double %17)
store double %18, double* %16
%19 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 5
%20 = load double, double* %19
%21 = tail call double @log(double %20)
store double %21, double* %19
%22 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 6
%23 = load double, double* %22
%24 = tail call double @log(double %23)
store double %24, double* %22
%25 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 7
%26 = load double, double* %25
%27 = tail call double @log(double %26)
store double %27, double* %25
%28 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 8
%29 = load double, double* %28
%30 = tail call double @log(double %29)
store double %30, double* %28
%31 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 9
%32 = load double, double* %31
%33 = tail call double @log(double %32)
store double %33, double* %31
%34 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 10
%35 = load double, double* %34
%36 = tail call double @log(double %35)
store double %36, double* %34
%37 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 11
%38 = load double, double* %37
%39 = tail call double @log(double %38)
store double %39, double* %37
%40 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 12
%41 = load double, double* %40
%42 = tail call double @log(double %41)
store double %42, double* %40
%43 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 13
%44 = load double, double* %43
%45 = tail call double @log(double %44)
store double %45, double* %43
%46 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 14
%47 = load double, double* %46
%48 = tail call double @log(double %47)
store double %48, double* %46
%49 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 15
%50 = load double, double* %49
%51 = tail call double @log(double %50)
store double %51, double* %49
%52 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 16
%53 = load double, double* %52
%54 = tail call double @log(double %53)
store double %54, double* %52
%55 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 17
%56 = load double, double* %55
%57 = tail call double @log(double %56)
store double %57, double* %55
%58 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 18
%59 = load double, double* %58
%60 = tail call double @log(double %59)
store double %60, double* %58
%61 = getelementptr inbounds [20 x double], [20 x double]* %0, i64 %3, i64 19
%62 = load double, double* %61
%63 = tail call double @log(double %62)
store double %63, double* %61
%64 = add nuw nsw i64 %3, 1
%65 = icmp eq i64 %64, 20
br i1 %65, label %66, label %2
66: ; preds = %2
ret void
}