#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*/ matrix_pin_down(int *, int *, int *);
int main() {
  static int A[150 * 150];
  static int B[150 * 150];
  static int C[150 * 150];
  int *p_a = &A[0];
  int *p_b = &B[0];
  volatile int *p_c = &C[0];
  int f, i, k;
  matrix_pin_down(&A[0], &B[0], &C[0]);
  for (k = 0; k < 150; k++) {
    p_a = &A[0];
    for (i = 0; i < 150; i++) {
      p_b = &B[k * 150];
      *p_c = 0;
      for (f = 0; f < 150; f++)
        *p_c += *p_a++ * *p_b++;
      *p_c++;
    }
  }
  matrix_pin_down(&A[0], &B[0], &C[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2f1a(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0x18e9f(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0x2ee24(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0x2ef9(%rip),%rdi
lea    0x18e82(%rip),%rsi
lea    0x2ee0b(%rip),%rdx
call   1030 <matrix_pin_down@plt>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x96,-0x2c(%rbp)
jge    1234 <main+0x124>
lea    0x2ecb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x96,-0x28(%rbp)
jge    1221 <main+0x111>
imul   $0x96,-0x2c(%rbp),%eax
movslq %eax,%rcx
lea    0x18e32(%rip),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x24(%rbp)
cmpl   $0x96,-0x24(%rbp)
jge    1202 <main+0xf2>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
imul   (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ba <main+0xaa>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%eax
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1180 <main+0x70>
jmp    1226 <main+0x116>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1161 <main+0x51>
lea    0x2e05(%rip),%rdi
lea    0x18d8e(%rip),%rsi
lea    0x2ed17(%rip),%rdx
call   1030 <matrix_pin_down@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0x2f24(%rip),%r14
lea    0x18ead(%rip),%r15
lea    0x2ee36(%rip),%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <matrix_pin_down@plt>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
xor    %ecx,%ecx
mov    %r14,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
movl   $0x0,(%rbx)
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rsi,1),%edi
imul   (%rdx,%rsi,1),%edi
add    %edi,(%rbx)
mov    0x4(%r15,%rsi,1),%edi
imul   0x4(%rdx,%rsi,1),%edi
add    %edi,(%rbx)
mov    0x8(%r15,%rsi,1),%edi
imul   0x8(%rdx,%rsi,1),%edi
add    %edi,(%rbx)
add    $0xc,%rsi
cmp    $0x258,%esi
jne    1160 <main+0x50>
mov    (%rbx),%edi
add    $0x4,%rbx
add    $0x1,%ecx
add    %rsi,%rdx
cmp    $0x96,%ecx
jne    1150 <main+0x40>
add    $0x1,%rax
add    $0x258,%r15
cmp    $0x96,%rax
jne    1140 <main+0x30>
lea    0x2e84(%rip),%rdi
lea    0x18e0d(%rip),%rsi
lea    0x2ed96(%rip),%rdx
call   1030 <matrix_pin_down@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@main.A = internal global [22500 x i32] zeroinitializer
@main.B = internal global [22500 x i32] zeroinitializer
@main.C = internal global [22500 x i32] zeroinitializer
define i32 @main() {
%1 = tail call i32 @matrix_pin_down(i32* getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.A, i64 0, i64 0), i32* getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.B, i64 0, i64 0), i32* getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.C, i64 0, i64 0))
br label %2
2: ; preds = %0, %43
%3 = phi i64 [ 0, %0 ], [ %44, %43 ]
%4 = phi i32* [ getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.C, i64 0, i64 0), %0 ], [ %39, %43 ]
%5 = mul nuw nsw i64 %3, 150
%6 = getelementptr inbounds [22500 x i32], [22500 x i32]* @main.B, i64 0, i64 %5
br label %7
7: ; preds = %2, %38
%8 = phi i32 [ 0, %2 ], [ %41, %38 ]
%9 = phi i32* [ %4, %2 ], [ %39, %38 ]
%10 = phi i32* [ getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.A, i64 0, i64 0), %2 ], [ %29, %38 ]
store volatile i32 0, i32* %9
br label %11
11: ; preds = %11, %7
%12 = phi i32 [ 0, %7 ], [ %36, %11 ]
%13 = phi i32* [ %6, %7 ], [ %31, %11 ]
%14 = phi i32* [ %10, %7 ], [ %29, %11 ]
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %14
%17 = getelementptr inbounds i32, i32* %13, i64 1
%18 = load i32, i32* %13
%19 = mul nsw i32 %18, %16
%20 = load volatile i32, i32* %9
%21 = add nsw i32 %20, %19
store volatile i32 %21, i32* %9
%22 = getelementptr inbounds i32, i32* %14, i64 2
%23 = load i32, i32* %15
%24 = getelementptr inbounds i32, i32* %13, i64 2
%25 = load i32, i32* %17
%26 = mul nsw i32 %25, %23
%27 = load volatile i32, i32* %9
%28 = add nsw i32 %27, %26
store volatile i32 %28, i32* %9
%29 = getelementptr inbounds i32, i32* %14, i64 3
%30 = load i32, i32* %22
%31 = getelementptr inbounds i32, i32* %13, i64 3
%32 = load i32, i32* %24
%33 = mul nsw i32 %32, %30
%34 = load volatile i32, i32* %9
%35 = add nsw i32 %34, %33
store volatile i32 %35, i32* %9
%36 = add nuw nsw i32 %12, 3
%37 = icmp eq i32 %36, 150
br i1 %37, label %38, label %11
38: ; preds = %11
%39 = getelementptr inbounds i32, i32* %9, i64 1
%40 = load volatile i32, i32* %9
%41 = add nuw nsw i32 %8, 1
%42 = icmp eq i32 %41, 150
br i1 %42, label %43, label %7
43: ; preds = %38
%44 = add nuw nsw i64 %3, 1
%45 = icmp eq i64 %44, 150
br i1 %45, label %46, label %2
46: ; preds = %43
%47 = tail call i32 @matrix_pin_down(i32* getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.A, i64 0, i64 0), i32* getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.B, i64 0, i64 0), i32* getelementptr inbounds ([22500 x i32], [22500 x i32]* @main.C, i64 0, i64 0))
ret i32 0
}