#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 EXIT_FAILURE;
int EXIT_SUCCESS;
char *correct_word(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ hash_table_create();
int /*<<< orphan*/ hash_table_destroy();
int /*<<< orphan*/ init_corpus_from_file(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "Usage: %s mot-a-corriger\n", *argv);
    exit(EXIT_FAILURE);
  }
  hash_table_create();
  if (!init_corpus_from_file("Data/Iliad.txt"))
    return EXIT_FAILURE;
  printf("%s ==> %s\n", argv[1], correct_word(argv[1]));
  hash_table_destroy();
  return EXIT_SUCCESS;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     11ba <main+0x4a>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe59(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    $0x0,%al
call   1030 <hash_table_create@plt>
lea    0xe52(%rip),%rdi
call   1040 <init_corpus_from_file@plt>
cmp    $0x0,%eax
jne    11e7 <main+0x77>
mov    0x2dfb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1226 <main+0xb6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <correct_word@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe1b(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <hash_table_destroy@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    11c9 <main+0x59>
xor    %eax,%eax
call   1030 <hash_table_create@plt>
lea    0xe93(%rip),%rdi
call   1040 <init_corpus_from_file@plt>
test   %eax,%eax
je     11be <main+0x4e>
mov    0x8(%rbx),%rbx
mov    %rbx,%rdi
call   1060 <correct_word@plt>
lea    0xe86(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <hash_table_destroy@plt>
mov    0x2e14(%rip),%rax
jmp    11c5 <main+0x55>
mov    0x2e13(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe24(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s mot-a-corriger\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [15 x i8] c"Data/Iliad.txt\00"
@.str.2 = [11 x i8] c"%s ==> %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = call i32 (...) @hash_table_create()
%17 = call i32 @init_corpus_from_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = load i32, i32* @EXIT_FAILURE
store i32 %20, i32* %3
br label %32
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i8* @correct_word(i8* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %24, i8* %28)
%30 = call i32 (...) @hash_table_destroy()
%31 = load i32, i32* @EXIT_SUCCESS
store i32 %31, i32* %3
br label %32
32: ; preds = %21, %19
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage: %s mot-a-corriger\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [15 x i8] c"Data/Iliad.txt\00"
@.str.2 = [11 x i8] c"%s ==> %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = tail call i32 (...) @hash_table_create()
%12 = tail call i32 @init_corpus_from_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %10
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i8* @correct_word(i8* %16)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %16, i8* %17)
%19 = tail call i32 (...) @hash_table_destroy()
br label %20
20: ; preds = %10, %14
%21 = phi i32* [ @EXIT_SUCCESS, %14 ], [ @EXIT_FAILURE, %10 ]
%22 = load i32, i32* %21
ret i32 %22
}