#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 */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ wrap_mul4(double *, double const **, double const **);
int main() {
  const unsigned Iterations = 50000000;
  const double A[4][4] = {{4.5, 1.3, 6.0, 4.1},
                          {2.5, 7.2, 7.7, 1.7},
                          {6.7, 1.3, 9.4, 1.3},
                          {1.1, 2.2, 3.0, 2.1}};
  const double B[4][4] = {{1.0, 7.9, 5.1, 3.4},
                          {6.6, 2.8, 5.4, 9.2},
                          {5.0, 4.1, 4.1, 9.9},
                          {8.4, 3.7, 9.5, 6.4}};
  double C[4][4];
  unsigned n, m;
  for (n = 0; n != Iterations; ++n)
    wrap_mul4(&C[0][0], A, B);
  for (n = 0; n != 4; ++n) {
    for (m = 0; m != 4; ++m)
      printf("%8.2f", C[n][m]);
    puts("");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2faf080,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0x80,%edx
call   1050 <memcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0xf01(%rip),%rsi
mov    $0x80,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x194(%rbp)
cmpl   $0x2faf080,-0x194(%rbp)
f0 fa 02
je     11d1 <main+0x91>
lea    -0x190(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x110(%rbp),%rdx
call   1060 <wrap_mul4@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1193 <main+0x53>
movl   $0x0,-0x194(%rbp)
cmpl   $0x4,-0x194(%rbp)
je     1260 <main+0x120>
movl   $0x0,-0x198(%rbp)
cmpl   $0x4,-0x198(%rbp)
je     1240 <main+0x100>
mov    -0x194(%rbp),%eax
mov    %eax,%ecx
lea    -0x190(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x198(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x198(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x198(%rbp)
jmp    11f2 <main+0xb2>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    11db <main+0x9b>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x188,%rsp
movaps 0xf2c(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xf0d(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe72(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xe53(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xf34(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xef6(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe7a(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe5b(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
mov    $0x2faf080,%ebp
mov    %rsp,%r14
lea    0x100(%rsp),%r15
lea    0x80(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <wrap_mul4@plt>
add    $0xffffffff,%ebp
jne    1250 <main+0x120>
movsd  (%rsp),%xmm0
lea    0xe91(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x40(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x48(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x50(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x58(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x60(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x68(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x70(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x78(%rsp),%xmm0
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x188,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.A = [4 x [4 x double]] [[4 x double] [double 4.500000e+00, double 1.300000e+00, double 6.000000e+00, double 4.100000e+00], [4 x double] [double 2.500000e+00, double 7.200000e+00, double 7.700000e+00, double 1.700000e+00], [4 x double] [double 6.700000e+00, double 1.300000e+00, double 9.400000e+00, double 1.300000e+00], [4 x double] [double 1.100000e+00, double 2.200000e+00, double 3.000000e+00, double 2.100000e+00]]
@__const.main.B = [4 x [4 x double]] [[4 x double] [double 1.000000e+00, double 7.900000e+00, double 5.100000e+00, double 3.400000e+00], [4 x double] [double 6.600000e+00, double 2.800000e+00, double 5.400000e+00, double 0x4022666666666666], [4 x double] [double 5.000000e+00, double 4.100000e+00, double 4.100000e+00, double 9.900000e+00], [4 x double] [double 8.400000e+00, double 3.700000e+00, double 9.500000e+00, double 6.400000e+00]]
@.str = [6 x i8] c"%8.2f\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x [4 x double]]
%4 = alloca [4 x [4 x double]]
%5 = alloca [4 x [4 x double]]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 50000000, i32* %2
%8 = bitcast [4 x [4 x double]]* %3 to i8*
%9 = bitcast [4 x [4 x double]]* %4 to i8*
store i32 0, i32* %6
br label %10
10: ; preds = %21, %0
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 50000000
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %5, i64 0, i64 0
%15 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%16 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 0
%17 = bitcast [4 x double]* %16 to double**
%18 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %4, i64 0, i64 0
%19 = bitcast [4 x double]* %18 to double**
%20 = call i32 @wrap_mul4(double* %15, double** %17, double** %19)
br label %21
21: ; preds = %13
%22 = load i32, i32* %6
%23 = add i32 %22, 1
store i32 %23, i32* %6
br label %10
24: ; preds = %10
store i32 0, i32* %6
br label %25
25: ; preds = %46, %24
%26 = load i32, i32* %6
%27 = icmp ne i32 %26, 4
br i1 %27, label %28, label %49
28: ; preds = %25
store i32 0, i32* %7
br label %29
29: ; preds = %41, %28
%30 = load i32, i32* %7
%31 = icmp ne i32 %30, 4
br i1 %31, label %32, label %44
32: ; preds = %29
%33 = load i32, i32* %6
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %5, i64 0, i64 %34
%36 = load i32, i32* %7
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds [4 x double], [4 x double]* %35, i64 0, i64 %37
%39 = load double, double* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %39)
br label %41
41: ; preds = %32
%42 = load i32, i32* %7
%43 = add i32 %42, 1
store i32 %43, i32* %7
br label %29
44: ; preds = %29
%45 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %6
%48 = add i32 %47, 1
store i32 %48, i32* %6
br label %25
49: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [4 x [4 x double]] [[4 x double] [double 4.500000e+00, double 1.300000e+00, double 6.000000e+00, double 4.100000e+00], [4 x double] [double 2.500000e+00, double 7.200000e+00, double 7.700000e+00, double 1.700000e+00], [4 x double] [double 6.700000e+00, double 1.300000e+00, double 9.400000e+00, double 1.300000e+00], [4 x double] [double 1.100000e+00, double 2.200000e+00, double 3.000000e+00, double 2.100000e+00]]
@__const.main.B = [4 x [4 x double]] [[4 x double] [double 1.000000e+00, double 7.900000e+00, double 5.100000e+00, double 3.400000e+00], [4 x double] [double 6.600000e+00, double 2.800000e+00, double 5.400000e+00, double 0x4022666666666666], [4 x double] [double 5.000000e+00, double 4.100000e+00, double 4.100000e+00, double 9.900000e+00], [4 x double] [double 8.400000e+00, double 3.700000e+00, double 9.500000e+00, double 6.400000e+00]]
@.str = [6 x i8] c"%8.2f\00"
define i32 @main() {
%1 = alloca [4 x [4 x double]]
%2 = alloca [4 x [4 x double]]
%3 = alloca [4 x [4 x double]]
%4 = bitcast [4 x [4 x double]]* %1 to i8*
%5 = bitcast [4 x [4 x double]]* %2 to i8*
%6 = bitcast [4 x [4 x double]]* %3 to i8*
%7 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 0, i64 0
%8 = bitcast [4 x [4 x double]]* %1 to double**
%9 = bitcast [4 x [4 x double]]* %2 to double**
br label %10
10: ; preds = %0, %10
%11 = phi i32 [ 0, %0 ], [ %13, %10 ]
%12 = call i32 @wrap_mul4(double* %7, double** %8, double** %9)
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, 50000000
br i1 %14, label %15, label %10
15: ; preds = %10
%16 = load double, double* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %16)
%18 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 0, i64 1
%19 = load double, double* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %19)
%21 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 0, i64 2
%22 = load double, double* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %22)
%24 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 0, i64 3
%25 = load double, double* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %25)
%27 = call i32 @putchar(i32 10)
%28 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 1, i64 0
%29 = load double, double* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %29)
%31 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 1, i64 1
%32 = load double, double* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %32)
%34 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 1, i64 2
%35 = load double, double* %34
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %35)
%37 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 1, i64 3
%38 = load double, double* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %38)
%40 = call i32 @putchar(i32 10)
%41 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 2, i64 0
%42 = load double, double* %41
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %42)
%44 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 2, i64 1
%45 = load double, double* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %45)
%47 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 2, i64 2
%48 = load double, double* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %48)
%50 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 2, i64 3
%51 = load double, double* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %51)
%53 = call i32 @putchar(i32 10)
%54 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 3, i64 0
%55 = load double, double* %54
%56 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %55)
%57 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 3, i64 1
%58 = load double, double* %57
%59 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %58)
%60 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 3, i64 2
%61 = load double, double* %60
%62 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %61)
%63 = getelementptr inbounds [4 x [4 x double]], [4 x [4 x double]]* %3, i64 0, i64 3, i64 3
%64 = load double, double* %63
%65 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %64)
%66 = call i32 @putchar(i32 10)
ret i32 0
}