#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 /*<<< orphan*/ boucleEssai(char *, char *, int);
int /*<<< orphan*/ cacherMot();
int /*<<< orphan*/ lire(char *, int);
int /*<<< orphan*/ motMaj(char *, int);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
int modeMulti(char motSecret[], int tailleMotSecret) {
  printf("Entrez le mot secret : \n");
  lire(motSecret, 30);
  cacherMot();
  tailleMotSecret = strlen(motSecret);
  char motEssai[30] = "******************************";
  motEssai[tailleMotSecret] = '\0';
  motMaj(motSecret, tailleMotSecret);
  boucleEssai(motSecret, motEssai, tailleMotSecret);
  return 0;
}


x86 assembly (clang, -O0):
<modeMulti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1e,%esi
call   1050 <lire@plt>
mov    $0x0,%al
call   1080 <cacherMot@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    0xe7d(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe77(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe75(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xe6f(%rip),%ax
mov    %ax,-0x14(%rbp)
movslq -0xc(%rbp),%rax
movb   $0x0,-0x30(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <motMaj@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1070 <boucleEssai@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modeMulti>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    $0x1e,%esi
call   1050 <lire@plt>
xor    %eax,%eax
call   1080 <cacherMot@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
movaps 0xe67(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps %xmm0,(%rsp)
movslq %eax,%rbx
movb   $0x0,(%rsp,%rbx,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <motMaj@plt>
mov    %rsp,%rsi
mov    %r14,%rdi
mov    %ebx,%edx
call   1070 <boucleEssai@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Entrez le mot secret : \0A\00"
@__const.modeMulti.motEssai = [30 x i8] c"******************************"
define i32 @modeMulti(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [30 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 @lire(i8* %7, i32 30)
%9 = call i32 (...) @cacherMot()
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %4
%12 = bitcast [30 x i8]* %5 to i8*
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = call i32 @motMaj(i8* %16, i32 %17)
%19 = load i8*, i8** %3
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%21 = load i32, i32* %4
%22 = call i32 @boucleEssai(i8* %19, i8* %20, i32 %21)
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Entrez le mot secret : \00"
define i32 @modeMulti(i8* %0, i32 %1) {
%3 = alloca [30 x i8]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @lire(i8* %0, i32 30)
%6 = tail call i32 (...) @cacherMot()
%7 = tail call i32 @strlen(i8* %0)
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 %9
store i8 0, i8* %10
%11 = tail call i32 @motMaj(i8* %0, i32 %7)
%12 = call i32 @boucleEssai(i8* %0, i8* %8, i32 %7)
ret i32 0
}