#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 *);
main() {
  int n, F, a = 0, b = 1, i;
  printf("Введите число N:");
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    b = a + b;
    a = b - a;
  }
  F = a;
  printf("F=%d", F);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     118e <main+0x6e>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <main+0x42>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jle    119d <main+0x7d>
lea    -0x1(%rsi),%ecx
mov    %esi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1164 <main+0x44>
xor    %ecx,%ecx
mov    $0x1,%edx
jmp    1185 <main+0x65>
and    $0xfffffff8,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
xchg   %ax,%ax
add    %edx,%ecx
add    %ecx,%edx
add    %edx,%ecx
add    %ecx,%edx
add    %edx,%ecx
add    %ecx,%edx
add    %edx,%ecx
add    %ecx,%edx
add    $0xfffffff8,%esi
jne    1170 <main+0x50>
mov    %ecx,%ebx
test   %eax,%eax
je     119d <main+0x7d>
nopl   0x0(%rax,%rax,1)
mov    %edx,%ebx
add    %edx,%ecx
mov    %ecx,%edx
mov    %ebx,%ecx
add    $0xffffffff,%eax
jne    1190 <main+0x70>
lea    0xe79(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\87\D0\B8\D1\81\D0\BB\D0\BE N:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"F=%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* %4
store i32 1, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 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 = %20, %0
%10 = load i32, i32* %6
%11 = load i32, i32* %2
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = sub nsw i32 %17, %18
store i32 %19, i32* %4
br label %20
20: ; preds = %13
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %9
23: ; preds = %9
%24 = load i32, i32* %4
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\87\D0\B8\D1\81\D0\BB\D0\BE N:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"F=%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 ([29 x i8], [29 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, 1
br i1 %6, label %39, label %7
7: ; preds = %0
%8 = add i32 %5, -1
%9 = and i32 %5, 7
%10 = icmp ult i32 %8, 7
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = and i32 %5, -8
br label %13
13: ; preds = %13, %11
%14 = phi i32 [ 1, %11 ], [ %24, %13 ]
%15 = phi i32 [ 0, %11 ], [ %23, %13 ]
%16 = phi i32 [ 0, %11 ], [ %25, %13 ]
%17 = add nsw i32 %14, %15
%18 = add nsw i32 %17, %14
%19 = add nsw i32 %18, %17
%20 = add nsw i32 %19, %18
%21 = add nsw i32 %20, %19
%22 = add nsw i32 %21, %20
%23 = add nsw i32 %22, %21
%24 = add nsw i32 %23, %22
%25 = add i32 %16, 8
%26 = icmp eq i32 %25, %12
br i1 %26, label %27, label %13
27: ; preds = %13, %7
%28 = phi i32 [ undef, %7 ], [ %23, %13 ]
%29 = phi i32 [ 1, %7 ], [ %24, %13 ]
%30 = phi i32 [ 0, %7 ], [ %23, %13 ]
%31 = icmp eq i32 %9, 0
br i1 %31, label %39, label %32
32: ; preds = %27, %32
%33 = phi i32 [ %36, %32 ], [ %29, %27 ]
%34 = phi i32 [ %33, %32 ], [ %30, %27 ]
%35 = phi i32 [ %37, %32 ], [ 0, %27 ]
%36 = add nsw i32 %33, %34
%37 = add i32 %35, 1
%38 = icmp eq i32 %37, %9
br i1 %38, label %39, label %32
39: ; preds = %27, %32, %0
%40 = phi i32 [ 0, %0 ], [ %28, %27 ], [ %33, %32 ]
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %40)
ret i32 0
}