int addWord(char *dic[]) {
  printf("Entrez un mot\n\n");
  char new_word[50] = "";
  char *p_new_word = &new_word;
  scanf("%s", p_new_word);
  for (int i = 0; i < 99; i++) {
    if (strcmp(dic[i], "!empty!") == 0) {
      dic[i] = p_new_word;
      printf("Ajout de %s ici !\n", p_new_word);
      break;
    } else {
      printf("%s\n", dic[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<addWord>:
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)
cmpl   $0x63,-0x4c(%rbp)
jge    120a <addWord+0xca>
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe6b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11dd <addWord+0x9d>
mov    -0x48(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x48(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120a <addWord+0xca>
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <addWord+0xbc>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    118b <addWord+0x4b>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addWord>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%r12
lea    0xec7(%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    0xe85(%rip),%rdi
xor    %r13d,%r13d
mov    %rsp,%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe71(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%r13,8),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11c7 <addWord+0x87>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x1,%r13
cmp    $0x63,%r13
jne    11a0 <addWord+0x60>
jmp    11dc <addWord+0x9c>
mov    %r14,(%r12,%r13,8)
lea    0xe39(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
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 = [8 x i8] c"!empty!\00"
@.str.3 = [19 x i8] c"Ajout de %s ici !\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @addWord(i8** %0) {
%2 = alloca i8**
%3 = alloca [50 x i8]
%4 = alloca i8*
%5 = alloca i32
store i8** %0, i8*** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = bitcast [50 x i8]* %3 to i8*
%8 = bitcast [50 x i8]* %3 to i8*
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 0, i32* %5
br label %11
11: ; preds = %38, %1
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 99
br i1 %13, label %14, label %41
14: ; preds = %11
%15 = load i8**, i8*** %2
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %14
%23 = load i8*, i8** %4
%24 = load i8**, i8*** %2
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
store i8* %23, i8** %27
%28 = load i8*, i8** %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %28)
br label %41
30: ; preds = %14
%31 = load i8**, i8*** %2
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %35)
br label %37
37: ; preds = %30
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %11
41: ; preds = %22, %11
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"!empty!\00"
@.str.3 = [19 x i8] c"Ajout de %s ici !\0A\00"
@str = [15 x i8] c"Entrez un mot\0A\00"
define i32 @addWord(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 %6
6: ; preds = %1, %16
%7 = phi i64 [ 0, %1 ], [ %18, %16 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = and i64 %7, 4294967295
%14 = getelementptr inbounds i8*, i8** %0, i64 %13
store i8* %3, i8** %14
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %3)
br label %20
16: ; preds = %6
%17 = call i32 @puts(i8* dereferenceable(1) %9)
%18 = add nuw nsw i64 %7, 1
%19 = icmp eq i64 %18, 99
br i1 %19, label %20, label %6
20: ; preds = %16, %12
ret i32 0
}