#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 suma = 0, a = 0, b = 1, x;
  printf("introduzca un numero: ");
  scanf("%d", &x);
  while (suma <= x) {
    suma = b + a;
    a = b;
    b = suma;
    if (suma == x) {
      printf("%d ,", suma);
    } else if (suma != x) {
      printf("%d ,", suma);
    }
    suma++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11d5 <main+0xb5>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11a5 <main+0x85>
mov    -0x8(%rbp),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     11c2 <main+0xa2>
mov    -0x8(%rbp),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x42>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
js     117a <main+0x5a>
mov    $0x1,%eax
lea    0xec0(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %eax,%ebx
add    %eax,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%eax
cmp    0xc(%rsp),%ebp
mov    %ebx,%ebp
jl     1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"introduzca un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%d ,\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 0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
br label %8
8: ; preds = %32, %0
%9 = load i32, i32* %2
%10 = load i32, i32* %5
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %35
12: ; preds = %8
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
store i32 %15, i32* %2
%16 = load i32, i32* %4
store i32 %16, i32* %3
%17 = load i32, i32* %2
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %12
%22 = load i32, i32* %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %22)
br label %32
24: ; preds = %12
%25 = load i32, i32* %2
%26 = load i32, i32* %5
%27 = icmp ne i32 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %24
br label %32
32: ; preds = %31, %21
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %8
35: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"introduzca un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 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 ([23 x i8], [23 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 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %10, %7 ], [ 1, %0 ]
%9 = phi i32 [ %8, %7 ], [ 0, %0 ]
%10 = add nsw i32 %8, %9
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
%13 = icmp slt i32 %10, %12
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}