#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 */
void ikj(size_t n, double A[(n)][(n)], double B[(n)][(n)], double C[(n)][(n)]) {
  size_t i, j, k;
  double r;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++)
      C[i][j] = 0.0;
    for (k = 0; k < n; k++) {
      r = A[i][k];
      for (j = 0; j < n; j++)
        C[i][j] += r * B[k][j];
    }
  }
}


x86 assembly (clang, -O0):
<ikj>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1260 <ikj+0x160>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1189 <ikj+0x89>
mov    -0x48(%rbp),%rcx
mov    -0x20(%rbp),%rax
imul   -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x30(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    114a <ikj+0x4a>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    124a <ikj+0x14a>
mov    -0x58(%rbp),%rcx
mov    -0x10(%rbp),%rax
imul   -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1234 <ikj+0x134>
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%rdx
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
imul   -0x38(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rax
mov    -0x30(%rbp),%rdx
movsd  (%rax,%rdx,8),%xmm2
mov    -0x20(%rbp),%rax
imul   -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11c9 <ikj+0xc9>
jmp    1239 <ikj+0x139>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1191 <ikj+0x91>
jmp    124f <ikj+0x14f>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1134 <ikj+0x34>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ikj>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rcx,0x8(%rsp)
mov    %rsi,0x38(%rsp)
test   %rdi,%rdi
je     13aa <ikj+0x29a>
mov    %rdi,%rbx
lea    0x0(,%rdi,8),%r13
lea    -0x4(%rdi),%r10
mov    %r10,%r11
shr    $0x2,%r11
add    $0x1,%r11
mov    %rdi,%rax
and    $0xfffffffffffffffc,%rax
mov    %rax,0x50(%rsp)
mov    %r11,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,0x48(%rsp)
mov    %rdi,%rax
neg    %rax
mov    %rax,0x60(%rsp)
lea    0x30(%rdx),%rax
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%r15
lea    0x30(%r15),%r14
lea    0x8(%rdx),%rax
mov    %rax,0x10(%rsp)
xor    %ebp,%ebp
mov    %rdx,0x30(%rsp)
mov    %r10,0x28(%rsp)
mov    %r11,0x20(%rsp)
jmp    11b8 <ikj+0xa8>
nopl   0x0(%rax)
mov    0x40(%rsp),%rbp
add    $0x1,%rbp
add    %r13,%r14
add    %r13,%r15
cmp    %rbx,%rbp
je     13aa <ikj+0x29a>
mov    %rbp,0x40(%rsp)
imul   %rbx,%rbp
mov    0x8(%rsp),%rcx
lea    (%rcx,%rbp,8),%r12
lea    (%rbx,%rbp,1),%rax
lea    (%rcx,%rax,8),%rax
mov    %rax,0x58(%rsp)
mov    %r12,%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1030 <memset@plt>
mov    0x20(%rsp),%r11
mov    0x28(%rsp),%r10
mov    0x30(%rsp),%rdx
mov    0x38(%rsp),%rax
lea    (%rax,%rbp,8),%r8
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%rdi
xor    %esi,%esi
jmp    121f <ikj+0x10f>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rsi
add    %r13,%rdi
add    %r13,%rcx
cmp    %rbx,%rsi
je     11a0 <ikj+0x90>
mov    %rsi,%rax
imul   %rbx,%rax
movsd  (%r8,%rsi,8),%xmm0
lea    (%rdx,%rax,8),%r9
cmp    $0x4,%rbx
jb     1249 <ikj+0x139>
add    %rbx,%rax
lea    (%rdx,%rax,8),%rax
cmp    %rax,%r12
jae    12c0 <ikj+0x1b0>
cmp    0x58(%rsp),%r9
jae    12c0 <ikj+0x1b0>
xor    %ebp,%ebp
mov    %rbp,%rax
test   $0x1,%bl
je     1270 <ikj+0x160>
movsd  (%r9,%rbp,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r12,%rbp,8),%xmm1
movsd  %xmm1,(%r12,%rbp,8)
mov    %rbp,%rax
or     $0x1,%rax
not    %rbp
cmp    0x60(%rsp),%rbp
je     1210 <ikj+0x100>
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%r15,%rax,8),%xmm1
movsd  %xmm1,(%r15,%rax,8)
movsd  (%rcx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%r15,%rax,8),%xmm1
movsd  %xmm1,0x8(%r15,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbx
jne    1280 <ikj+0x170>
jmp    1210 <ikj+0x100>
nopl   0x0(%rax,%rax,1)
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
cmp    $0x4,%r10
jae    12d5 <ikj+0x1c5>
xor    %eax,%eax
jmp    1357 <ikj+0x247>
mov    0x48(%rsp),%rbp
xor    %eax,%eax
nopl   0x0(%rax)
movupd -0x30(%rdi,%rax,8),%xmm2
movupd -0x20(%rdi,%rax,8),%xmm3
mulpd  %xmm1,%xmm2
movupd -0x30(%r14,%rax,8),%xmm4
addpd  %xmm2,%xmm4
movupd -0x20(%r14,%rax,8),%xmm2
movupd -0x10(%r14,%rax,8),%xmm5
movupd (%r14,%rax,8),%xmm6
mulpd  %xmm1,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm4,-0x30(%r14,%rax,8)
movupd %xmm3,-0x20(%r14,%rax,8)
movupd -0x10(%rdi,%rax,8),%xmm2
movupd (%rdi,%rax,8),%xmm3
mulpd  %xmm1,%xmm2
addpd  %xmm5,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm6,%xmm3
movupd %xmm2,-0x10(%r14,%rax,8)
movupd %xmm3,(%r14,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rbp
jne    12e0 <ikj+0x1d0>
test   $0x1,%r11b
je     1394 <ikj+0x284>
movupd (%r9,%rax,8),%xmm2
movupd 0x10(%r9,%rax,8),%xmm3
movupd (%r12,%rax,8),%xmm4
movupd 0x10(%r12,%rax,8),%xmm5
mulpd  %xmm1,%xmm2
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm3
addpd  %xmm5,%xmm3
movupd %xmm2,(%r12,%rax,8)
movupd %xmm3,0x10(%r12,%rax,8)
mov    0x50(%rsp),%rax
mov    %rax,%rbp
cmp    %rbx,%rax
je     1210 <ikj+0x100>
jmp    124b <ikj+0x13b>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ikj(i64 %0, double* %1, double* %2, double* %3) {
%5 = alloca i64
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca double
store i64 %0, i64* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%13 = load i64, i64* %5
%14 = load i64, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %5
%17 = load i64, i64* %5
%18 = load i64, i64* %5
store i64 0, i64* %9
br label %19
19: ; preds = %80, %4
%20 = load i64, i64* %9
%21 = load i64, i64* %5
%22 = icmp ult i64 %20, %21
br i1 %22, label %23, label %83
23: ; preds = %19
store i64 0, i64* %10
br label %24
24: ; preds = %35, %23
%25 = load i64, i64* %10
%26 = load i64, i64* %5
%27 = icmp ult i64 %25, %26
br i1 %27, label %28, label %38
28: ; preds = %24
%29 = load double*, double** %8
%30 = load i64, i64* %9
%31 = mul nsw i64 %30, %18
%32 = getelementptr inbounds double, double* %29, i64 %31
%33 = load i64, i64* %10
%34 = getelementptr inbounds double, double* %32, i64 %33
store double 0.000000e+00, double* %34
br label %35
35: ; preds = %28
%36 = load i64, i64* %10
%37 = add i64 %36, 1
store i64 %37, i64* %10
br label %24
38: ; preds = %24
store i64 0, i64* %11
br label %39
39: ; preds = %76, %38
%40 = load i64, i64* %11
%41 = load i64, i64* %5
%42 = icmp ult i64 %40, %41
br i1 %42, label %43, label %79
43: ; preds = %39
%44 = load double*, double** %6
%45 = load i64, i64* %9
%46 = mul nsw i64 %45, %14
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load i64, i64* %11
%49 = getelementptr inbounds double, double* %47, i64 %48
%50 = load double, double* %49
store double %50, double* %12
store i64 0, i64* %10
br label %51
51: ; preds = %72, %43
%52 = load i64, i64* %10
%53 = load i64, i64* %5
%54 = icmp ult i64 %52, %53
br i1 %54, label %55, label %75
55: ; preds = %51
%56 = load double, double* %12
%57 = load double*, double** %7
%58 = load i64, i64* %11
%59 = mul nsw i64 %58, %16
%60 = getelementptr inbounds double, double* %57, i64 %59
%61 = load i64, i64* %10
%62 = getelementptr inbounds double, double* %60, i64 %61
%63 = load double, double* %62
%64 = load double*, double** %8
%65 = load i64, i64* %9
%66 = mul nsw i64 %65, %18
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load i64, i64* %10
%69 = getelementptr inbounds double, double* %67, i64 %68
%70 = load double, double* %69
%71 = call double @llvm.fmuladd.f64(double %56, double %63, double %70)
store double %71, double* %69
br label %72
72: ; preds = %55
%73 = load i64, i64* %10
%74 = add i64 %73, 1
store i64 %74, i64* %10
br label %51
75: ; preds = %51
br label %76
76: ; preds = %75
%77 = load i64, i64* %11
%78 = add i64 %77, 1
store i64 %78, i64* %11
br label %39
79: ; preds = %39
br label %80
80: ; preds = %79
%81 = load i64, i64* %9
%82 = add i64 %81, 1
store i64 %82, i64* %9
br label %19
83: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @ikj(i64 %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = icmp eq i64 %0, 0
br i1 %5, label %143, label %6
6: ; preds = %4
%7 = shl nuw i64 %0, 3
%8 = add i64 %0, -4
%9 = lshr i64 %8, 2
%10 = add nuw nsw i64 %9, 1
%11 = icmp ult i64 %0, 4
%12 = and i64 %0, -4
%13 = and i64 %10, 1
%14 = icmp ult i64 %8, 4
%15 = and i64 %10, 9223372036854775806
%16 = icmp eq i64 %13, 0
%17 = icmp eq i64 %12, %0
%18 = and i64 %0, 1
%19 = icmp eq i64 %18, 0
%20 = sub i64 0, %0
br label %21
21: ; preds = %6, %140
%22 = phi i64 [ %141, %140 ], [ 0, %6 ]
%23 = mul i64 %22, %0
%24 = getelementptr double, double* %3, i64 %23
%25 = add i64 %23, %0
%26 = getelementptr double, double* %3, i64 %25
%27 = mul i64 %22, %0
%28 = getelementptr double, double* %3, i64 %27
%29 = bitcast double* %28 to i8*
%30 = getelementptr inbounds double, double* %1, i64 %27
br label %31
31: ; preds = %21, %137
%32 = phi i64 [ 0, %21 ], [ %138, %137 ]
%33 = mul i64 %32, %0
%34 = getelementptr inbounds double, double* %30, i64 %32
%35 = load double, double* %34
%36 = mul nsw i64 %32, %0
%37 = getelementptr inbounds double, double* %2, i64 %36
br i1 %11, label %109, label %38
38: ; preds = %31
%39 = add i64 %33, %0
%40 = getelementptr double, double* %2, i64 %39
%41 = getelementptr double, double* %2, i64 %33
%42 = icmp ult double* %24, %40
%43 = icmp ult double* %41, %26
%44 = and i1 %42, %43
br i1 %44, label %109, label %45
45: ; preds = %38
%46 = insertelement <2 x double> poison, double %35, i64 0
%47 = shufflevector <2 x double> %46, <2 x double> poison, <2 x i32> zeroinitializer
%48 = insertelement <2 x double> poison, double %35, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %14, label %89, label %50
50: ; preds = %45, %50
%51 = phi i64 [ %86, %50 ], [ 0, %45 ]
%52 = phi i64 [ %87, %50 ], [ 0, %45 ]
%53 = getelementptr inbounds double, double* %37, i64 %51
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = getelementptr inbounds double, double* %53, i64 2
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = getelementptr inbounds double, double* %28, i64 %51
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = getelementptr inbounds double, double* %59, i64 2
%63 = bitcast double* %62 to <2 x double>*
%64 = load <2 x double>, <2 x double>* %63
%65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %47, <2 x double> %55, <2 x double> %61)
%66 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %58, <2 x double> %64)
%67 = bitcast double* %59 to <2 x double>*
store <2 x double> %65, <2 x double>* %67
%68 = bitcast double* %62 to <2 x double>*
store <2 x double> %66, <2 x double>* %68
%69 = or i64 %51, 4
%70 = getelementptr inbounds double, double* %37, i64 %69
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = getelementptr inbounds double, double* %70, i64 2
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = getelementptr inbounds double, double* %28, i64 %69
%77 = bitcast double* %76 to <2 x double>*
%78 = load <2 x double>, <2 x double>* %77
%79 = getelementptr inbounds double, double* %76, i64 2
%80 = bitcast double* %79 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %47, <2 x double> %72, <2 x double> %78)
%83 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %75, <2 x double> %81)
%84 = bitcast double* %76 to <2 x double>*
store <2 x double> %82, <2 x double>* %84
%85 = bitcast double* %79 to <2 x double>*
store <2 x double> %83, <2 x double>* %85
%86 = add nuw i64 %51, 8
%87 = add i64 %52, 2
%88 = icmp eq i64 %87, %15
br i1 %88, label %89, label %50
89: ; preds = %50, %45
%90 = phi i64 [ 0, %45 ], [ %86, %50 ]
br i1 %16, label %108, label %91
91: ; preds = %89
%92 = getelementptr inbounds double, double* %37, i64 %90
%93 = bitcast double* %92 to <2 x double>*
%94 = load <2 x double>, <2 x double>* %93
%95 = getelementptr inbounds double, double* %92, i64 2
%96 = bitcast double* %95 to <2 x double>*
%97 = load <2 x double>, <2 x double>* %96
%98 = getelementptr inbounds double, double* %28, i64 %90
%99 = bitcast double* %98 to <2 x double>*
%100 = load <2 x double>, <2 x double>* %99
%101 = getelementptr inbounds double, double* %98, i64 2
%102 = bitcast double* %101 to <2 x double>*
%103 = load <2 x double>, <2 x double>* %102
%104 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %47, <2 x double> %94, <2 x double> %100)
%105 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %49, <2 x double> %97, <2 x double> %103)
%106 = bitcast double* %98 to <2 x double>*
store <2 x double> %104, <2 x double>* %106
%107 = bitcast double* %101 to <2 x double>*
store <2 x double> %105, <2 x double>* %107
br label %108
108: ; preds = %89, %91
br i1 %17, label %137, label %109
109: ; preds = %38, %31, %108
%110 = phi i64 [ 0, %38 ], [ 0, %31 ], [ %12, %108 ]
%111 = xor i64 %110, -1
br i1 %19, label %119, label %112
112: ; preds = %109
%113 = getelementptr inbounds double, double* %37, i64 %110
%114 = load double, double* %113
%115 = getelementptr inbounds double, double* %28, i64 %110
%116 = load double, double* %115
%117 = tail call double @llvm.fmuladd.f64(double %35, double %114, double %116)
store double %117, double* %115
%118 = or i64 %110, 1
br label %119
119: ; preds = %112, %109
%120 = phi i64 [ %110, %109 ], [ %118, %112 ]
%121 = icmp eq i64 %111, %20
br i1 %121, label %137, label %122
122: ; preds = %119, %122
%123 = phi i64 [ %135, %122 ], [ %120, %119 ]
%124 = getelementptr inbounds double, double* %37, i64 %123
%125 = load double, double* %124
%126 = getelementptr inbounds double, double* %28, i64 %123
%127 = load double, double* %126
%128 = tail call double @llvm.fmuladd.f64(double %35, double %125, double %127)
store double %128, double* %126
%129 = add nuw i64 %123, 1
%130 = getelementptr inbounds double, double* %37, i64 %129
%131 = load double, double* %130
%132 = getelementptr inbounds double, double* %28, i64 %129
%133 = load double, double* %132
%134 = tail call double @llvm.fmuladd.f64(double %35, double %131, double %133)
store double %134, double* %132
%135 = add nuw i64 %123, 2
%136 = icmp eq i64 %135, %0
br i1 %136, label %137, label %122
137: ; preds = %119, %122, %108
%138 = add nuw i64 %32, 1
%139 = icmp eq i64 %138, %0
br i1 %139, label %140, label %31
140: ; preds = %137
%141 = add nuw i64 %22, 1
%142 = icmp eq i64 %141, %0
br i1 %142, label %143, label %21
143: ; preds = %140, %4
ret void
}