int compareWords(char *dic[]) {
  printf("Entrez un mot\n\n");
  char new_word[50] = "";
  char *p_new_word = &new_word;
  scanf("%s", p_new_word);
  int found = 0;
  for (int i = 0; i < 99; i++) {
    if (strcmp(dic[i], p_new_word) == 0) {
      found = 1;
    }
  }
  if (found == 1) {
    printf("%s existe dans la liste !\n", p_new_word);
  } else {
    printf("%s n'exsiste pas dans la liste\n", p_new_word);
  }
  return 0;
}


x86 assembly (clang, -O0):
<compareWords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x63,-0x50(%rbp)
jge    11d4 <compareWords+0x94>
mov    -0x8(%rbp),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x48(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11c1 <compareWords+0x81>
movl   $0x1,-0x4c(%rbp)
jmp    11c6 <compareWords+0x86>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1192 <compareWords+0x52>
cmpl   $0x1,-0x4c(%rbp)
jne    11f5 <compareWords+0xb5>
mov    -0x48(%rbp),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1207 <compareWords+0xc7>
mov    -0x48(%rbp),%rsi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareWords>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%r15
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
lea    0xe86(%rip),%rdi
xor    %ebx,%ebx
mov    %rsp,%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0x1,%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
cmove  %r12d,%ebp
add    $0x1,%rbx
cmp    $0x63,%rbx
jne    11a0 <compareWords+0x60>
cmp    $0x1,%ebp
lea    0xe3d(%rip),%rax
lea    0xe51(%rip),%rdi
cmove  %rax,%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Entrez un mot\0A\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"%s existe dans la liste !\0A\00"
@.str.3 = [32 x i8] c"%s n'exsiste pas dans la liste\0A\00"
define i32 @compareWords(i8** %0) {
%2 = alloca i8**
%3 = alloca [50 x i8]
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = bitcast [50 x i8]* %3 to i8*
%9 = bitcast [50 x i8]* %3 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
store i32 0, i32* %5
store i32 0, i32* %6
br label %12
12: ; preds = %26, %1
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 99
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i8**, i8*** %2
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = load i8*, i8** %4
%22 = call i32 @strcmp(i8* %20, i8* %21)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %15
store i32 1, i32* %5
br label %25
25: ; preds = %24, %15
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %12
29: ; preds = %12
%30 = load i32, i32* %5
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i8*, i8** %4
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %33)
br label %38
35: ; preds = %29
%36 = load i8*, i8** %4
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %36)
br label %38
38: ; preds = %35, %32
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [27 x i8] c"%s existe dans la liste !\0A\00"
@.str.3 = [32 x i8] c"%s n'exsiste pas dans la liste\0A\00"
@str = [15 x i8] c"Entrez un mot\0A\00"
define i32 @compareWords(i8** nocapture %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %10
6: ; preds = %10
%7 = icmp eq i32 %17, 1
%8 = select i1 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %8, i8* %3)
ret i32 0
10: ; preds = %1, %10
%11 = phi i64 [ 0, %1 ], [ %18, %10 ]
%12 = phi i32 [ 0, %1 ], [ %17, %10 ]
%13 = getelementptr inbounds i8*, i8** %0, i64 %11
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* dereferenceable(1) %14, i8* %3)
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i32 1, i32 %12
%18 = add nuw nsw i64 %11, 1
%19 = icmp eq i64 %18, 99
br i1 %19, label %6, label %10
}