#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 *);
int fib(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (2 > argc) {
    printf("Nombre de paramètres insuffisants");
    return 1;
  }
  int value = atoi(argv[1]);
  if (2 == argc) {
    printf("%d", fib(value));
  } else if (3 == argc) {
    int value2 = atoi(argv[2]);
    int i;
    for (i = value; i <= value2; i++) {
      printf("%d ", fib(i));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jle    116e <main+0x3e>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1210 <main+0xe0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jne    11a9 <main+0x79>
mov    -0x14(%rbp),%edi
call   1040 <fib@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1209 <main+0xd9>
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jne    1204 <main+0xd4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11ff <main+0xcf>
mov    -0x1c(%rbp),%edi
call   1040 <fib@plt>
mov    %eax,%esi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11cd <main+0x9d>
jmp    1204 <main+0xd4>
jmp    1209 <main+0xd9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     1151 <main+0x21>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebp
jmp    11cb <main+0x9b>
mov    %rsi,%r14
mov    %edi,%r15d
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
xor    %ebp,%ebp
cmp    $0x3,%r15d
je     118b <main+0x5b>
cmp    $0x2,%r15d
jne    11cb <main+0x9b>
mov    %ebx,%edi
call   1040 <fib@plt>
lea    0xea5(%rip),%rdi
xor    %ebp,%ebp
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11cb <main+0x9b>
mov    0x10(%r14),%rdi
call   1050 <atoi@plt>
cmp    %eax,%ebx
jg     11cb <main+0x9b>
mov    %eax,%r14d
add    $0x1,%r14d
lea    0xe80(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <fib@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    11b0 <main+0x80>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Nombre de param\C3\A8tres insuffisants\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d \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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sgt i32 2, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %47
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %6
%18 = load i32, i32* %4
%19 = icmp eq i32 2, %18
br i1 %19, label %20, label %24
20: ; preds = %13
%21 = load i32, i32* %6
%22 = call i32 @fib(i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %46
24: ; preds = %13
%25 = load i32, i32* %4
%26 = icmp eq i32 3, %25
br i1 %26, label %27, label %45
27: ; preds = %24
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %7
%32 = load i32, i32* %6
store i32 %32, i32* %8
br label %33
33: ; preds = %41, %27
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = icmp sle i32 %34, %35
br i1 %36, label %37, label %44
37: ; preds = %33
%38 = load i32, i32* %8
%39 = call i32 @fib(i32 %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %37
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
br label %33
44: ; preds = %33
br label %45
45: ; preds = %44, %24
br label %46
46: ; preds = %45, %20
store i32 0, i32* %3
br label %47
47: ; preds = %46, %11
%48 = load i32, i32* %3
ret i32 %48
}

LLVM IR (-O2):
@.str = [35 x i8] c"Nombre de param\C3\A8tres insuffisants\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %24
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
switch i32 %0, label %24 [
i32 2, label %10
i32 3, label %13
]
10: ; preds = %6
%11 = tail call i32 @fib(i32 %9)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %24
13: ; preds = %6
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = icmp sgt i32 %9, %16
br i1 %17, label %24, label %18
18: ; preds = %13, %18
%19 = phi i32 [ %22, %18 ], [ %9, %13 ]
%20 = tail call i32 @fib(i32 %19)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = add i32 %19, 1
%23 = icmp eq i32 %19, %16
br i1 %23, label %24, label %18
24: ; preds = %18, %13, %10, %6, %4
%25 = phi i32 [ 1, %4 ], [ 0, %6 ], [ 0, %10 ], [ 0, %13 ], [ 0, %18 ]
ret i32 %25
}