#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*/ check(float **, float **);
int /*<<< orphan*/ init(float **, float **);
int /*<<< orphan*/ init_zero(float **, float **);
int /*<<< orphan*/ matmul_depend(float **, float **, float **);
int /*<<< orphan*/ matmul_ref(float **, float **, float **);
int main() {
  float A[128][128], B[128][128], C[128][128], C_ref[128][128];
  init(A, B);
  init_zero(C, C_ref);
  matmul_depend(A, B, C);
  matmul_ref(A, B, C_ref);
  check(C, C_ref);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10010(%rbp),%rdi
lea    -0x20010(%rbp),%rsi
call   1060 <init@plt>
lea    -0x30010(%rbp),%rdi
lea    -0x40010(%rbp),%rsi
call   1050 <init_zero@plt>
lea    -0x10010(%rbp),%rdi
lea    -0x20010(%rbp),%rsi
lea    -0x30010(%rbp),%rdx
call   1030 <matmul_depend@plt>
lea    -0x10010(%rbp),%rdi
lea    -0x20010(%rbp),%rsi
lea    -0x40010(%rbp),%rdx
call   1040 <matmul_ref@plt>
lea    -0x30010(%rbp),%rdi
lea    -0x40010(%rbp),%rsi
call   1070 <check@plt>
xor    %eax,%eax
add    $0x40010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40008,%rsp
lea    0x30000(%rsp),%r15
lea    0x20000(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <init@plt>
lea    0x10000(%rsp),%rbx
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <init_zero@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <matmul_depend@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1040 <matmul_ref@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1070 <check@plt>
xor    %eax,%eax
add    $0x40008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x [128 x float]]
%3 = alloca [128 x [128 x float]]
%4 = alloca [128 x [128 x float]]
%5 = alloca [128 x [128 x float]]
store i32 0, i32* %1
%6 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %2, i64 0, i64 0
%7 = bitcast [128 x float]* %6 to float**
%8 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %3, i64 0, i64 0
%9 = bitcast [128 x float]* %8 to float**
%10 = call i32 @init(float** %7, float** %9)
%11 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %4, i64 0, i64 0
%12 = bitcast [128 x float]* %11 to float**
%13 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %5, i64 0, i64 0
%14 = bitcast [128 x float]* %13 to float**
%15 = call i32 @init_zero(float** %12, float** %14)
%16 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %2, i64 0, i64 0
%17 = bitcast [128 x float]* %16 to float**
%18 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %3, i64 0, i64 0
%19 = bitcast [128 x float]* %18 to float**
%20 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %4, i64 0, i64 0
%21 = bitcast [128 x float]* %20 to float**
%22 = call i32 @matmul_depend(float** %17, float** %19, float** %21)
%23 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %2, i64 0, i64 0
%24 = bitcast [128 x float]* %23 to float**
%25 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %3, i64 0, i64 0
%26 = bitcast [128 x float]* %25 to float**
%27 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %5, i64 0, i64 0
%28 = bitcast [128 x float]* %27 to float**
%29 = call i32 @matmul_ref(float** %24, float** %26, float** %28)
%30 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %4, i64 0, i64 0
%31 = bitcast [128 x float]* %30 to float**
%32 = getelementptr inbounds [128 x [128 x float]], [128 x [128 x float]]* %5, i64 0, i64 0
%33 = bitcast [128 x float]* %32 to float**
%34 = call i32 @check(float** %31, float** %33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [128 x [128 x float]]
%2 = alloca [128 x [128 x float]]
%3 = alloca [128 x [128 x float]]
%4 = alloca [128 x [128 x float]]
%5 = bitcast [128 x [128 x float]]* %1 to i8*
%6 = bitcast [128 x [128 x float]]* %2 to i8*
%7 = bitcast [128 x [128 x float]]* %3 to i8*
%8 = bitcast [128 x [128 x float]]* %4 to i8*
%9 = bitcast [128 x [128 x float]]* %1 to float**
%10 = bitcast [128 x [128 x float]]* %2 to float**
%11 = call i32 @init(float** %9, float** %10)
%12 = bitcast [128 x [128 x float]]* %3 to float**
%13 = bitcast [128 x [128 x float]]* %4 to float**
%14 = call i32 @init_zero(float** %12, float** %13)
%15 = call i32 @matmul_depend(float** %9, float** %10, float** %12)
%16 = call i32 @matmul_ref(float** %9, float** %10, float** %13)
%17 = call i32 @check(float** %12, float** %13)
ret i32 0
}