#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 */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ argument(char const *, int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int lstat(char const *, struct stat *);
int /*<<< orphan*/ parc(char const *, int *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  int arg[4];
  struct stat tmp;
  switch (argc) {
  case 2:
    if (lstat(argv[1], &tmp) == -1) {
      printf("Erreur fichier");
      exit(0);
    }
    parc(argv[1], arg, "");
    break;
  case 3:
    argument(argv[1], arg);
    if (lstat(argv[2], &tmp) == -1) {
      printf("Erreur fichier");
      exit(0);
    }
    parc(argv[2], arg, "");
    break;
  default:
    printf("NB Args");
    exit(0);
  }
  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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x2,%eax
je     118b <main+0x3b>
jmp    117a <main+0x2a>
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
je     11d5 <main+0x85>
jmp    1230 <main+0xe0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <lstat@plt>
cmp    $0xffffffff,%eax
jne    11b8 <main+0x68>
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
lea    0xe43(%rip),%rdx
call   1060 <parc@plt>
jmp    1243 <main+0xf3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <argument@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <lstat@plt>
cmp    $0xffffffff,%eax
jne    1213 <main+0xc3>
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x20(%rbp),%rsi
lea    0xde8(%rip),%rdx
call   1060 <parc@plt>
jmp    1243 <main+0xf3>
lea    0xdd8(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     117b <main+0x2b>
cmp    $0x2,%edi
jne    11c2 <main+0x72>
mov    0x8(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1050 <lstat@plt>
cmp    $0xffffffff,%eax
je     11b9 <main+0x69>
mov    0x8(%rbx),%rdi
jmp    11a0 <main+0x50>
mov    0x8(%rbx),%rdi
lea    0x10(%rsp),%rsi
call   1030 <argument@plt>
mov    0x10(%rbx),%rdi
lea    0x8(%rsp),%rsi
call   1050 <lstat@plt>
cmp    $0xffffffff,%eax
je     11b9 <main+0x69>
mov    0x10(%rbx),%rdi
lea    0xe67(%rip),%rdx
lea    0x10(%rsp),%rsi
call   1060 <parc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret
lea    0xe40(%rip),%rdi
jmp    11c9 <main+0x79>
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [15 x i8] c"Erreur fichier\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c"NB Args\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
%7 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
switch i32 %8, label %44 [
i32 2, label %9
i32 3, label %24
]
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @lstat(i8* %12, %struct.stat* %7)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %9
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%23 = call i32 @parc(i8* %21, i32* %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %47
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%29 = call i32 @argument(i8* %27, i32* %28)
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i32 @lstat(i8* %32, %struct.stat* %7)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %38
35: ; preds = %24
%36 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%37 = call i32 @exit(i32 0)
unreachable
38: ; preds = %24
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%43 = call i32 @parc(i8* %41, i32* %42, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %47
44: ; preds = %2
%45 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 @exit(i32 0)
unreachable
47: ; preds = %38, %18
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [15 x i8] c"Erreur fichier\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c"NB Args\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x i32]
%4 = alloca %struct.stat
%5 = bitcast [4 x i32]* %3 to i8*
%6 = bitcast %struct.stat* %4 to i8*
switch i32 %0, label %34 [
i32 2, label %7
i32 3, label %19
]
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @lstat(i8* %9, %struct.stat* %4)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @exit(i32 0)
unreachable
15: ; preds = %7
%16 = load i8*, i8** %8
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%18 = call i32 @parc(i8* %16, i32* %17, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %37
19: ; preds = %2
%20 = getelementptr inbounds i8*, i8** %1, i64 1
%21 = load i8*, i8** %20
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%23 = call i32 @argument(i8* %21, i32* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @lstat(i8* %25, %struct.stat* %4)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %31
28: ; preds = %19
%29 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %19
%32 = load i8*, i8** %24
%33 = call i32 @parc(i8* %32, i32* %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %37
34: ; preds = %2
%35 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%36 = tail call i32 @exit(i32 0)
unreachable
37: ; preds = %31, %15
ret i32 0
}