unsigned int fib(unsigned int llvm_cbe_n) {
  unsigned int llvm_cbe_tmp__17;
  unsigned int llvm_cbe_tmp__18;
  unsigned int llvm_cbe_tmp__19;
  unsigned int llvm_cbe_tmp__20;
  unsigned int llvm_cbe_tmp__21;
  unsigned int llvm_cbe_tmp__22;
  unsigned int llvm_cbe_tmp__23;
  unsigned int llvm_cbe_tmp__23__PHI_TEMPORARY;
  *(&llvm_cbe_tmp__17) = llvm_cbe_n;
  llvm_cbe_tmp__18 = *(&llvm_cbe_tmp__17);
  if ((((signed int)llvm_cbe_tmp__18) > ((signed int)2u))) {
    goto llvm_cbe_tmp__24;
  } else {
    llvm_cbe_tmp__23__PHI_TEMPORARY = 1u;
    goto llvm_cbe_tmp__25;
  }
llvm_cbe_tmp__24:
  llvm_cbe_tmp__19 = *(&llvm_cbe_tmp__17);
  llvm_cbe_tmp__20 = fib((
      ((unsigned int)(((unsigned int)llvm_cbe_tmp__19) - ((unsigned int)1u)))));
  llvm_cbe_tmp__21 = *(&llvm_cbe_tmp__17);
  llvm_cbe_tmp__22 = ((unsigned int)(((unsigned int)llvm_cbe_tmp__20) +
                                     ((unsigned int)llvm_cbe_tmp__21)));
  llvm_cbe_tmp__23__PHI_TEMPORARY = llvm_cbe_tmp__22;
  goto llvm_cbe_tmp__25;
llvm_cbe_tmp__25:
  llvm_cbe_tmp__23 = llvm_cbe_tmp__23__PHI_TEMPORARY;
  return llvm_cbe_tmp__23;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    1136 <fib+0x26>
jmp    1142 <fib+0x32>
movl   $0x1,-0x24(%rbp)
jmp    116b <fib+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1124 <fib+0x24>
lea    -0x1(%rdi),%eax
lea    -0x3(%rdi),%ecx
imul   %ecx,%eax
lea    -0x4(%rdi),%edx
imul   %rcx,%rdx
shr    %rdx
add    %edi,%eax
sub    %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fib(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
store i32 %11, i32* %3
%12 = load i32, i32* %3
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %1
br label %17
16: ; preds = %1
store i32 1, i32* %10
br label %27
17: ; preds = %15
%18 = load i32, i32* %3
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = sub i32 %19, 1
%21 = call i32 @fib(i32 %20)
store i32 %21, i32* %6
%22 = load i32, i32* %3
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = add i32 %23, %24
store i32 %25, i32* %8
%26 = load i32, i32* %8
store i32 %26, i32* %10
br label %27
27: ; preds = %17, %16
%28 = load i32, i32* %10
store i32 %28, i32* %9
%29 = load i32, i32* %9
ret i32 %29
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = add nsw i32 %0, -3
%6 = mul i32 %4, %5
%7 = zext i32 %5 to i33
%8 = add nsw i32 %0, -4
%9 = zext i32 %8 to i33
%10 = mul i33 %7, %9
%11 = lshr i33 %10, 1
%12 = trunc i33 %11 to i32
%13 = add i32 %6, %0
%14 = sub i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %3, %1
%17 = phi i32 [ 1, %1 ], [ %15, %3 ]
ret i32 %17
}