void pop_registers_from_fault_stack(unsigned int *hardfault_args) {
  unsigned int stacked_r0;
  unsigned int stacked_r1;
  unsigned int stacked_r2;
  unsigned int stacked_r3;
  unsigned int stacked_r12;
  unsigned int stacked_lr;
  unsigned int stacked_pc;
  unsigned int stacked_psr;
  stacked_r0 = ((unsigned long)hardfault_args[0]);
  stacked_r1 = ((unsigned long)hardfault_args[1]);
  stacked_r2 = ((unsigned long)hardfault_args[2]);
  stacked_r3 = ((unsigned long)hardfault_args[3]);
  stacked_r12 = ((unsigned long)hardfault_args[4]);
  stacked_lr = ((unsigned long)hardfault_args[5]);
  stacked_pc = ((unsigned long)hardfault_args[6]);
  stacked_psr = ((unsigned long)hardfault_args[7]);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<pop_registers_from_fault_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    1157 <pop_registers_from_fault_stack+0x57>

x86 assembly (clang, -O2):
<pop_registers_from_fault_stack>:
jmp    1100 <pop_registers_from_fault_stack>

LLVM IR (-O0):
define void @pop_registers_from_fault_stack(i32* %0) {
%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
store i32* %0, i32** %2
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = zext i32 %13 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = zext i32 %18 to i64
%20 = trunc i64 %19 to i32
store i32 %20, i32* %4
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = zext i32 %23 to i64
%25 = trunc i64 %24 to i32
store i32 %25, i32* %5
%26 = load i32*, i32** %2
%27 = getelementptr inbounds i32, i32* %26, i64 3
%28 = load i32, i32* %27
%29 = zext i32 %28 to i64
%30 = trunc i64 %29 to i32
store i32 %30, i32* %6
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 4
%33 = load i32, i32* %32
%34 = zext i32 %33 to i64
%35 = trunc i64 %34 to i32
store i32 %35, i32* %7
%36 = load i32*, i32** %2
%37 = getelementptr inbounds i32, i32* %36, i64 5
%38 = load i32, i32* %37
%39 = zext i32 %38 to i64
%40 = trunc i64 %39 to i32
store i32 %40, i32* %8
%41 = load i32*, i32** %2
%42 = getelementptr inbounds i32, i32* %41, i64 6
%43 = load i32, i32* %42
%44 = zext i32 %43 to i64
%45 = trunc i64 %44 to i32
store i32 %45, i32* %9
%46 = load i32*, i32** %2
%47 = getelementptr inbounds i32, i32* %46, i64 7
%48 = load i32, i32* %47
%49 = zext i32 %48 to i64
%50 = trunc i64 %49 to i32
store i32 %50, i32* %10
br label %51
51: ; preds = %51, %1
br label %51
}

LLVM IR (-O2):
define void @pop_registers_from_fault_stack(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
br label %2
}