#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 argc, const char *argv[]) {
  int numToPrint, i;
  double num1, num2, ans;
  num1 = 0;
  num2 = 1;
  printf("How many numbers would you like to print?\t");
  scanf("%d", &numToPrint);
  printf("1\t%.0f\n2\t%.0lf\n", num1, num2);
  for (i = 0; i < (numToPrint - 2); ++i) {
    ans = (num1 + num2);
    printf("%d\t%.0lf\n", i + 3, ans);
    num1 = num2;
    num2 = ans;
  }
  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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xebc(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    11e3 <main+0xc3>
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%esi
add    $0x3,%esi
movsd  -0x30(%rbp),%xmm0
lea    0xe8c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1188 <main+0x68>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeda(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xee7(%rip),%rdi
movsd  0xea9(%rip),%xmm1
xorpd  %xmm0,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0xe96(%rip),%xmm1
xorpd  %xmm0,%xmm0
cmpl   $0x3,0x4(%rsp)
jl     11b7 <main+0x97>
lea    0xeca(%rip),%r14
nopl   0x0(%rax)
movsd  %xmm1,0x10(%rsp)
addsd  %xmm1,%xmm0
lea    0x3(%rbx),%esi
mov    %r14,%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x1,%ebx
mov    0x4(%rsp),%eax
add    $0xfffffffe,%eax
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
cmp    %eax,%ebx
jl     1180 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [43 x i8] c"How many numbers would you like to print?\09\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"1\09%.0f\0A2\09%.0lf\0A\00"
@.str.3 = [10 x i8] c"%d\09%.0lf\0A\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 double
%9 = alloca double
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %8
store double 1.000000e+00, double* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%13 = load double, double* %8
%14 = load double, double* %9
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %13, double %14)
store i32 0, i32* %7
br label %16
16: ; preds = %31, %2
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 2
%20 = icmp slt i32 %17, %19
br i1 %20, label %21, label %34
21: ; preds = %16
%22 = load double, double* %8
%23 = load double, double* %9
%24 = fadd double %22, %23
store double %24, double* %10
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 3
%27 = load double, double* %10
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %26, double %27)
%29 = load double, double* %9
store double %29, double* %8
%30 = load double, double* %10
store double %30, double* %9
br label %31
31: ; preds = %21
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %16
34: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"How many numbers would you like to print?\09\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"1\09%.0f\0A2\09%.0lf\0A\00"
@.str.3 = [10 x i8] c"%d\09%.0lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 0.000000e+00, double 1.000000e+00)
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 2
br i1 %9, label %10, label %21
10: ; preds = %2, %10
%11 = phi i32 [ %17, %10 ], [ 0, %2 ]
%12 = phi double [ %14, %10 ], [ 1.000000e+00, %2 ]
%13 = phi double [ %12, %10 ], [ 0.000000e+00, %2 ]
%14 = fadd double %13, %12
%15 = add nuw nsw i32 %11, 3
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %15, double %14)
%17 = add nuw nsw i32 %11, 1
%18 = load i32, i32* %3
%19 = add nsw i32 %18, -2
%20 = icmp slt i32 %17, %19
br i1 %20, label %10, label %21
21: ; preds = %10, %2
ret i32 0
}