#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int n, first = 1, second = 1, next, c;
  if (argc != 2) {
    printf("faltan o hay muchos argumentos\n");
  }
  n = atoi(argv[1]);
  for (c = 0; c < n; c++) {
    if (c <= 1)
      next = 1;
    else {
      next = first + second;
      first = second;
      second = next;
    }
    printf("%d ", next);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x3c>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c9 <main+0xa9>
cmpl   $0x1,-0x24(%rbp)
jg     1195 <main+0x75>
movl   $0x1,-0x20(%rbp)
jmp    11aa <main+0x8a>
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1173 <main+0x53>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
je     114f <main+0x1f>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
test   %eax,%eax
jle    11a4 <main+0x74>
mov    %eax,%r12d
mov    $0x1,%r15d
lea    0xe94(%rip),%r14
xor    %ebp,%ebp
mov    $0x1,%ebx
mov    $0x1,%r13d
nopl   0x0(%rax)
lea    (%rbx,%r13,1),%esi
cmp    $0x2,%ebp
cmovae %ebx,%r13d
cmovae %esi,%ebx
cmovb  %r15d,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r12d
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"faltan o hay muchos argumentos\0A\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
store i32 1, i32* %8
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %6
store i32 0, i32* %10
br label %20
20: ; preds = %37, %15
%21 = load i32, i32* %10
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %40
24: ; preds = %20
%25 = load i32, i32* %10
%26 = icmp sle i32 %25, 1
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %9
br label %34
28: ; preds = %24
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = add nsw i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %8
store i32 %32, i32* %7
%33 = load i32, i32* %9
store i32 %33, i32* %8
br label %34
34: ; preds = %28, %27
%35 = load i32, i32* %9
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %34
%38 = load i32, i32* %10
%39 = add nsw i32 %38, 1
store i32 %39, i32* %10
br label %20
40: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d \00"
@str = [31 x i8] c"faltan o hay muchos argumentos\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %6, %11
%12 = phi i32 [ %21, %11 ], [ 0, %6 ]
%13 = phi i32 [ %18, %11 ], [ 1, %6 ]
%14 = phi i32 [ %17, %11 ], [ 1, %6 ]
%15 = icmp ult i32 %12, 2
%16 = add nsw i32 %13, %14
%17 = select i1 %15, i32 %14, i32 %13
%18 = select i1 %15, i32 %13, i32 %16
%19 = select i1 %15, i32 1, i32 %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = add nuw nsw i32 %12, 1
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %11
23: ; preds = %11, %6
ret i32 0
}