#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(double **, double **);
int /*<<< orphan*/ init(double **, double **, int);
int /*<<< orphan*/ work(double **, double **, double **, int);
int /*<<< orphan*/ work_ref(double **, double **, double **, int);
int main() {
  double a[128][128], b[128][128], c[128][128], c_ref[128][128];
  init(a, b, 128);
  work(a, b, c, 128);
  work_ref(a, b, c_ref, 128);
  check(c, c_ref);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20010(%rbp),%rdi
lea    -0x40010(%rbp),%rsi
mov    $0x80,%edx
call   1040 <init@plt>
lea    -0x20010(%rbp),%rdi
lea    -0x40010(%rbp),%rsi
lea    -0x60010(%rbp),%rdx
mov    $0x80,%ecx
call   1030 <work@plt>
lea    -0x20010(%rbp),%rdi
lea    -0x40010(%rbp),%rsi
lea    -0x80010(%rbp),%rdx
mov    $0x80,%ecx
call   1050 <work_ref@plt>
lea    -0x60010(%rbp),%rdi
lea    -0x80010(%rbp),%rsi
call   1060 <check@plt>
xor    %eax,%eax
add    $0x80010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80008,%rsp
lea    0x60000(%rsp),%rbx
lea    0x40000(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x80,%edx
call   1040 <init@plt>
lea    0x20000(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x80,%ecx
call   1030 <work@plt>
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    $0x80,%ecx
call   1050 <work_ref@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <check@plt>
xor    %eax,%eax
add    $0x80008,%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 double]]
%3 = alloca [128 x [128 x double]]
%4 = alloca [128 x [128 x double]]
%5 = alloca [128 x [128 x double]]
store i32 0, i32* %1
%6 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %2, i64 0, i64 0
%7 = bitcast [128 x double]* %6 to double**
%8 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %3, i64 0, i64 0
%9 = bitcast [128 x double]* %8 to double**
%10 = call i32 @init(double** %7, double** %9, i32 128)
%11 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %2, i64 0, i64 0
%12 = bitcast [128 x double]* %11 to double**
%13 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %3, i64 0, i64 0
%14 = bitcast [128 x double]* %13 to double**
%15 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %4, i64 0, i64 0
%16 = bitcast [128 x double]* %15 to double**
%17 = call i32 @work(double** %12, double** %14, double** %16, i32 128)
%18 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %2, i64 0, i64 0
%19 = bitcast [128 x double]* %18 to double**
%20 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %3, i64 0, i64 0
%21 = bitcast [128 x double]* %20 to double**
%22 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %5, i64 0, i64 0
%23 = bitcast [128 x double]* %22 to double**
%24 = call i32 @work_ref(double** %19, double** %21, double** %23, i32 128)
%25 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %4, i64 0, i64 0
%26 = bitcast [128 x double]* %25 to double**
%27 = getelementptr inbounds [128 x [128 x double]], [128 x [128 x double]]* %5, i64 0, i64 0
%28 = bitcast [128 x double]* %27 to double**
%29 = call i32 @check(double** %26, double** %28)
ret i32 0
}

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