#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*/ print_debug(char *);
int /*<<< orphan*/ print_debug_hex32(unsigned long);
int /*<<< orphan*/ ram_fill(unsigned long, unsigned long);
int /*<<< orphan*/ ram_verify(unsigned long, unsigned long);
void ramcheck(unsigned long start, unsigned long stop) {
  int result;
  print_debug("Testing DRAM : ");
  print_debug_hex32(start);
  print_debug("-");
  print_debug_hex32(stop);
  print_debug("\r\n");
  ram_fill(start, stop);
  ram_verify(start, stop);
  print_debug("Done.\n");
}


x86 assembly (clang, -O0):
<ramcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea9(%rip),%rdi
call   1060 <print_debug@plt>
mov    -0x8(%rbp),%rdi
call   1040 <print_debug_hex32@plt>
lea    0xea4(%rip),%rdi
call   1060 <print_debug@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_debug_hex32@plt>
lea    0xe91(%rip),%rdi
call   1060 <print_debug@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ram_fill@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <ram_verify@plt>
lea    0xe6e(%rip),%rdi
call   1060 <print_debug@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ramcheck>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeaf(%rip),%rdi
call   1060 <print_debug@plt>
mov    %rbx,%rdi
call   1040 <print_debug_hex32@plt>
lea    0xeab(%rip),%rdi
call   1060 <print_debug@plt>
mov    %r14,%rdi
call   1040 <print_debug_hex32@plt>
lea    0xe99(%rip),%rdi
call   1060 <print_debug@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ram_fill@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <ram_verify@plt>
lea    0xe7a(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <print_debug@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Testing DRAM : \00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [7 x i8] c"Done.\0A\00"
define void @ramcheck(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = call i32 @print_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i64, i64* %3
%8 = call i32 @print_debug_hex32(i64 %7)
%9 = call i32 @print_debug(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i64, i64* %4
%11 = call i32 @print_debug_hex32(i64 %10)
%12 = call i32 @print_debug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = call i32 @ram_fill(i64 %13, i64 %14)
%16 = load i64, i64* %3
%17 = load i64, i64* %4
%18 = call i32 @ram_verify(i64 %16, i64 %17)
%19 = call i32 @print_debug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Testing DRAM : \00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
@.str.3 = [7 x i8] c"Done.\0A\00"
define void @ramcheck(i64 %0, i64 %1) {
%3 = tail call i32 @print_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @print_debug_hex32(i64 %0)
%5 = tail call i32 @print_debug(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @print_debug_hex32(i64 %1)
%7 = tail call i32 @print_debug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @ram_fill(i64 %0, i64 %1)
%9 = tail call i32 @ram_verify(i64 %0, i64 %1)
%10 = tail call i32 @print_debug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}