#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*/ printf(char *, int, unsigned int, ...);
int main(void) {
  unsigned int f1 = 1, f2 = 1, f3;
  printf("[%3d]%12u\n[%3d]%12u\n", 1, f1, 2, f2);
  for (int i = 3; i <= 40; i++) {
    f3 = f1 + f2;
    printf("[%3d]%12u\n", i, f3);
    f1 = f2;
    f2 = f3;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%r8d
lea    0xec5(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x14(%rbp)
cmpl   $0x28,-0x14(%rbp)
jg     1194 <main+0x84>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <main+0x43>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xee1(%rip),%rdi
mov    $0x1,%r15d
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%ebx
lea    0xebd(%rip),%r14
mov    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15d,%ebp
add    %r12d,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %r12d,%r15d
mov    %ebp,%r12d
cmp    $0x29,%ebx
jne    1160 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"[%3d]%12u\0A[%3d]%12u\0A\00"
@.str.1 = [11 x i8] c"[%3d]%12u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1, i32 %6, i32 2, i32 %7)
store i32 3, i32* %5
br label %9
9: ; preds = %21, %0
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 40
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %17)
%19 = load i32, i32* %3
store i32 %19, i32* %2
%20 = load i32, i32* %4
store i32 %20, i32* %3
br label %21
21: ; preds = %12
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %9
24: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"[%3d]%12u\0A[%3d]%12u\0A\00"
@.str.1 = [11 x i8] c"[%3d]%12u\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 2, i32 1)
br label %3
2: ; preds = %3
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 3, %0 ], [ %9, %3 ]
%5 = phi i32 [ 1, %0 ], [ %6, %3 ]
%6 = phi i32 [ 1, %0 ], [ %7, %3 ]
%7 = add i32 %5, %6
%8 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %7)
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 41
br i1 %10, label %2, label %3
}