#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*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
char *readKeyboardInput();
scalar_t__ strcmp(char *, char *);
int main() {
  char *userInput;
  char *endValue = "QUITTER\n";
  do {
    printf("Entrez votre critËre de recherche : ");
    userInput = readKeyboardInput();
    printf("Input : %s\n", userInput);
  } while (strcmp(userInput, endValue) != 0);
  free(userInput);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <readKeyboardInput@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    115a <main+0x1a>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeba(%rip),%r14
lea    0xed9(%rip),%r15
lea    0xea3(%rip),%r12
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <readKeyboardInput@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1160 <main+0x20>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"QUITTER\0A\00"
@.str.1 = [38 x i8] c"Entrez votre crit\C3\8Bre de recherche : \00"
@.str.2 = [12 x i8] c"Input : %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
br label %4
4: ; preds = %9, %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%6 = call i8* (...) @readKeyboardInput()
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"QUITTER\0A\00"
@.str.1 = [38 x i8] c"Entrez votre crit\C3\8Bre de recherche : \00"
@.str.2 = [12 x i8] c"Input : %s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* (...) @readKeyboardInput()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @free(i8* %3)
ret i32 0
}