void prefetchAbortException(unsigned int *address) {
  printf("********************************\r\n");
  printf("*** PREFETCH ABORT EXCEPTION ***\r\n");
  printf("*** Instruction: 0x%08X  ***\r\n", *address);
  printf("*** Address:     0x%08X  ***\r\n", address);
  printf("********************************\r\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<prefetchAbortException>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <prefetchAbortException+0x5c>

x86 assembly (clang, -O2):
<prefetchAbortException>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xf32(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%esi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
nopl   0x0(%rax,%rax,1)
jmp    1170 <prefetchAbortException+0x50>

LLVM IR (-O0):
@.str = [35 x i8] c"********************************\0D\0A\00"
@.str.1 = [35 x i8] c"*** PREFETCH ABORT EXCEPTION ***\0D\0A\00"
@.str.2 = [31 x i8] c"*** Instruction: 0x%08X ***\0D\0A\00"
@.str.3 = [31 x i8] c"*** Address: 0x%08X ***\0D\0A\00"
define void @prefetchAbortException(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %1, %11
br label %11
}

LLVM IR (-O2):
@.str.2 = [31 x i8] c"*** Instruction: 0x%08X ***\0D\0A\00"
@.str.3 = [31 x i8] c"*** Address: 0x%08X ***\0D\0A\00"
@str.4 = [34 x i8] c"*** PREFETCH ABORT EXCEPTION ***\0D\00"
@str.5 = [34 x i8] c"********************************\0D\00"
define void @prefetchAbortException(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32* %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
br label %8
8: ; preds = %1, %8
br label %8
}