#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 sayi;
  int m = 0;
  int e = 1;
  int k = 1;
  printf("Bir sayi giriniz = ");
  scanf("%d", &sayi);
  int i;
  for (i = 1; i < sayi; i++) {
    if (i < 2) {
      printf("%d %d ", e, k);
    } else {
      m = e + k;
      printf("%d ", m);
      k = e;
      e = m;
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d1 <main+0xb1>
cmpl   $0x2,-0x18(%rbp)
jge    1198 <main+0x78>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11be <main+0x9e>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11c3 <main+0xa3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1169 <main+0x49>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x2,0xc(%rsp)
jl     11c1 <main+0x91>
lea    0xeae(%rip),%rdi
mov    $0x1,%r15d
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     11c1 <main+0x91>
mov    $0x2,%ebx
lea    0xe87(%rip),%r14
mov    $0x1,%r12d
nopl   0x0(%rax)
mov    %r15d,%ebp
add    %r12d,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
mov    %r12d,%r15d
mov    %ebp,%r12d
cmp    0xc(%rsp),%ebx
jl     11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Bir sayi giriniz = \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"%d %d \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 ([20 x i8], [20 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 sgt i32 %5, 1
br i1 %6, label %7, label %20
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 1)
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 2
br i1 %10, label %11, label %20
11: ; preds = %7, %11
%12 = phi i32 [ %18, %11 ], [ 2, %7 ]
%13 = phi i32 [ %14, %11 ], [ 1, %7 ]
%14 = phi i32 [ %15, %11 ], [ 1, %7 ]
%15 = add nsw i32 %13, %14
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %1
%18 = add nuw nsw i32 %12, 1
%19 = icmp slt i32 %18, %17
br i1 %19, label %11, label %20
20: ; preds = %11, %7, %0
%21 = call i32 @putchar(i32 10)
ret i32 0
}