#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*/ cache_disable();
int /*<<< orphan*/ cache_enable();
scalar_t__ ddramtest1(int, double volatile *, int);
scalar_t__ ddramtest2(int, double volatile *, int);
scalar_t__ dtramtest(int, int, int, int, int);
int /*<<< orphan*/ fail(int);
int /*<<< orphan*/ flush();
scalar_t__ idramtest(int, int);
scalar_t__ itramtest(int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ report_subtest(int);
int rsysreg(int);
int cramtest() {
  volatile double mrl[8 * 1024 + 8];
  int ilinesz, dlinesz, dbytes, ibytes, itmask, dtmask, isets, dsets;
  int icconf, dcconf, cachectrl;
  flush();
  cache_enable();
  icconf = rsysreg(8);
  dcconf = rsysreg(12);
  report_subtest(12);
  isets = ((icconf >> 24) & 3) + 1;
  ilinesz = 1 << (((icconf >> 16) & 7) + 2);
  ibytes = (1 << (((icconf >> 20) & 15) + 10)) * isets;
  itmask = (ilinesz - 1) | (0x80000000 - ibytes);
  dsets = ((dcconf >> 24) & 3) + 1;
  dlinesz = 1 << (((dcconf >> 16) & 7) + 2);
  dbytes = (1 << (((dcconf >> 20) & 15) + 10)) * dsets;
  dtmask = (dlinesz - 1) | (0x80000000 - dbytes);
  printf("isets: %u\n", isets);
  printf("ilinesize: %u\n", ilinesz);
  printf("ibytes: %u\n", ibytes);
  printf("itmask: %u\n", itmask);
  printf("dsets: %u\n", dsets);
  printf("dlinesize: %u\n", dlinesz);
  printf("dbytes: %u\n", dbytes);
  printf("dtmask: %u\n", dtmask);
  do {
    cachectrl = rsysreg(0);
  } while (cachectrl & ((1 << 15) | (1 << 14)));
  if (ddramtest1(dbytes, mrl, 0x55555555)) {
    fail(1);
  } else {
    printf("success\n");
  }
  if (ddramtest2(dbytes, mrl, 0xaaaaaaaa)) {
    fail(2);
  } else {
    printf("success\n");
  }
  report_subtest(10);
  cache_disable();
  printf("success\n");
  if (dtramtest(dbytes, (0xaaaaaa00 & dtmask), dtmask, dlinesz, 0xaaaaaaaa)) {
    fail(3);
  } else {
    printf("success\n");
  }
  if (dtramtest(dbytes, (0x55555500 & dtmask), dtmask, dlinesz, 0x55555555)) {
    fail(4);
  } else {
    printf("success\n");
  }
  report_subtest(11);
  if (idramtest(ibytes, 0x55555555)) {
    fail(5);
  }
  if (idramtest(ibytes, 0xaaaaaaaa)) {
    fail(6);
  }
  report_subtest(9);
  if (itramtest(ibytes, itmask, ilinesz, 0xaaaaaaaa)) {
    fail(7);
  }
  if (itramtest(ibytes, itmask, ilinesz, 0x55555555)) {
    fail(8);
  }
  flush();
  cache_enable();
  return 0;
}


x86 assembly (clang, -O0):
<cramtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10070,%rsp
mov    $0x0,%al
call   1030 <flush@plt>
mov    $0x0,%al
call   1050 <cache_enable@plt>
mov    $0x8,%edi
call   1040 <rsysreg@plt>
mov    %eax,-0x10064(%rbp)
mov    $0xc,%edi
call   1040 <rsysreg@plt>
mov    %eax,-0x10068(%rbp)
mov    $0xc,%edi
call   1060 <report_subtest@plt>
mov    -0x10064(%rbp),%eax
sar    $0x18,%eax
and    $0x3,%eax
add    $0x1,%eax
mov    %eax,-0x1005c(%rbp)
mov    -0x10064(%rbp),%ecx
sar    $0x10,%ecx
and    $0x7,%ecx
add    $0x2,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10044(%rbp)
mov    -0x10064(%rbp),%ecx
sar    $0x14,%ecx
and    $0xf,%ecx
add    $0xa,%ecx
mov    $0x1,%eax
shl    %cl,%eax
imul   -0x1005c(%rbp),%eax
mov    %eax,-0x10050(%rbp)
mov    -0x10044(%rbp),%eax
sub    $0x1,%eax
mov    $0x80000000,%ecx
sub    -0x10050(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10054(%rbp)
mov    -0x10068(%rbp),%eax
sar    $0x18,%eax
and    $0x3,%eax
add    $0x1,%eax
mov    %eax,-0x10060(%rbp)
mov    -0x10068(%rbp),%ecx
sar    $0x10,%ecx
and    $0x7,%ecx
add    $0x2,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x10048(%rbp)
mov    -0x10068(%rbp),%ecx
sar    $0x14,%ecx
and    $0xf,%ecx
add    $0xa,%ecx
mov    $0x1,%eax
shl    %cl,%eax
imul   -0x10060(%rbp),%eax
mov    %eax,-0x1004c(%rbp)
mov    -0x10048(%rbp),%eax
sub    $0x1,%eax
mov    $0x80000000,%ecx
sub    -0x1004c(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10058(%rbp)
mov    -0x1005c(%rbp),%esi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x10044(%rbp),%esi
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x10050(%rbp),%esi
lea    0xd02(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x10054(%rbp),%esi
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x10060(%rbp),%esi
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x10048(%rbp),%esi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x1004c(%rbp),%esi
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x10058(%rbp),%esi
lea    0xcdc(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
xor    %edi,%edi
call   1040 <rsysreg@plt>
mov    %eax,-0x1006c(%rbp)
mov    -0x1006c(%rbp),%eax
and    $0xc000,%eax
cmp    $0x0,%eax
jne    1383 <cramtest+0x1c3>
mov    -0x1004c(%rbp),%edi
lea    -0x10040(%rbp),%rsi
mov    $0x55555555,%edx
call   10e0 <ddramtest1@plt>
cmp    $0x0,%rax
je     13d4 <cramtest+0x214>
mov    $0x1,%edi
call   1070 <fail@plt>
jmp    13e2 <cramtest+0x222>
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x1004c(%rbp),%edi
lea    -0x10040(%rbp),%rsi
mov    $0xaaaaaaaa,%edx
call   10b0 <ddramtest2@plt>
cmp    $0x0,%rax
je     1412 <cramtest+0x252>
mov    $0x2,%edi
call   1070 <fail@plt>
jmp    1420 <cramtest+0x260>
lea    0xc4b(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0xa,%edi
call   1060 <report_subtest@plt>
mov    $0x0,%al
call   1080 <cache_disable@plt>
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x1004c(%rbp),%edi
mov    -0x10058(%rbp),%esi
and    $0xaaaaaa00,%esi
mov    -0x10058(%rbp),%edx
mov    -0x10048(%rbp),%ecx
mov    $0xaaaaaaaa,%r8d
call   10d0 <dtramtest@plt>
cmp    $0x0,%rax
je     1481 <cramtest+0x2c1>
mov    $0x3,%edi
call   1070 <fail@plt>
jmp    148f <cramtest+0x2cf>
lea    0xbdc(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x1004c(%rbp),%edi
mov    -0x10058(%rbp),%esi
and    $0x55555500,%esi
mov    -0x10058(%rbp),%edx
mov    -0x10048(%rbp),%ecx
mov    $0x55555555,%r8d
call   10d0 <dtramtest@plt>
cmp    $0x0,%rax
je     14d1 <cramtest+0x311>
mov    $0x4,%edi
call   1070 <fail@plt>
jmp    14df <cramtest+0x31f>
lea    0xb8c(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0xb,%edi
call   1060 <report_subtest@plt>
mov    -0x10050(%rbp),%edi
mov    $0x55555555,%esi
call   10c0 <idramtest@plt>
cmp    $0x0,%rax
je     150d <cramtest+0x34d>
mov    $0x5,%edi
call   1070 <fail@plt>
mov    -0x10050(%rbp),%edi
mov    $0xaaaaaaaa,%esi
call   10c0 <idramtest@plt>
cmp    $0x0,%rax
je     1531 <cramtest+0x371>
mov    $0x6,%edi
call   1070 <fail@plt>
mov    $0x9,%edi
call   1060 <report_subtest@plt>
mov    -0x10050(%rbp),%edi
mov    -0x10054(%rbp),%esi
mov    -0x10044(%rbp),%edx
mov    $0xaaaaaaaa,%ecx
call   10a0 <itramtest@plt>
cmp    $0x0,%rax
je     156b <cramtest+0x3ab>
mov    $0x7,%edi
call   1070 <fail@plt>
mov    -0x10050(%rbp),%edi
mov    -0x10054(%rbp),%esi
mov    -0x10044(%rbp),%edx
mov    $0x55555555,%ecx
call   10a0 <itramtest@plt>
cmp    $0x0,%rax
je     159b <cramtest+0x3db>
mov    $0x8,%edi
call   1070 <fail@plt>
mov    $0x0,%al
call   1030 <flush@plt>
mov    $0x0,%al
call   1050 <cache_enable@plt>
xor    %eax,%eax
add    $0x10070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cramtest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10068,%rsp
xor    %eax,%eax
call   1030 <flush@plt>
xor    %eax,%eax
call   1050 <cache_enable@plt>
mov    $0x8,%edi
call   1040 <rsysreg@plt>
mov    %eax,%ebx
mov    $0xc,%edi
call   1040 <rsysreg@plt>
mov    %eax,%r15d
mov    $0xc,%edi
call   1070 <report_subtest@plt>
mov    %ebx,%esi
shr    $0x18,%esi
and    $0x3,%esi
mov    %ebx,%ecx
shr    $0x10,%ecx
and    $0x7,%cl
mov    $0x4,%edx
shl    %cl,%edx
add    $0x1,%esi
mov    $0x4,%edi
shr    $0x14,%ebx
and    $0xf,%bl
mov    $0x400,%ebp
mov    %ebx,%ecx
shl    %cl,%ebp
mov    $0x400,%ebx
imul   %esi,%ebp
lea    -0x1(%rdx),%eax
mov    $0x80000000,%r13d
mov    $0x80000000,%r12d
sub    %ebp,%r12d
or     %eax,%r12d
mov    %r15d,%r14d
shr    $0x18,%r14d
and    $0x3,%r14d
add    $0x1,%r14d
mov    %r15d,%ecx
shr    $0x10,%ecx
and    $0x7,%cl
shl    %cl,%edi
mov    %rdi,0x18(%rsp)
shr    $0x14,%r15d
and    $0xf,%r15b
mov    %r15d,%ecx
mov    %rdx,%r15
shl    %cl,%ebx
imul   %r14d,%ebx
lea    -0x1(%rdi),%eax
sub    %ebx,%r13d
or     %eax,%r13d
lea    0xd60(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd5d(%rip),%rdi
mov    %r15,0x10(%rsp)
mov    %r15d,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd56(%rip),%rdi
mov    %ebp,0x8(%rsp)
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd4e(%rip),%rdi
mov    %r12d,0xc(%rsp)
mov    %r12d,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd44(%rip),%rdi
mov    %r14d,%esi
mov    0x18(%rsp),%r14
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd39(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd37(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xd33(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
nop
xor    %edi,%edi
call   1040 <rsysreg@plt>
test   $0xc000,%eax
jne    1330 <cramtest+0x160>
lea    0x20(%rsp),%rsi
mov    %ebx,%edi
mov    $0x55555555,%edx
call   10f0 <ddramtest1@plt>
test   %rax,%rax
je     1360 <cramtest+0x190>
mov    $0x1,%edi
call   1080 <fail@plt>
jmp    136c <cramtest+0x19c>
lea    0xcfd(%rip),%rdi
call   1060 <puts@plt>
lea    0x20(%rsp),%rsi
mov    %ebx,%edi
mov    $0xaaaaaaaa,%edx
call   10c0 <ddramtest2@plt>
test   %rax,%rax
je     138e <cramtest+0x1be>
mov    $0x2,%edi
call   1080 <fail@plt>
jmp    139a <cramtest+0x1ca>
lea    0xccf(%rip),%rdi
call   1060 <puts@plt>
mov    $0xa,%edi
call   1070 <report_subtest@plt>
xor    %eax,%eax
call   1090 <cache_disable@plt>
lea    0xcb2(%rip),%rdi
call   1060 <puts@plt>
mov    %r13d,%esi
and    $0xaaaaaa00,%esi
mov    %ebx,%edi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    $0xaaaaaaaa,%r8d
call   10e0 <dtramtest@plt>
test   %rax,%rax
je     13e4 <cramtest+0x214>
mov    $0x3,%edi
call   1080 <fail@plt>
jmp    13f0 <cramtest+0x220>
lea    0xc79(%rip),%rdi
call   1060 <puts@plt>
mov    %r13d,%esi
and    $0x55555500,%esi
mov    %ebx,%edi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    $0x55555555,%r8d
call   10e0 <dtramtest@plt>
test   %rax,%rax
je     141d <cramtest+0x24d>
mov    $0x4,%edi
call   1080 <fail@plt>
jmp    1429 <cramtest+0x259>
lea    0xc40(%rip),%rdi
call   1060 <puts@plt>
mov    0xc(%rsp),%ebx
mov    0x8(%rsp),%ebp
mov    $0xb,%edi
call   1070 <report_subtest@plt>
mov    %ebp,%edi
mov    $0x55555555,%esi
call   10d0 <idramtest@plt>
test   %rax,%rax
je     1456 <cramtest+0x286>
mov    $0x5,%edi
call   1080 <fail@plt>
mov    %ebp,%edi
mov    $0xaaaaaaaa,%esi
call   10d0 <idramtest@plt>
test   %rax,%rax
je     1471 <cramtest+0x2a1>
mov    $0x6,%edi
call   1080 <fail@plt>
mov    $0x9,%edi
call   1070 <report_subtest@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    0x10(%rsp),%rdx
mov    $0xaaaaaaaa,%ecx
call   10b0 <itramtest@plt>
test   %rax,%rax
je     149d <cramtest+0x2cd>
mov    $0x7,%edi
call   1080 <fail@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    0x10(%rsp),%rdx
mov    $0x55555555,%ecx
call   10b0 <itramtest@plt>
test   %rax,%rax
je     14bf <cramtest+0x2ef>
mov    $0x8,%edi
call   1080 <fail@plt>
xor    %eax,%eax
call   1030 <flush@plt>
xor    %eax,%eax
call   1050 <cache_enable@plt>
xor    %eax,%eax
add    $0x10068,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"isets: %u\0A\00"
@.str.1 = [15 x i8] c"ilinesize: %u\0A\00"
@.str.2 = [12 x i8] c"ibytes: %u\0A\00"
@.str.3 = [12 x i8] c"itmask: %u\0A\00"
@.str.4 = [11 x i8] c"dsets: %u\0A\00"
@.str.5 = [15 x i8] c"dlinesize: %u\0A\00"
@.str.6 = [12 x i8] c"dbytes: %u\0A\00"
@.str.7 = [12 x i8] c"dtmask: %u\0A\00"
@.str.8 = [9 x i8] c"success\0A\00"
define i32 @cramtest() {
%1 = alloca [8200 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = call i32 (...) @flush()
%14 = call i32 (...) @cache_enable()
%15 = call i32 @rsysreg(i32 8)
store i32 %15, i32* %10
%16 = call i32 @rsysreg(i32 12)
store i32 %16, i32* %11
%17 = call i32 @report_subtest(i32 12)
%18 = load i32, i32* %10
%19 = ashr i32 %18, 24
%20 = and i32 %19, 3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
%22 = load i32, i32* %10
%23 = ashr i32 %22, 16
%24 = and i32 %23, 7
%25 = add nsw i32 %24, 2
%26 = shl i32 1, %25
store i32 %26, i32* %2
%27 = load i32, i32* %10
%28 = ashr i32 %27, 20
%29 = and i32 %28, 15
%30 = add nsw i32 %29, 10
%31 = shl i32 1, %30
%32 = load i32, i32* %8
%33 = mul nsw i32 %31, %32
store i32 %33, i32* %5
%34 = load i32, i32* %2
%35 = sub nsw i32 %34, 1
%36 = load i32, i32* %5
%37 = sub i32 -2147483648, %36
%38 = or i32 %35, %37
store i32 %38, i32* %6
%39 = load i32, i32* %11
%40 = ashr i32 %39, 24
%41 = and i32 %40, 3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
%43 = load i32, i32* %11
%44 = ashr i32 %43, 16
%45 = and i32 %44, 7
%46 = add nsw i32 %45, 2
%47 = shl i32 1, %46
store i32 %47, i32* %3
%48 = load i32, i32* %11
%49 = ashr i32 %48, 20
%50 = and i32 %49, 15
%51 = add nsw i32 %50, 10
%52 = shl i32 1, %51
%53 = load i32, i32* %9
%54 = mul nsw i32 %52, %53
store i32 %54, i32* %4
%55 = load i32, i32* %3
%56 = sub nsw i32 %55, 1
%57 = load i32, i32* %4
%58 = sub i32 -2147483648, %57
%59 = or i32 %56, %58
store i32 %59, i32* %7
%60 = load i32, i32* %8
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %60)
%62 = load i32, i32* %2
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %62)
%64 = load i32, i32* %5
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %6
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %9
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %3
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %70)
%72 = load i32, i32* %4
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %7
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %74)
br label %76
76: ; preds = %78, %0
%77 = call i32 @rsysreg(i32 0)
store i32 %77, i32* %12
br label %78
78: ; preds = %76
%79 = load i32, i32* %12
%80 = and i32 %79, 49152
%81 = icmp ne i32 %80, 0
br i1 %81, label %76, label %82
82: ; preds = %78
%83 = load i32, i32* %4
%84 = getelementptr inbounds [8200 x double], [8200 x double]* %1, i64 0, i64 0
%85 = call i64 @ddramtest1(i32 %83, double* %84, i32 1431655765)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %82
%88 = call i32 @fail(i32 1)
br label %91
89: ; preds = %82
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %91
91: ; preds = %89, %87
%92 = load i32, i32* %4
%93 = getelementptr inbounds [8200 x double], [8200 x double]* %1, i64 0, i64 0
%94 = call i64 @ddramtest2(i32 %92, double* %93, i32 -1431655766)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %91
%97 = call i32 @fail(i32 2)
br label %100
98: ; preds = %91
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %100
100: ; preds = %98, %96
%101 = call i32 @report_subtest(i32 10)
%102 = call i32 (...) @cache_disable()
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%104 = load i32, i32* %4
%105 = load i32, i32* %7
%106 = and i32 -1431655936, %105
%107 = load i32, i32* %7
%108 = load i32, i32* %3
%109 = call i64 @dtramtest(i32 %104, i32 %106, i32 %107, i32 %108, i32 -1431655766)
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %113
111: ; preds = %100
%112 = call i32 @fail(i32 3)
br label %115
113: ; preds = %100
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %115
115: ; preds = %113, %111
%116 = load i32, i32* %4
%117 = load i32, i32* %7
%118 = and i32 1431655680, %117
%119 = load i32, i32* %7
%120 = load i32, i32* %3
%121 = call i64 @dtramtest(i32 %116, i32 %118, i32 %119, i32 %120, i32 1431655765)
%122 = icmp ne i64 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %115
%124 = call i32 @fail(i32 4)
br label %127
125: ; preds = %115
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %127
127: ; preds = %125, %123
%128 = call i32 @report_subtest(i32 11)
%129 = load i32, i32* %5
%130 = call i64 @idramtest(i32 %129, i32 1431655765)
%131 = icmp ne i64 %130, 0
br i1 %131, label %132, label %134
132: ; preds = %127
%133 = call i32 @fail(i32 5)
br label %134
134: ; preds = %132, %127
%135 = load i32, i32* %5
%136 = call i64 @idramtest(i32 %135, i32 -1431655766)
%137 = icmp ne i64 %136, 0
br i1 %137, label %138, label %140
138: ; preds = %134
%139 = call i32 @fail(i32 6)
br label %140
140: ; preds = %138, %134
%141 = call i32 @report_subtest(i32 9)
%142 = load i32, i32* %5
%143 = load i32, i32* %6
%144 = load i32, i32* %2
%145 = call i64 @itramtest(i32 %142, i32 %143, i32 %144, i32 -1431655766)
%146 = icmp ne i64 %145, 0
br i1 %146, label %147, label %149
147: ; preds = %140
%148 = call i32 @fail(i32 7)
br label %149
149: ; preds = %147, %140
%150 = load i32, i32* %5
%151 = load i32, i32* %6
%152 = load i32, i32* %2
%153 = call i64 @itramtest(i32 %150, i32 %151, i32 %152, i32 1431655765)
%154 = icmp ne i64 %153, 0
br i1 %154, label %155, label %157
155: ; preds = %149
%156 = call i32 @fail(i32 8)
br label %157
157: ; preds = %155, %149
%158 = call i32 (...) @flush()
%159 = call i32 (...) @cache_enable()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"isets: %u\0A\00"
@.str.1 = [15 x i8] c"ilinesize: %u\0A\00"
@.str.2 = [12 x i8] c"ibytes: %u\0A\00"
@.str.3 = [12 x i8] c"itmask: %u\0A\00"
@.str.4 = [11 x i8] c"dsets: %u\0A\00"
@.str.5 = [15 x i8] c"dlinesize: %u\0A\00"
@.str.6 = [12 x i8] c"dbytes: %u\0A\00"
@.str.7 = [12 x i8] c"dtmask: %u\0A\00"
@str.12 = [8 x i8] c"success\00"
define i32 @cramtest() {
%1 = alloca [8200 x double]
%2 = bitcast [8200 x double]* %1 to i8*
%3 = tail call i32 (...) @flush()
%4 = tail call i32 (...) @cache_enable()
%5 = tail call i32 @rsysreg(i32 8)
%6 = tail call i32 @rsysreg(i32 12)
%7 = tail call i32 @report_subtest(i32 12)
%8 = lshr i32 %5, 24
%9 = and i32 %8, 3
%10 = add nuw nsw i32 %9, 1
%11 = lshr i32 %5, 16
%12 = and i32 %11, 7
%13 = shl nuw nsw i32 4, %12
%14 = lshr i32 %5, 20
%15 = and i32 %14, 15
%16 = shl nuw nsw i32 1024, %15
%17 = mul nuw nsw i32 %16, %10
%18 = add nsw i32 %13, -1
%19 = sub nuw i32 -2147483648, %17
%20 = or i32 %19, %18
%21 = lshr i32 %6, 24
%22 = and i32 %21, 3
%23 = add nuw nsw i32 %22, 1
%24 = lshr i32 %6, 16
%25 = and i32 %24, 7
%26 = shl nuw nsw i32 4, %25
%27 = lshr i32 %6, 20
%28 = and i32 %27, 15
%29 = shl nuw nsw i32 1024, %28
%30 = mul nuw nsw i32 %29, %23
%31 = add nsw i32 %26, -1
%32 = sub nuw i32 -2147483648, %30
%33 = or i32 %32, %31
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %33)
br label %42
42: ; preds = %42, %0
%43 = tail call i32 @rsysreg(i32 0)
%44 = and i32 %43, 49152
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %42
46: ; preds = %42
%47 = getelementptr inbounds [8200 x double], [8200 x double]* %1, i64 0, i64 0
%48 = call i64 @ddramtest1(i32 %30, double* %47, i32 1431655765)
%49 = icmp eq i64 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %46
%51 = call i32 @fail(i32 1)
br label %54
52: ; preds = %46
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0))
br label %54
54: ; preds = %52, %50
%55 = call i64 @ddramtest2(i32 %30, double* %47, i32 -1431655766)
%56 = icmp eq i64 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %54
%58 = call i32 @fail(i32 2)
br label %61
59: ; preds = %54
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0))
br label %61
61: ; preds = %59, %57
%62 = call i32 @report_subtest(i32 10)
%63 = call i32 (...) @cache_disable()
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0))
%65 = and i32 %33, -1431655936
%66 = call i64 @dtramtest(i32 %30, i32 %65, i32 %33, i32 %26, i32 -1431655766)
%67 = icmp eq i64 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %61
%69 = call i32 @fail(i32 3)
br label %72
70: ; preds = %61
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0))
br label %72
72: ; preds = %70, %68
%73 = and i32 %33, 1431655680
%74 = call i64 @dtramtest(i32 %30, i32 %73, i32 %33, i32 %26, i32 1431655765)
%75 = icmp eq i64 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %72
%77 = call i32 @fail(i32 4)
br label %80
78: ; preds = %72
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0))
br label %80
80: ; preds = %78, %76
%81 = call i32 @report_subtest(i32 11)
%82 = call i64 @idramtest(i32 %17, i32 1431655765)
%83 = icmp eq i64 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %80
%85 = call i32 @fail(i32 5)
br label %86
86: ; preds = %84, %80
%87 = call i64 @idramtest(i32 %17, i32 -1431655766)
%88 = icmp eq i64 %87, 0
br i1 %88, label %91, label %89
89: ; preds = %86
%90 = call i32 @fail(i32 6)
br label %91
91: ; preds = %89, %86
%92 = call i32 @report_subtest(i32 9)
%93 = call i64 @itramtest(i32 %17, i32 %20, i32 %13, i32 -1431655766)
%94 = icmp eq i64 %93, 0
br i1 %94, label %97, label %95
95: ; preds = %91
%96 = call i32 @fail(i32 7)
br label %97
97: ; preds = %95, %91
%98 = call i64 @itramtest(i32 %17, i32 %20, i32 %13, i32 1431655765)
%99 = icmp eq i64 %98, 0
br i1 %99, label %102, label %100
100: ; preds = %97
%101 = call i32 @fail(i32 8)
br label %102
102: ; preds = %100, %97
%103 = call i32 (...) @flush()
%104 = call i32 (...) @cache_enable()
ret i32 0
}