#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*/ codage(char *);
int /*<<< orphan*/ decodage(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int error = 0;
  if (argc > 2) {
    if (argv[1][0] == 'c')
      error = !codage(argv[2]);
    else if (argv[1][0] == 'd')
      error = !decodage(argv[2]);
    else
      error = 1;
  } else
    error = 1;
  if (error)
    printf("Syntaxe incorecte : \n\t   d fichier_a_decoder\n\tou c "
           "fichier_a_coder\n\n");
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    11d4 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x63,%eax
jne    118d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <codage@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    11cf <main+0x9f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x64,%eax
jne    11c3 <main+0x93>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <decodage@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    11ca <main+0x9a>
movl   $0x1,-0x14(%rbp)
jmp    11cf <main+0x9f>
jmp    11db <main+0xab>
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11f1 <main+0xc1>
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jl     1160 <main+0x30>
mov    0x8(%rsi),%rax
mov    (%rax),%al
cmp    $0x64,%al
je     1153 <main+0x23>
cmp    $0x63,%al
jne    1160 <main+0x30>
mov    0x10(%rsi),%rdi
call   1040 <codage@plt>
test   %eax,%eax
jne    116c <main+0x3c>
jmp    1160 <main+0x30>
mov    0x10(%rsi),%rdi
call   1050 <decodage@plt>
test   %eax,%eax
jne    116c <main+0x3c>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"Syntaxe incorecte : \0A\09 d fichier_a_decoder\0A\09ou c fichier_a_coder\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 2
br i1 %8, label %9, label %44
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 99
br i1 %16, label %17, label %25
17: ; preds = %9
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @codage(i8* %20)
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
store i32 %24, i32* %6
br label %43
25: ; preds = %9
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 100
br i1 %32, label %33, label %41
33: ; preds = %25
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 2
%36 = load i8*, i8** %35
%37 = call i32 @decodage(i8* %36)
%38 = icmp ne i32 %37, 0
%39 = xor i1 %38, true
%40 = zext i1 %39 to i32
store i32 %40, i32* %6
br label %42
41: ; preds = %25
store i32 1, i32* %6
br label %42
42: ; preds = %41, %33
br label %43
43: ; preds = %42, %17
br label %45
44: ; preds = %2
store i32 1, i32* %6
br label %45
45: ; preds = %44, %43
%46 = load i32, i32* %6
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
ret i32 0
}

LLVM IR (-O2):
@str = [68 x i8] c"Syntaxe incorecte : \0A\09 d fichier_a_decoder\0A\09ou c fichier_a_coder\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
switch i8 %7, label %18 [
i8 99, label %8
i8 100, label %13
]
8: ; preds = %4
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @codage(i8* %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %18, label %20
13: ; preds = %4
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @decodage(i8* %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %8, %2, %4, %13
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
br label %20
20: ; preds = %8, %18, %13
ret i32 0
}