#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(int);
void dnaMarkMakeLog2(double mark2[5][5][5]) {
  int i, j, k;
  for (i = 0; i < 5; i++)
    for (j = 0; j < 5; j++)
      for (k = 0; k < 5; k++)
        mark2[i][j][k] = (log(mark2[i][j][k]) / log(2));
}


x86 assembly (clang, -O0):
<dnaMarkMakeLog2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11ef <dnaMarkMakeLog2+0xdf>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11dc <dnaMarkMakeLog2+0xcc>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    11c9 <dnaMarkMakeLog2+0xb9>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%edi
call   1030 <log@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc8,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <dnaMarkMakeLog2+0x35>
jmp    11ce <dnaMarkMakeLog2+0xbe>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <dnaMarkMakeLog2+0x24>
jmp    11e1 <dnaMarkMakeLog2+0xd1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <dnaMarkMakeLog2+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnaMarkMakeLog2>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
xor    %r14d,%r14d
nop
mov    $0x20,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
cvttsd2si -0x20(%r15,%rbx,1),%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,-0x20(%r15,%rbx,1)
cvttsd2si -0x18(%r15,%rbx,1),%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,-0x18(%r15,%rbx,1)
cvttsd2si -0x10(%r15,%rbx,1),%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,-0x10(%r15,%rbx,1)
cvttsd2si -0x8(%r15,%rbx,1),%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%r15,%rbx,1)
cvttsd2si (%r15,%rbx,1),%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rbx,1)
add    $0x28,%rbx
cmp    $0xe8,%rbx
jne    1130 <dnaMarkMakeLog2+0x20>
add    $0x1,%r14
add    $0xc8,%r15
cmp    $0x5,%r14
jne    1120 <dnaMarkMakeLog2+0x10>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @dnaMarkMakeLog2([5 x [5 x double]]* %0) {
%2 = alloca [5 x [5 x double]]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [5 x [5 x double]]* %0, [5 x [5 x double]]** %2
store i32 0, i32* %3
br label %6
6: ; preds = %51, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %54
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %47, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %50
13: ; preds = %10
store i32 0, i32* %5
br label %14
14: ; preds = %43, %13
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %46
17: ; preds = %14
%18 = load [5 x [5 x double]]*, [5 x [5 x double]]** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %18, i64 %20
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %21, i64 0, i64 %23
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [5 x double], [5 x double]* %24, i64 0, i64 %26
%28 = load double, double* %27
%29 = fptosi double %28 to i32
%30 = call double @log(i32 %29)
%31 = call double @log(i32 2)
%32 = fdiv double %30, %31
%33 = load [5 x [5 x double]]*, [5 x [5 x double]]** %2
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %33, i64 %35
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %36, i64 0, i64 %38
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x double], [5 x double]* %39, i64 0, i64 %41
store double %32, double* %42
br label %43
43: ; preds = %17
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %14
46: ; preds = %14
br label %47
47: ; preds = %46
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %10
50: ; preds = %10
br label %51
51: ; preds = %50
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %6
54: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @dnaMarkMakeLog2([5 x [5 x double]]* nocapture %0) {
br label %2
2: ; preds = %1, %38
%3 = phi i64 [ 0, %1 ], [ %39, %38 ]
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %36, %4 ]
%6 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %0, i64 %3, i64 %5, i64 0
%7 = load double, double* %6
%8 = fptosi double %7 to i32
%9 = tail call double @log(i32 %8)
%10 = tail call double @log(i32 2)
%11 = fdiv double %9, %10
store double %11, double* %6
%12 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %0, i64 %3, i64 %5, i64 1
%13 = load double, double* %12
%14 = fptosi double %13 to i32
%15 = tail call double @log(i32 %14)
%16 = tail call double @log(i32 2)
%17 = fdiv double %15, %16
store double %17, double* %12
%18 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %0, i64 %3, i64 %5, i64 2
%19 = load double, double* %18
%20 = fptosi double %19 to i32
%21 = tail call double @log(i32 %20)
%22 = tail call double @log(i32 2)
%23 = fdiv double %21, %22
store double %23, double* %18
%24 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %0, i64 %3, i64 %5, i64 3
%25 = load double, double* %24
%26 = fptosi double %25 to i32
%27 = tail call double @log(i32 %26)
%28 = tail call double @log(i32 2)
%29 = fdiv double %27, %28
store double %29, double* %24
%30 = getelementptr inbounds [5 x [5 x double]], [5 x [5 x double]]* %0, i64 %3, i64 %5, i64 4
%31 = load double, double* %30
%32 = fptosi double %31 to i32
%33 = tail call double @log(i32 %32)
%34 = tail call double @log(i32 2)
%35 = fdiv double %33, %34
store double %35, double* %30
%36 = add nuw nsw i64 %5, 1
%37 = icmp eq i64 %36, 5
br i1 %37, label %38, label %4
38: ; preds = %4
%39 = add nuw nsw i64 %3, 1
%40 = icmp eq i64 %39, 5
br i1 %40, label %41, label %2
41: ; preds = %38
ret void
}