#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int var1 = 0, var2 = 1, fibo = 0;
  int n, i;
  printf("Digite um numero");
  scanf("%d", &n);
  printf(" 1");
  for (i = 1; i < n; i++) {
    fibo = var1 + var2;
    var1 = var2;
    var2 = fibo;
    printf("% d", fibo);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b7 <main+0x97>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1177 <main+0x57>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x2,0x4(%rsp)
jl     118f <main+0x6f>
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
mov    $0x1,%eax
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %eax,%r15d
add    %eax,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebp,%eax
mov    %r15d,%ebp
cmp    0x4(%rsp),%ebx
jl     1170 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Digite um numero\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c" 1\00"
@.str.3 = [4 x i8] c"% d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %17
8: ; preds = %0, %8
%9 = phi i32 [ %14, %8 ], [ 1, %0 ]
%10 = phi i32 [ %12, %8 ], [ 1, %0 ]
%11 = phi i32 [ %10, %8 ], [ 0, %0 ]
%12 = add nsw i32 %10, %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = add nuw nsw i32 %9, 1
%15 = load i32, i32* %1
%16 = icmp slt i32 %14, %15
br i1 %16, label %8, label %17
17: ; preds = %8, %0
ret i32 0
}