#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 strlen(char *);
void verification(char caract, char mot[], int lettreTrouvee[], int donnees[]) {
  int verif = 0, i;
  for (i = 0; i < strlen(mot); i++) {
    if (caract == mot[i]) {
      if (lettreTrouvee[i] == 0)
        donnees[1] += 1;
      lettreTrouvee[i] = 1;
      verif = 1;
    }
  }
  if (verif == 0)
    donnees[2] -= 1;
}


x86 assembly (clang, -O0):
<verification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    11b4 <verification+0xa4>
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x28(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    11a1 <verification+0x91>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    118b <verification+0x7b>
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
movl   $0x1,-0x24(%rbp)
jmp    11a6 <verification+0x96>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1138 <verification+0x28>
cmpl   $0x0,-0x24(%rbp)
jne    11cb <verification+0xbb>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verification>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%r12d
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    117a <verification+0x6a>
xor    %ebp,%ebp
xor    %r13d,%r13d
jmp    1161 <verification+0x51>
nopw   0x0(%rax,%rax,1)
movl   $0x1,(%r15,%rbp,4)
mov    $0x1,%r13d
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    1175 <verification+0x65>
cmp    %r12b,(%rbx,%rbp,1)
jne    114e <verification+0x3e>
cmpl   $0x0,(%r15,%rbp,4)
jne    1140 <verification+0x30>
addl   $0x1,0x4(%r14)
jmp    1140 <verification+0x30>
test   %r13d,%r13d
jne    117f <verification+0x6f>
addl   $0xffffffff,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @verification(i8 signext %0, i8* %1, i32* nocapture %2, i32* nocapture %3) {
%5 = tail call i32 @strlen(i8* %1)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %31
7: ; preds = %4
%8 = getelementptr inbounds i32, i32* %3, i64 1
br label %9
9: ; preds = %7, %23
%10 = phi i64 [ 0, %7 ], [ %25, %23 ]
%11 = phi i32 [ 0, %7 ], [ %24, %23 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, %0
br i1 %14, label %15, label %23
15: ; preds = %9
%16 = getelementptr inbounds i32, i32* %2, i64 %10
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
br label %22
22: ; preds = %19, %15
store i32 1, i32* %16
br label %23
23: ; preds = %9, %22
%24 = phi i32 [ 1, %22 ], [ %11, %9 ]
%25 = add nuw nsw i64 %10, 1
%26 = tail call i32 @strlen(i8* %1)
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %9, label %29
29: ; preds = %23
%30 = icmp eq i32 %24, 0
br i1 %30, label %31, label %35
31: ; preds = %4, %29
%32 = getelementptr inbounds i32, i32* %3, i64 2
%33 = load i32, i32* %32
%34 = add nsw i32 %33, -1
store i32 %34, i32* %32
br label %35
35: ; preds = %31, %29
ret void
}