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


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

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x960,%rsp
lea    0x640(%rsp),%r15
lea    0x320(%rsp),%r14
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x64,%ecx
call   1040 <init@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1030 <work@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
call   1050 <work_ref@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <check@plt>
xor    %eax,%eax
add    $0x960,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x double]
%4 = alloca [100 x double]
%5 = alloca [100 x double]
store i32 0, i32* %1
%6 = getelementptr inbounds [100 x double], [100 x double]* %3, i64 0, i64 0
%7 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%8 = getelementptr inbounds [100 x double], [100 x double]* %5, i64 0, i64 0
%9 = call i32 @init(double* %6, double* %7, double* %8, i32 100)
%10 = getelementptr inbounds [100 x double], [100 x double]* %3, i64 0, i64 0
%11 = getelementptr inbounds [100 x double], [100 x double]* %5, i64 0, i64 0
%12 = call i32 @work(double* %10, double* %11, i32 100)
%13 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%14 = getelementptr inbounds [100 x double], [100 x double]* %5, i64 0, i64 0
%15 = call i32 @work_ref(double* %13, double* %14, i32 100)
%16 = getelementptr inbounds [100 x double], [100 x double]* %3, i64 0, i64 0
%17 = getelementptr inbounds [100 x double], [100 x double]* %4, i64 0, i64 0
%18 = call i32 @check(double* %16, double* %17)
ret i32 0
}

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