void main() {
  const int f_0 = 1;
  int f[1000];
  int num;
  int i;
  int n;
  f[0] = f_0;
  f[1] = f_0;
  scanf(n);
  if (n <= 2) {
    print(0);
    return;
  }
  if (n > 1000) {
    print(1);
    return;
  }
  i = 0;
  print(2);
  while (i < n) {
    if (i >= 2) {
      f[i] = f[i - 1] + f[i - 2];
    }
    printf(f[i]);
    print(3);
    i = add(i);
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0xfb0(%rbp)
movl   $0x1,-0xfac(%rbp)
movslq -0xfbc(%rbp),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x2,-0xfbc(%rbp)
jg     118f <main+0x4f>
xor    %edi,%edi
mov    $0x0,%al
call   1050 <print@plt>
jmp    1256 <main+0x116>
cmpl   $0x3e8,-0xfbc(%rbp)
jle    11b0 <main+0x70>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <print@plt>
jmp    1256 <main+0x116>
movl   $0x0,-0xfb8(%rbp)
mov    $0x2,%edi
mov    $0x0,%al
call   1050 <print@plt>
mov    -0xfb8(%rbp),%eax
cmp    -0xfbc(%rbp),%eax
jge    1251 <main+0x111>
cmpl   $0x2,-0xfb8(%rbp)
jl     1217 <main+0xd7>
mov    -0xfb8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xfb0(%rbp,%rax,4),%ecx
mov    -0xfb8(%rbp),%eax
sub    $0x2,%eax
cltq
add    -0xfb0(%rbp,%rax,4),%ecx
movslq -0xfb8(%rbp),%rax
mov    %ecx,-0xfb0(%rbp,%rax,4)
movslq -0xfb8(%rbp),%rax
movslq -0xfb0(%rbp,%rax,4),%rdi
ff
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x3,%edi
mov    $0x0,%al
call   1050 <print@plt>
mov    -0xfb8(%rbp),%edi
mov    $0x0,%al
call   1030 <add@plt>
mov    %eax,-0xfb8(%rbp)
jmp    11c6 <main+0x86>
jmp    1256 <main+0x116>
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <print@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca [1000 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 1, i32* %1
%6 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 0
store i32 1, i32* %6
%7 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 1
store i32 1, i32* %7
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 (i8*, ...) @scanf(i8* %10)
%12 = load i32, i32* %5
%13 = icmp sle i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 0)
br label %57
16: ; preds = %0
%17 = load i32, i32* %5
%18 = icmp sgt i32 %17, 1000
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 1)
br label %57
21: ; preds = %16
store i32 0, i32* %4
%22 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 2)
br label %23
23: ; preds = %45, %21
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %56
27: ; preds = %23
%28 = load i32, i32* %4
%29 = icmp sge i32 %28, 2
br i1 %29, label %30, label %45
30: ; preds = %27
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = load i32, i32* %4
%37 = sub nsw i32 %36, 2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = add nsw i32 %35, %40
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 %43
store i32 %41, i32* %44
br label %45
45: ; preds = %30, %27
%46 = load i32, i32* %4
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [1000 x i32], [1000 x i32]* %2, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = sext i32 %49 to i64
%51 = inttoptr i64 %50 to i8*
%52 = call i32 (i8*, ...) @printf(i8* %51)
%53 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 3)
%54 = load i32, i32* %4
%55 = call i32 (i32, ...) bitcast (i32 (...)* @add to i32 (i32, ...)*)(i32 %54)
store i32 %55, i32* %4
br label %23
56: ; preds = %23
br label %57
57: ; preds = %56, %19, %14
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (i8*, ...) @scanf(i8* null)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 0)
ret void
}