#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*/ fin_debug();
int /*<<< orphan*/ init_debug();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ saisie_chaine(char *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_file();
int /*<<< orphan*/ test_liste();
int /*<<< orphan*/ test_pile();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  char rep[5];
  int fin = 0;
  srand(time(NULL));
  init_debug();
  while (!fin) {
    printf("1. test (L)iste \n");
    printf("2. test (P)ile \n");
    printf("3. test (F)ile \n");
    printf("\n0. fin \nChoix : ");
    saisie_chaine(rep, 2);
    switch (rep[0]) {
    case '1':
    case 'l':
    case 'L':
      test_liste();
      break;
    case '2':
    case 'p':
    case 'P':
      test_pile();
      break;
    case '3':
    case 'f':
    case 'F':
      test_file();
      break;
    case '0':
      fin = 1;
    default:
      break;
    }
  }
  fin_debug();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x0,%al
call   1050 <init_debug@plt>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11d3 <main+0x43>
jmp    1270 <main+0xe0>
lea    0xf2a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
call   1030 <printf@plt>
lea    0xf35(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x9(%rbp),%rdi
mov    $0x2,%esi
call   1090 <saisie_chaine@plt>
movsbl -0x9(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x40,%eax
ja     1266 <main+0xd6>
mov    -0x18(%rbp),%rax
lea    0xdce(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10b0 <test_liste@plt>
jmp    126b <main+0xdb>
mov    $0x0,%al
call   10a0 <test_pile@plt>
jmp    126b <main+0xdb>
mov    $0x0,%al
call   1040 <test_file@plt>
jmp    126b <main+0xdb>
movl   $0x1,-0x10(%rbp)
jmp    126b <main+0xdb>
jmp    11bd <main+0x2d>
mov    $0x0,%al
call   1070 <fin_debug@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
xor    %eax,%eax
call   1060 <init_debug@plt>
lea    0xf4f(%rip),%r14
lea    0xf59(%rip),%r15
lea    0xf62(%rip),%r12
lea    0xf28(%rip),%r13
lea    0x3(%rsp),%rbx
lea    0xe18(%rip),%rbp
jmp    11f7 <main+0x57>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <test_file@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   10a0 <saisie_chaine@plt>
movsbl 0x3(%rsp),%eax
add    $0xffffffd0,%eax
cmp    $0x40,%eax
ja     11f7 <main+0x57>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
xor    %eax,%eax
call   10c0 <test_liste@plt>
jmp    11f7 <main+0x57>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   10b0 <test_pile@plt>
jmp    11f7 <main+0x57>
xor    %eax,%eax
call   1080 <fin_debug@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"1. test (L)iste \0A\00"
@.str.1 = [17 x i8] c"2. test (P)ile \0A\00"
@.str.2 = [17 x i8] c"3. test (F)ile \0A\00"
@.str.3 = [18 x i8] c"\0A0. fin \0AChoix : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @init_debug()
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%17 = call i32 @saisie_chaine(i8* %16, i32 2)
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
switch i32 %20, label %28 [
i32 49, label %21
i32 108, label %21
i32 76, label %21
i32 50, label %23
i32 112, label %23
i32 80, label %23
i32 51, label %25
i32 102, label %25
i32 70, label %25
i32 48, label %27
]
21: ; preds = %11, %11, %11
%22 = call i32 (...) @test_liste()
br label %29
23: ; preds = %11, %11, %11
%24 = call i32 (...) @test_pile()
br label %29
25: ; preds = %11, %11, %11
%26 = call i32 (...) @test_file()
br label %29
27: ; preds = %11
store i32 1, i32* %3
br label %28
28: ; preds = %11, %27
br label %29
29: ; preds = %28, %25, %23, %21
br label %7
30: ; preds = %7
%31 = call i32 (...) @fin_debug()
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [18 x i8] c"\0A0. fin \0AChoix : \00"
@str = [17 x i8] c"1. test (L)iste \00"
@str.4 = [16 x i8] c"2. test (P)ile \00"
@str.5 = [16 x i8] c"3. test (F)ile \00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @init_debug()
br label %6
6: ; preds = %14, %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @saisie_chaine(i8* %2, i32 2)
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
switch i32 %13, label %14 [
i32 49, label %15
i32 108, label %15
i32 76, label %15
i32 50, label %17
i32 112, label %17
i32 80, label %17
i32 51, label %19
i32 102, label %19
i32 70, label %19
i32 48, label %21
]
14: ; preds = %6, %19, %17, %15
br label %6
15: ; preds = %6, %6, %6
%16 = call i32 (...) @test_liste()
br label %14
17: ; preds = %6, %6, %6
%18 = call i32 (...) @test_pile()
br label %14
19: ; preds = %6, %6, %6
%20 = call i32 (...) @test_file()
br label %14
21: ; preds = %6
%22 = call i32 (...) @fin_debug()
ret i32 0
}