#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*/ 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();
  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   1050 <report_start@plt>
mov    $0x0,%al
call   1040 <base_test@plt>
mov    -0x818(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    11bc <main+0x8c>
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    1189 <main+0x59>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    11f6 <main+0xc6>
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    11c3 <main+0x93>
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   1050 <report_start@plt>
xor    %eax,%eax
call   1040 <base_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 = load i64*, i64** %5
%11 = load volatile i64, i64* %10
store volatile i64 %11, i64* %3
store i32 0, i32* %2
br label %12
12: ; preds = %24, %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 16
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i64*, i64** %6
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i64, i64* %16, i64 %18
%20 = load volatile i64, i64* %19
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [256 x i64], [256 x i64]* %4, i64 0, i64 %22
store volatile i64 %20, i64* %23
br label %24
24: ; preds = %15
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %12
27: ; preds = %12
store i32 0, i32* %2
br label %28
28: ; preds = %40, %27
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 16
br i1 %30, label %31, label %43
31: ; preds = %28
%32 = load i64*, i64** %7
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i64, i64* %32, i64 %34
%36 = load volatile i64, i64* %35
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [256 x i64], [256 x i64]* %4, i64 0, i64 %38
store volatile i64 %36, i64* %39
br label %40
40: ; preds = %31
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %28
43: ; preds = %28
%44 = call i32 (...) @report_end()
%45 = load i32, i32* %1
ret i32 %45
}

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 = load volatile i64, i64* inttoptr (i64 2147487744 to i64*)
store volatile i64 %37, i64* %1
%38 = load volatile i64, i64* inttoptr (i64 2147488768 to i64*)
store volatile i64 %38, i64* %2
%39 = load volatile i64, i64* inttoptr (i64 2147488776 to i64*)
store volatile i64 %39, i64* %3
%40 = load volatile i64, i64* inttoptr (i64 2147488784 to i64*)
store volatile i64 %40, i64* %4
%41 = load volatile i64, i64* inttoptr (i64 2147488792 to i64*)
store volatile i64 %41, i64* %5
%42 = load volatile i64, i64* inttoptr (i64 2147488800 to i64*)
store volatile i64 %42, i64* %6
%43 = load volatile i64, i64* inttoptr (i64 2147488808 to i64*)
store volatile i64 %43, i64* %7
%44 = load volatile i64, i64* inttoptr (i64 2147488816 to i64*)
store volatile i64 %44, i64* %8
%45 = load volatile i64, i64* inttoptr (i64 2147488824 to i64*)
store volatile i64 %45, i64* %9
%46 = load volatile i64, i64* inttoptr (i64 2147488832 to i64*)
store volatile i64 %46, i64* %10
%47 = load volatile i64, i64* inttoptr (i64 2147488840 to i64*)
store volatile i64 %47, i64* %11
%48 = load volatile i64, i64* inttoptr (i64 2147488848 to i64*)
store volatile i64 %48, i64* %12
%49 = load volatile i64, i64* inttoptr (i64 2147488856 to i64*)
store volatile i64 %49, i64* %13
%50 = load volatile i64, i64* inttoptr (i64 2147488864 to i64*)
store volatile i64 %50, i64* %14
%51 = load volatile i64, i64* inttoptr (i64 2147488872 to i64*)
store volatile i64 %51, i64* %15
%52 = load volatile i64, i64* inttoptr (i64 2147488880 to i64*)
store volatile i64 %52, i64* %16
%53 = load volatile i64, i64* inttoptr (i64 2147488888 to i64*)
store volatile i64 %53, i64* %17
%54 = load volatile i64, i64* inttoptr (i64 2147489792 to i64*)
store volatile i64 %54, i64* %2
%55 = load volatile i64, i64* inttoptr (i64 2147489800 to i64*)
store volatile i64 %55, i64* %3
%56 = load volatile i64, i64* inttoptr (i64 2147489808 to i64*)
store volatile i64 %56, i64* %4
%57 = load volatile i64, i64* inttoptr (i64 2147489816 to i64*)
store volatile i64 %57, i64* %5
%58 = load volatile i64, i64* inttoptr (i64 2147489824 to i64*)
store volatile i64 %58, i64* %6
%59 = load volatile i64, i64* inttoptr (i64 2147489832 to i64*)
store volatile i64 %59, i64* %7
%60 = load volatile i64, i64* inttoptr (i64 2147489840 to i64*)
store volatile i64 %60, i64* %8
%61 = load volatile i64, i64* inttoptr (i64 2147489848 to i64*)
store volatile i64 %61, i64* %9
%62 = load volatile i64, i64* inttoptr (i64 2147489856 to i64*)
store volatile i64 %62, i64* %10
%63 = load volatile i64, i64* inttoptr (i64 2147489864 to i64*)
store volatile i64 %63, i64* %11
%64 = load volatile i64, i64* inttoptr (i64 2147489872 to i64*)
store volatile i64 %64, i64* %12
%65 = load volatile i64, i64* inttoptr (i64 2147489880 to i64*)
store volatile i64 %65, i64* %13
%66 = load volatile i64, i64* inttoptr (i64 2147489888 to i64*)
store volatile i64 %66, i64* %14
%67 = load volatile i64, i64* inttoptr (i64 2147489896 to i64*)
store volatile i64 %67, i64* %15
%68 = load volatile i64, i64* inttoptr (i64 2147489904 to i64*)
store volatile i64 %68, i64* %16
%69 = load volatile i64, i64* inttoptr (i64 2147489912 to i64*)
store volatile i64 %69, i64* %17
%70 = tail call i32 (...) @report_end()
ret i32 0
}