#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 Correlation(char *, char *);
int /*<<< orphan*/ convertS(char *, char *);
int /*<<< orphan*/ effaceMot(char *);
int Verification(char *motSaisi, char *dictionnaire[], int nbrMot,
                 int nbre_max_faute) {
  int indMot = 0;
  int Diff = 0;
  int indMotMin = 0;
  int DiffMin = 99;
  char nomArret[30];
  char nomEntre[30];
  effaceMot(nomEntre);
  convertS(motSaisi, nomEntre);
  for (indMot = 0; indMot < nbrMot; indMot = indMot + 1) {
    effaceMot(nomArret);
    convertS(dictionnaire[indMot], nomArret);
    Diff = Correlation(nomArret, nomEntre);
    if (DiffMin > Diff) {
      DiffMin = Diff;
      indMotMin = indMot;
    }
  }
  if (DiffMin > nbre_max_faute) {
    return (0);
  }
  if (DiffMin == 0) {
    return (indMotMin + 1);
  } else {
    return (-(indMotMin + 1));
  }
}


x86 assembly (clang, -O0):
<Verification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x63,-0x30(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <effaceMot@plt>
mov    -0x10(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1040 <convertS@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11e4 <Verification+0xb4>
lea    -0x50(%rbp),%rdi
call   1030 <effaceMot@plt>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <convertS@plt>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <Correlation@plt>
mov    %eax,-0x28(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    11d1 <Verification+0xa1>
mov    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11d6 <Verification+0xa6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117f <Verification+0x4f>
mov    -0x30(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11fc <Verification+0xcc>
movl   $0x0,-0x4(%rbp)
jmp    1221 <Verification+0xf1>
cmpl   $0x0,-0x30(%rbp)
jne    1214 <Verification+0xe4>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1221 <Verification+0xf1>
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Verification>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%r13
mov    %rdi,%rbp
lea    0x10(%rsp),%r12
mov    %r12,%rdi
call   1030 <effaceMot@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1040 <convertS@plt>
test   %r15d,%r15d
jle    11c5 <Verification+0x95>
mov    %r14d,0xc(%rsp)
mov    %r15d,%r14d
xor    %r15d,%r15d
mov    $0x63,%ebp
lea    0x30(%rsp),%r12
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r12,%rdi
call   1030 <effaceMot@plt>
mov    0x0(%r13,%r15,8),%rdi
mov    %r12,%rsi
call   1040 <convertS@plt>
mov    %r12,%rdi
lea    0x10(%rsp),%rsi
call   1050 <Correlation@plt>
cmp    %eax,%ebp
cmovg  %r15d,%ebx
cmovg  %eax,%ebp
add    $0x1,%r15
cmp    %r15,%r14
jne    1180 <Verification+0x50>
xor    %eax,%eax
cmp    0xc(%rsp),%ebp
jg     11d6 <Verification+0xa6>
test   %ebp,%ebp
jne    11d2 <Verification+0xa2>
add    $0x1,%ebx
jmp    11d4 <Verification+0xa4>
xor    %ebx,%ebx
mov    $0x0,%eax
cmp    $0x63,%r14d
jl     11d6 <Verification+0xa6>
not    %ebx
mov    %ebx,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Verification(i8* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [30 x i8]
%15 = alloca [30 x i8]
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 99, i32* %13
%16 = getelementptr inbounds [30 x i8], [30 x i8]* %15, i64 0, i64 0
%17 = call i32 @effaceMot(i8* %16)
%18 = load i8*, i8** %6
%19 = getelementptr inbounds [30 x i8], [30 x i8]* %15, i64 0, i64 0
%20 = call i32 @convertS(i8* %18, i8* %19)
store i32 0, i32* %10
br label %21
21: ; preds = %45, %4
%22 = load i32, i32* %10
%23 = load i32, i32* %8
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %48
25: ; preds = %21
%26 = getelementptr inbounds [30 x i8], [30 x i8]* %14, i64 0, i64 0
%27 = call i32 @effaceMot(i8* %26)
%28 = load i8**, i8*** %7
%29 = load i32, i32* %10
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = getelementptr inbounds [30 x i8], [30 x i8]* %14, i64 0, i64 0
%34 = call i32 @convertS(i8* %32, i8* %33)
%35 = getelementptr inbounds [30 x i8], [30 x i8]* %14, i64 0, i64 0
%36 = getelementptr inbounds [30 x i8], [30 x i8]* %15, i64 0, i64 0
%37 = call i32 @Correlation(i8* %35, i8* %36)
store i32 %37, i32* %11
%38 = load i32, i32* %13
%39 = load i32, i32* %11
%40 = icmp sgt i32 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %25
%42 = load i32, i32* %11
store i32 %42, i32* %13
%43 = load i32, i32* %10
store i32 %43, i32* %12
br label %44
44: ; preds = %41, %25
br label %45
45: ; preds = %44
%46 = load i32, i32* %10
%47 = add nsw i32 %46, 1
store i32 %47, i32* %10
br label %21
48: ; preds = %21
%49 = load i32, i32* %13
%50 = load i32, i32* %9
%51 = icmp sgt i32 %49, %50
br i1 %51, label %52, label %53
52: ; preds = %48
store i32 0, i32* %5
br label %63
53: ; preds = %48
%54 = load i32, i32* %13
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load i32, i32* %12
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
br label %63
59: ; preds = %53
%60 = load i32, i32* %12
%61 = add nsw i32 %60, 1
%62 = sub nsw i32 0, %61
store i32 %62, i32* %5
br label %63
63: ; preds = %59, %56, %52
%64 = load i32, i32* %5
ret i32 %64
}

LLVM IR (-O2):
define i32 @Verification(i8* %0, i8** nocapture %1, i32 %2, i32 %3) {
%5 = alloca [30 x i8]
%6 = alloca [30 x i8]
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%9 = call i32 @effaceMot(i8* %8)
%10 = call i32 @convertS(i8* %0, i8* %8)
%11 = icmp sgt i32 %2, 0
br i1 %11, label %12, label %31
12: ; preds = %4
%13 = zext i32 %2 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 0, %12 ], [ %27, %14 ]
%16 = phi i32 [ 99, %12 ], [ %26, %14 ]
%17 = phi i32 [ 0, %12 ], [ %25, %14 ]
%18 = call i32 @effaceMot(i8* %7)
%19 = getelementptr inbounds i8*, i8** %1, i64 %15
%20 = load i8*, i8** %19
%21 = call i32 @convertS(i8* %20, i8* %7)
%22 = call i32 @Correlation(i8* %7, i8* %8)
%23 = icmp sgt i32 %16, %22
%24 = trunc i64 %15 to i32
%25 = select i1 %23, i32 %24, i32 %17
%26 = select i1 %23, i32 %22, i32 %16
%27 = add nuw nsw i64 %15, 1
%28 = icmp eq i64 %27, %13
br i1 %28, label %29, label %14
29: ; preds = %14
%30 = icmp sgt i32 %26, %3
br i1 %30, label %40, label %33
31: ; preds = %4
%32 = icmp slt i32 %3, 99
br i1 %32, label %40, label %37
33: ; preds = %29
%34 = icmp eq i32 %26, 0
br i1 %34, label %35, label %37
35: ; preds = %33
%36 = add nsw i32 %25, 1
br label %40
37: ; preds = %31, %33
%38 = phi i32 [ %25, %33 ], [ 0, %31 ]
%39 = xor i32 %38, -1
br label %40
40: ; preds = %31, %29, %37, %35
%41 = phi i32 [ %36, %35 ], [ %39, %37 ], [ 0, %29 ], [ 0, %31 ]
ret i32 %41
}