#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 *);
unsigned long fibonacci(int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    printf("Not enough input arguments! Use -h option for more info.\n");
    printf("Aborting...\n");
    return -1;
  }
  if (strlen(argv[1]) == 2 && argv[1][0] == '-' && argv[1][1] == 'h') {
    printf("Program calculates subsequent Fibonacci numbers. To run the "
           "program, type:\n");
    printf("./fibonacci num var\n");
    printf("\tnum - amount of the Fibonacci numbers\n");
    printf("\tvar - method variant (0 - normal, 1 - recursively)\n");
    printf("For help type: ./fibonacci -h\n");
    return -1;
  }
  if (argc != 3) {
    printf(
        "Error: wrong number of input parameters. To run the program, type:\n");
    printf("./fibonacci num var\n");
    printf("\tnum - amount of the Fibonacci numbers\n");
    printf("\tvar - method variant (0 - normal, 1 - recursively)\n");
    printf("For help type: ./fibonacci -h\n");
    printf("Aborting...\n");
    return -1;
  }
  int i;
  for (i = 0; i < strlen(argv[1]); i++)
    if (argv[1][i] > '9' || argv[1][i] < '0') {
      printf("<num> parameter must be integer!\n");
      printf("For help type: ./fibonacci -h\n");
      printf("Aborting...\n");
      return -1;
    }
  for (i = 0; i < strlen(argv[2]); i++)
    if (argv[2][i] != '1' && argv[2][i] != '0') {
      printf("<var> parameter must be 0 (normal method) or 1 (recursive "
             "method)!\n");
      printf("For help type: ./fibonacci -h\n");
      printf("Aborting...\n");
      return -1;
    }
  int num = atoi(argv[1]);
  int var = atoi(argv[2]);
  long unsigned int new_val, first_val = 0, second_val = 1;
  printf("Sequence of %d Fibonacci numbers:\n", num);
  switch (var) {
  case 0:
    for (i = 0; i < num; i++) {
      printf("%lu\n", first_val);
      new_val = first_val + second_val;
      first_val = second_val;
      second_val = new_val;
    }
    break;
  case 1:
    for (i = 0; i < num; i++) {
      printf("%lu\n", fibonacci(i));
    }
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1188 <main+0x48>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14cb <main+0x38b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1219 <main+0xd9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1219 <main+0xd9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x68,%eax
jne    1219 <main+0xd9>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14cb <main+0x38b>
cmpl   $0x3,-0x8(%rbp)
je     1283 <main+0x143>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14cb <main+0x38b>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jge    1325 <main+0x1e5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     12dc <main+0x19c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jge    1312 <main+0x1d2>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14cb <main+0x38b>
jmp    1317 <main+0x1d7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128a <main+0x14a>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
cmp    %ecx,%eax
jge    13c7 <main+0x287>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
je     13b4 <main+0x274>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
je     13b4 <main+0x274>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14cb <main+0x38b>
jmp    13b9 <main+0x279>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    132c <main+0x1ec>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x1,-0x38(%rbp)
mov    -0x18(%rbp),%esi
lea    0xdcd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
test   %eax,%eax
je     142c <main+0x2ec>
jmp    141b <main+0x2db>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
je     1480 <main+0x340>
jmp    14bf <main+0x37f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    147b <main+0x33b>
mov    -0x30(%rbp),%rsi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1433 <main+0x2f3>
jmp    14c4 <main+0x384>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    14ba <main+0x37a>
mov    -0x14(%rbp),%edi
call   1050 <fibonacci@plt>
mov    %rax,%rsi
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1487 <main+0x347>
jmp    14c4 <main+0x384>
jmp    14c4 <main+0x384>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x1,%edi
jne    1170 <main+0x20>
lea    0x107c(%rip),%r14
lea    0x103c(%rip),%r15
jmp    1322 <main+0x1d2>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jne    11ba <main+0x6a>
mov    0x8(%rbx),%rax
cmpb   $0x2d,(%rax)
jne    11ba <main+0x6a>
cmpb   $0x68,0x1(%rax)
jne    11ba <main+0x6a>
lea    0xff0(%rip),%r14
lea    0xfb5(%rip),%r15
lea    0xf87(%rip),%r12
lea    0xf6c(%rip),%rbx
lea    0xf1a(%rip),%rdi
jmp    130d <main+0x1bd>
cmp    $0x3,%ebp
jne    12de <main+0x18e>
mov    0x8(%rbx),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1212 <main+0xc2>
xor    %ebp,%ebp
lea    0x1007(%rip),%r14
lea    0xfa9(%rip),%r15
lea    0xe84(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    0x8(%rbx),%rdi
movzbl (%rdi,%rbp,1),%eax
add    $0xc6,%al
cmp    $0xf6,%al
jb     131a <main+0x1ca>
add    $0x1,%rbp
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     11f0 <main+0xa0>
mov    0x10(%rbx),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1262 <main+0x112>
xor    %ebp,%ebp
lea    0xfb8(%rip),%r14
lea    0xf5a(%rip),%r15
lea    0xdf2(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rbx),%rdi
movzbl (%rdi,%rbp,1),%eax
and    $0xfe,%al
cmp    $0x30,%al
jne    131a <main+0x1ca>
add    $0x1,%rbp
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1240 <main+0xf0>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%r12d
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
lea    0xd80(%rip),%rdi
xor    %r15d,%r15d
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
je     1344 <main+0x1f4>
cmp    $0x1,%ebx
jne    1338 <main+0x1e8>
test   %r12d,%r12d
jle    1338 <main+0x1e8>
xor    %r15d,%r15d
lea    0xd72(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1060 <fibonacci@plt>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    12c0 <main+0x170>
jmp    1338 <main+0x1e8>
lea    0xda7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%r14
lea    0xe91(%rip),%r15
lea    0xe56(%rip),%r12
lea    0xe28(%rip),%rbx
lea    0xe0d(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%r15d
mov    %r15d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r12d,%r12d
jle    1338 <main+0x1e8>
mov    $0x1,%eax
xor    %r15d,%r15d
lea    0xccb(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    %rbp,%rbx
mov    %rbx,%rax
mov    %rbp,%rbx
add    $0xffffffff,%r12d
jne    1360 <main+0x210>
jmp    1338 <main+0x1e8>

LLVM IR (-O0):
@.str = [58 x i8] c"Not enough input arguments! Use -h option for more info.\0A\00"
@.str.1 = [13 x i8] c"Aborting...\0A\00"
@.str.2 = [76 x i8] c"Program calculates subsequent Fibonacci numbers. To run the program, type:\0A\00"
@.str.3 = [21 x i8] c"./fibonacci num var\0A\00"
@.str.4 = [40 x i8] c"\09num - amount of the Fibonacci numbers\0A\00"
@.str.5 = [53 x i8] c"\09var - method variant (0 - normal, 1 - recursively)\0A\00"
@.str.6 = [31 x i8] c"For help type: ./fibonacci -h\0A\00"
@.str.7 = [68 x i8] c"Error: wrong number of input parameters. To run the program, type:\0A\00"
@.str.8 = [34 x i8] c"<num> parameter must be integer!\0A\00"
@.str.9 = [68 x i8] c"<var> parameter must be 0 (normal method) or 1 (recursive method)!\0A\00"
@.str.10 = [35 x i8] c"Sequence of %d Fibonacci numbers:\0A\00"
@.str.11 = [5 x i8] c"%lu\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 i32
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %171
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @strlen(i8* %20)
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %45
23: ; preds = %17
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 45
br i1 %30, label %31, label %45
31: ; preds = %23
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = getelementptr inbounds i8, i8* %34, i64 1
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 104
br i1 %38, label %39, label %45
39: ; preds = %31
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %3
br label %171
45: ; preds = %31, %23, %17
%46 = load i32, i32* %4
%47 = icmp ne i32 %46, 3
br i1 %47, label %48, label %55
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %171
55: ; preds = %45
store i32 0, i32* %6
br label %56
56: ; preds = %88, %55
%57 = load i32, i32* %6
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 1
%60 = load i8*, i8** %59
%61 = call i32 @strlen(i8* %60)
%62 = icmp slt i32 %57, %61
br i1 %62, label %63, label %91
63: ; preds = %56
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 1
%66 = load i8*, i8** %65
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp sgt i32 %71, 57
br i1 %72, label %83, label %73
73: ; preds = %63
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 1
%76 = load i8*, i8** %75
%77 = load i32, i32* %6
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %76, i64 %78
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp slt i32 %81, 48
br i1 %82, label %83, label %87
83: ; preds = %73, %63
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %171
87: ; preds = %73
br label %88
88: ; preds = %87
%89 = load i32, i32* %6
%90 = add nsw i32 %89, 1
store i32 %90, i32* %6
br label %56
91: ; preds = %56
store i32 0, i32* %6
br label %92
92: ; preds = %124, %91
%93 = load i32, i32* %6
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 2
%96 = load i8*, i8** %95
%97 = call i32 @strlen(i8* %96)
%98 = icmp slt i32 %93, %97
br i1 %98, label %99, label %127
99: ; preds = %92
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 2
%102 = load i8*, i8** %101
%103 = load i32, i32* %6
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %102, i64 %104
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = icmp ne i32 %107, 49
br i1 %108, label %109, label %123
109: ; preds = %99
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 2
%112 = load i8*, i8** %111
%113 = load i32, i32* %6
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %112, i64 %114
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp ne i32 %117, 48
br i1 %118, label %119, label %123
119: ; preds = %109
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.9, i64 0, i64 0))
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %171
123: ; preds = %109, %99
br label %124
124: ; preds = %123
%125 = load i32, i32* %6
%126 = add nsw i32 %125, 1
store i32 %126, i32* %6
br label %92
127: ; preds = %92
%128 = load i8**, i8*** %5
%129 = getelementptr inbounds i8*, i8** %128, i64 1
%130 = load i8*, i8** %129
%131 = call i32 @atoi(i8* %130)
store i32 %131, i32* %7
%132 = load i8**, i8*** %5
%133 = getelementptr inbounds i8*, i8** %132, i64 2
%134 = load i8*, i8** %133
%135 = call i32 @atoi(i8* %134)
store i32 %135, i32* %8
store i64 0, i64* %10
store i64 1, i64* %11
%136 = load i32, i32* %7
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %136)
%138 = load i32, i32* %8
switch i32 %138, label %169 [
i32 0, label %139
i32 1, label %156
]
139: ; preds = %127
store i32 0, i32* %6
br label %140
140: ; preds = %152, %139
%141 = load i32, i32* %6
%142 = load i32, i32* %7
%143 = icmp slt i32 %141, %142
br i1 %143, label %144, label %155
144: ; preds = %140
%145 = load i64, i64* %10
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 %145)
%147 = load i64, i64* %10
%148 = load i64, i64* %11
%149 = add i64 %147, %148
store i64 %149, i64* %9
%150 = load i64, i64* %11
store i64 %150, i64* %10
%151 = load i64, i64* %9
store i64 %151, i64* %11
br label %152
152: ; preds = %144
%153 = load i32, i32* %6
%154 = add nsw i32 %153, 1
store i32 %154, i32* %6
br label %140
155: ; preds = %140
br label %170
156: ; preds = %127
store i32 0, i32* %6
br label %157
157: ; preds = %165, %156
%158 = load i32, i32* %6
%159 = load i32, i32* %7
%160 = icmp slt i32 %158, %159
br i1 %160, label %161, label %168
161: ; preds = %157
%162 = load i32, i32* %6
%163 = call i64 @fibonacci(i32 %162)
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 %163)
br label %165
165: ; preds = %161
%166 = load i32, i32* %6
%167 = add nsw i32 %166, 1
store i32 %167, i32* %6
br label %157
168: ; preds = %157
br label %170
169: ; preds = %127
br label %170
170: ; preds = %169, %168, %155
store i32 0, i32* %3
br label %171
171: ; preds = %170, %119, %83, %48, %39, %14
%172 = load i32, i32* %3
ret i32 %172
}

LLVM IR (-O2):
@.str.10 = [35 x i8] c"Sequence of %d Fibonacci numbers:\0A\00"
@.str.11 = [5 x i8] c"%lu\0A\00"
@str = [67 x i8] c"<var> parameter must be 0 (normal method) or 1 (recursive method)!\00"
@str.14 = [33 x i8] c"<num> parameter must be integer!\00"
@str.17 = [67 x i8] c"Error: wrong number of input parameters. To run the program, type:\00"
@str.23 = [75 x i8] c"Program calculates subsequent Fibonacci numbers. To run the program, type:\00"
@str.24 = [20 x i8] c"./fibonacci num var\00"
@str.25 = [39 x i8] c"\09num - amount of the Fibonacci numbers\00"
@str.26 = [52 x i8] c"\09var - method variant (0 - normal, 1 - recursively)\00"
@str.27 = [30 x i8] c"For help type: ./fibonacci -h\00"
@str.28 = [57 x i8] c"Not enough input arguments! Use -h option for more info.\00"
@str.29 = [12 x i8] c"Aborting...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %91, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 104
br i1 %16, label %78, label %17
17: ; preds = %13, %9, %4
%18 = icmp eq i32 %0, 3
br i1 %18, label %19, label %23
19: ; preds = %17
%20 = load i8*, i8** %5
%21 = tail call i32 @strlen(i8* %20)
%22 = icmp sgt i32 %21, 0
br i1 %22, label %34, label %29
23: ; preds = %17
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.17, i64 0, i64 0))
br label %78
25: ; preds = %34
%26 = tail call i32 @strlen(i8* %36)
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %41, %27
br i1 %28, label %34, label %29
29: ; preds = %25, %19
%30 = getelementptr inbounds i8*, i8** %1, i64 2
%31 = load i8*, i8** %30
%32 = tail call i32 @strlen(i8* %31)
%33 = icmp sgt i32 %32, 0
br i1 %33, label %46, label %54
34: ; preds = %19, %25
%35 = phi i64 [ %41, %25 ], [ 0, %19 ]
%36 = load i8*, i8** %5
%37 = getelementptr inbounds i8, i8* %36, i64 %35
%38 = load i8, i8* %37
%39 = add i8 %38, -58
%40 = icmp ult i8 %39, -10
%41 = add nuw nsw i64 %35, 1
br i1 %40, label %86, label %25
42: ; preds = %46
%43 = tail call i32 @strlen(i8* %48)
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %53, %44
br i1 %45, label %46, label %54
46: ; preds = %29, %42
%47 = phi i64 [ %53, %42 ], [ 0, %29 ]
%48 = load i8*, i8** %30
%49 = getelementptr inbounds i8, i8* %48, i64 %47
%50 = load i8, i8* %49
%51 = and i8 %50, -2
%52 = icmp eq i8 %51, 48
%53 = add nuw nsw i64 %47, 1
br i1 %52, label %42, label %86
54: ; preds = %42, %29
%55 = load i8*, i8** %5
%56 = tail call i32 @atoi(i8* %55)
%57 = load i8*, i8** %30
%58 = tail call i32 @atoi(i8* %57)
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %56)
switch i32 %58, label %96 [
i32 0, label %62
i32 1, label %60
]
60: ; preds = %54
%61 = icmp sgt i32 %56, 0
br i1 %61, label %72, label %96
62: ; preds = %54
%63 = icmp sgt i32 %56, 0
br i1 %63, label %64, label %96
64: ; preds = %62, %64
%65 = phi i64 [ %69, %64 ], [ 1, %62 ]
%66 = phi i64 [ %65, %64 ], [ 0, %62 ]
%67 = phi i32 [ %70, %64 ], [ 0, %62 ]
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 %66)
%69 = add i64 %65, %66
%70 = add nuw nsw i32 %67, 1
%71 = icmp eq i32 %70, %56
br i1 %71, label %96, label %64
72: ; preds = %60, %72
%73 = phi i32 [ %76, %72 ], [ 0, %60 ]
%74 = tail call i64 @fibonacci(i32 %73)
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 %74)
%76 = add nuw nsw i32 %73, 1
%77 = icmp eq i32 %76, %56
br i1 %77, label %96, label %72
78: ; preds = %13, %23
%79 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.24, i64 0, i64 0), %23 ], [ getelementptr inbounds ([75 x i8], [75 x i8]* @str.23, i64 0, i64 0), %13 ]
%80 = phi i8* [ getelementptr inbounds ([39 x i8], [39 x i8]* @str.25, i64 0, i64 0), %23 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.24, i64 0, i64 0), %13 ]
%81 = phi i8* [ getelementptr inbounds ([52 x i8], [52 x i8]* @str.26, i64 0, i64 0), %23 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str.25, i64 0, i64 0), %13 ]
%82 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @str.27, i64 0, i64 0), %23 ], [ getelementptr inbounds ([52 x i8], [52 x i8]* @str.26, i64 0, i64 0), %13 ]
%83 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.29, i64 0, i64 0), %23 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @str.27, i64 0, i64 0), %13 ]
%84 = tail call i32 @puts(i8* dereferenceable(1) %79)
%85 = tail call i32 @puts(i8* dereferenceable(1) %80)
br label %86
86: ; preds = %34, %46, %78
%87 = phi i8* [ %81, %78 ], [ getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0), %46 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @str.14, i64 0, i64 0), %34 ]
%88 = phi i8* [ %82, %78 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @str.27, i64 0, i64 0), %46 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @str.27, i64 0, i64 0), %34 ]
%89 = phi i8* [ %83, %78 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.29, i64 0, i64 0), %46 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.29, i64 0, i64 0), %34 ]
%90 = tail call i32 @puts(i8* dereferenceable(1) %87)
br label %91
91: ; preds = %86, %2
%92 = phi i8* [ getelementptr inbounds ([57 x i8], [57 x i8]* @str.28, i64 0, i64 0), %2 ], [ %88, %86 ]
%93 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.29, i64 0, i64 0), %2 ], [ %89, %86 ]
%94 = tail call i32 @puts(i8* dereferenceable(1) %92)
%95 = tail call i32 @puts(i8* dereferenceable(1) %93)
br label %96
96: ; preds = %72, %64, %91, %60, %62, %54
%97 = phi i32 [ 0, %54 ], [ 0, %62 ], [ 0, %60 ], [ -1, %91 ], [ 0, %64 ], [ 0, %72 ]
ret i32 %97
}