#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*/ base_test();
int /*<<< orphan*/ greth_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  int i;
  volatile unsigned long rgmiistatus;
  volatile unsigned long rgmiibuf[256];
  volatile unsigned long *rgmiistatusp = (unsigned long *)0x80001000;
  volatile unsigned long *rgmiiop = (unsigned long *)0x80001400;
  volatile unsigned long *rgmiiip = (unsigned long *)0x80001800;
  report_start();
  base_test();
  greth_test(0x800c0000);
  rgmiistatus = *rgmiistatusp;
  for (i = 0; i < 16; i++) {
    rgmiibuf[i] = *(rgmiiop + i);
  }
  for (i = 0; i < 16; i++) {
    rgmiibuf[i] = *(rgmiiip + i);
  }
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80001000,%eax
mov    %rax,-0x818(%rbp)
mov    $0x80001400,%eax
mov    %rax,-0x820(%rbp)
mov    $0x80001800,%eax
mov    %rax,-0x828(%rbp)
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0x800c0000,%edi
call   1040 <greth_test@plt>
mov    -0x818(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    11d6 <main+0x96>
mov    -0x820(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
movslq -0x8(%rbp),%rax
mov    %rcx,-0x810(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a3 <main+0x63>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1210 <main+0xd0>
mov    -0x828(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
movslq -0x8(%rbp),%rax
mov    %rcx,-0x810(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11dd <main+0x9d>
mov    $0x0,%al
call   1030 <report_end@plt>
mov    -0x4(%rbp),%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0x800c0000,%edi
call   1040 <greth_test@plt>
mov    $0x80001000,%eax
mov    (%rax),%rcx
mov    %rcx,0xc0(%rsp)
mov    0x400(%rax),%rcx
mov    %rcx,0x70(%rsp)
mov    0x408(%rax),%rcx
mov    %rcx,0xb8(%rsp)
mov    0x410(%rax),%rcx
mov    %rcx,0x60(%rsp)
mov    0x418(%rax),%rcx
mov    %rcx,0xb0(%rsp)
mov    0x420(%rax),%rcx
mov    %rcx,0x50(%rsp)
mov    0x428(%rax),%rcx
mov    %rcx,0xa8(%rsp)
mov    0x430(%rax),%rcx
mov    %rcx,0x40(%rsp)
mov    0x438(%rax),%rcx
mov    %rcx,0xa0(%rsp)
mov    0x440(%rax),%rcx
mov    %rcx,0x30(%rsp)
mov    0x448(%rax),%rcx
mov    %rcx,0x98(%rsp)
mov    0x450(%rax),%rcx
mov    %rcx,0x20(%rsp)
mov    0x458(%rax),%rcx
mov    %rcx,0x90(%rsp)
mov    0x460(%rax),%rcx
mov    %rcx,0x10(%rsp)
mov    0x468(%rax),%rcx
mov    %rcx,0x88(%rsp)
mov    0x470(%rax),%rcx
mov    %rcx,(%rsp)
mov    0x478(%rax),%rcx
mov    %rcx,0x80(%rsp)
mov    0x800(%rax),%rcx
mov    %rcx,0x70(%rsp)
mov    0x808(%rax),%rcx
mov    %rcx,0xb8(%rsp)
mov    0x810(%rax),%rcx
mov    %rcx,0x60(%rsp)
mov    0x818(%rax),%rcx
mov    %rcx,0xb0(%rsp)
mov    0x820(%rax),%rcx
mov    %rcx,0x50(%rsp)
mov    0x828(%rax),%rcx
mov    %rcx,0xa8(%rsp)
mov    0x830(%rax),%rcx
mov    %rcx,0x40(%rsp)
mov    0x838(%rax),%rcx
mov    %rcx,0xa0(%rsp)
mov    0x840(%rax),%rcx
mov    %rcx,0x30(%rsp)
mov    0x848(%rax),%rcx
mov    %rcx,0x98(%rsp)
mov    0x850(%rax),%rcx
mov    %rcx,0x20(%rsp)
mov    0x858(%rax),%rcx
mov    %rcx,0x90(%rsp)
mov    0x860(%rax),%rcx
mov    %rcx,0x10(%rsp)
mov    0x868(%rax),%rcx
mov    %rcx,0x88(%rsp)
mov    0x870(%rax),%rcx
mov    %rcx,(%rsp)
mov    0x878(%rax),%rax
mov    %rax,0x80(%rsp)
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
add    $0xc8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca [256 x i64]
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64*
store i32 0, i32* %1
store i64* inttoptr (i64 2147487744 to i64*), i64** %5
store i64* inttoptr (i64 2147488768 to i64*), i64** %6
store i64* inttoptr (i64 2147489792 to i64*), i64** %7
%8 = call i32 (...) @report_start()
%9 = call i32 (...) @base_test()
%10 = call i32 @greth_test(i32 -2146697216)
%11 = load i64*, i64** %5
%12 = load volatile i64, i64* %11
store volatile i64 %12, i64* %3
store i32 0, i32* %2
br label %13
13: ; preds = %25, %0
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 16
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i64*, i64** %6
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i64, i64* %17, i64 %19
%21 = load volatile i64, i64* %20
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [256 x i64], [256 x i64]* %4, i64 0, i64 %23
store volatile i64 %21, i64* %24
br label %25
25: ; preds = %16
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %13
28: ; preds = %13
store i32 0, i32* %2
br label %29
29: ; preds = %41, %28
%30 = load i32, i32* %2
%31 = icmp slt i32 %30, 16
br i1 %31, label %32, label %44
32: ; preds = %29
%33 = load i64*, i64** %7
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i64, i64* %33, i64 %35
%37 = load volatile i64, i64* %36
%38 = load i32, i32* %2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [256 x i64], [256 x i64]* %4, i64 0, i64 %39
store volatile i64 %37, i64* %40
br label %41
41: ; preds = %32
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %29
44: ; preds = %29
%45 = call i32 (...) @report_end()
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = bitcast i64* %1 to i8*
%19 = bitcast i64* %2 to i8*
%20 = bitcast i64* %3 to i8*
%21 = bitcast i64* %4 to i8*
%22 = bitcast i64* %5 to i8*
%23 = bitcast i64* %6 to i8*
%24 = bitcast i64* %7 to i8*
%25 = bitcast i64* %8 to i8*
%26 = bitcast i64* %9 to i8*
%27 = bitcast i64* %10 to i8*
%28 = bitcast i64* %11 to i8*
%29 = bitcast i64* %12 to i8*
%30 = bitcast i64* %13 to i8*
%31 = bitcast i64* %14 to i8*
%32 = bitcast i64* %15 to i8*
%33 = bitcast i64* %16 to i8*
%34 = bitcast i64* %17 to i8*
%35 = tail call i32 (...) @report_start()
%36 = tail call i32 (...) @base_test()
%37 = tail call i32 @greth_test(i32 -2146697216)
%38 = load volatile i64, i64* inttoptr (i64 2147487744 to i64*)
store volatile i64 %38, i64* %1
%39 = load volatile i64, i64* inttoptr (i64 2147488768 to i64*)
store volatile i64 %39, i64* %2
%40 = load volatile i64, i64* inttoptr (i64 2147488776 to i64*)
store volatile i64 %40, i64* %3
%41 = load volatile i64, i64* inttoptr (i64 2147488784 to i64*)
store volatile i64 %41, i64* %4
%42 = load volatile i64, i64* inttoptr (i64 2147488792 to i64*)
store volatile i64 %42, i64* %5
%43 = load volatile i64, i64* inttoptr (i64 2147488800 to i64*)
store volatile i64 %43, i64* %6
%44 = load volatile i64, i64* inttoptr (i64 2147488808 to i64*)
store volatile i64 %44, i64* %7
%45 = load volatile i64, i64* inttoptr (i64 2147488816 to i64*)
store volatile i64 %45, i64* %8
%46 = load volatile i64, i64* inttoptr (i64 2147488824 to i64*)
store volatile i64 %46, i64* %9
%47 = load volatile i64, i64* inttoptr (i64 2147488832 to i64*)
store volatile i64 %47, i64* %10
%48 = load volatile i64, i64* inttoptr (i64 2147488840 to i64*)
store volatile i64 %48, i64* %11
%49 = load volatile i64, i64* inttoptr (i64 2147488848 to i64*)
store volatile i64 %49, i64* %12
%50 = load volatile i64, i64* inttoptr (i64 2147488856 to i64*)
store volatile i64 %50, i64* %13
%51 = load volatile i64, i64* inttoptr (i64 2147488864 to i64*)
store volatile i64 %51, i64* %14
%52 = load volatile i64, i64* inttoptr (i64 2147488872 to i64*)
store volatile i64 %52, i64* %15
%53 = load volatile i64, i64* inttoptr (i64 2147488880 to i64*)
store volatile i64 %53, i64* %16
%54 = load volatile i64, i64* inttoptr (i64 2147488888 to i64*)
store volatile i64 %54, i64* %17
%55 = load volatile i64, i64* inttoptr (i64 2147489792 to i64*)
store volatile i64 %55, i64* %2
%56 = load volatile i64, i64* inttoptr (i64 2147489800 to i64*)
store volatile i64 %56, i64* %3
%57 = load volatile i64, i64* inttoptr (i64 2147489808 to i64*)
store volatile i64 %57, i64* %4
%58 = load volatile i64, i64* inttoptr (i64 2147489816 to i64*)
store volatile i64 %58, i64* %5
%59 = load volatile i64, i64* inttoptr (i64 2147489824 to i64*)
store volatile i64 %59, i64* %6
%60 = load volatile i64, i64* inttoptr (i64 2147489832 to i64*)
store volatile i64 %60, i64* %7
%61 = load volatile i64, i64* inttoptr (i64 2147489840 to i64*)
store volatile i64 %61, i64* %8
%62 = load volatile i64, i64* inttoptr (i64 2147489848 to i64*)
store volatile i64 %62, i64* %9
%63 = load volatile i64, i64* inttoptr (i64 2147489856 to i64*)
store volatile i64 %63, i64* %10
%64 = load volatile i64, i64* inttoptr (i64 2147489864 to i64*)
store volatile i64 %64, i64* %11
%65 = load volatile i64, i64* inttoptr (i64 2147489872 to i64*)
store volatile i64 %65, i64* %12
%66 = load volatile i64, i64* inttoptr (i64 2147489880 to i64*)
store volatile i64 %66, i64* %13
%67 = load volatile i64, i64* inttoptr (i64 2147489888 to i64*)
store volatile i64 %67, i64* %14
%68 = load volatile i64, i64* inttoptr (i64 2147489896 to i64*)
store volatile i64 %68, i64* %15
%69 = load volatile i64, i64* inttoptr (i64 2147489904 to i64*)
store volatile i64 %69, i64* %16
%70 = load volatile i64, i64* inttoptr (i64 2147489912 to i64*)
store volatile i64 %70, i64* %17
%71 = tail call i32 (...) @report_end()
ret i32 0
}