#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*/ condition(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void menu() {
  char answer[99] = {};
  char answerTemp[99] = {};
  for (int i = 0; i < 99; i++) {
    answerTemp[i] = '\a';
  }
  do {
    printf("Menu :\n");
    printf("1) Choix n.1\n2) Choix n.2\n3) Choix n.3\nChoix : ");
    scanf("%s", answerTemp);
    strcpy(answer, answerTemp);
  } while (!condition(answer));
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x63,%edx
call   1060 <memset@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x63,%edx
call   1060 <memset@plt>
movl   $0x0,-0xe4(%rbp)
cmpl   $0x63,-0xe4(%rbp)
jge    11b8 <menu+0x68>
movslq -0xe4(%rbp),%rax
movb   $0x7,-0xe0(%rbp,%rax,1)
07
mov    -0xe4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe4(%rbp)
jmp    1188 <menu+0x38>
jmp    11bd <menu+0x6d>
lea    0xe3c(%rip),%rdi
call   1050 <printf@plt>
lea    0xe38(%rip),%rdi
call   1050 <printf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe55(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
call   1040 <condition@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11bd <menu+0x6d>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xcf(%rsp)
movaps 0xe5e(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x7070707,0x5f(%rsp)
07
lea    0xe75(%rip),%r14
lea    0xe3b(%rip),%r15
lea    0xe64(%rip),%r12
mov    %rsp,%r13
lea    0x70(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <condition@plt>
test   %eax,%eax
je     11f0 <menu+0xa0>
add    $0xe0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Menu :\0A\00"
@.str.1 = [48 x i8] c"1) Choix n.1\0A2) Choix n.2\0A3) Choix n.3\0AChoix : \00"
@.str.2 = [3 x i8] c"%s\00"
define void @menu() {
%1 = alloca [99 x i8]
%2 = alloca [99 x i8]
%3 = alloca i32
%4 = bitcast [99 x i8]* %1 to i8*
%5 = bitcast [99 x i8]* %2 to i8*
store i32 0, i32* %3
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 99
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [99 x i8], [99 x i8]* %2, i64 0, i64 %11
store i8 7, i8* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %6
16: ; preds = %6
br label %17
17: ; preds = %25, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%20 = getelementptr inbounds [99 x i8], [99 x i8]* %2, i64 0, i64 0
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [99 x i8], [99 x i8]* %1, i64 0, i64 0
%23 = getelementptr inbounds [99 x i8], [99 x i8]* %2, i64 0, i64 0
%24 = call i32 @strcpy(i8* %22, i8* %23)
br label %25
25: ; preds = %17
%26 = getelementptr inbounds [99 x i8], [99 x i8]* %1, i64 0, i64 0
%27 = call i32 @condition(i8* %26)
%28 = icmp ne i32 %27, 0
%29 = xor i1 %28, true
br i1 %29, label %17, label %30
30: ; preds = %25
ret void
}

LLVM IR (-O2):
@.str.1 = [48 x i8] c"1) Choix n.1\0A2) Choix n.2\0A3) Choix n.3\0AChoix : \00"
@.str.2 = [3 x i8] c"%s\00"
@str = [7 x i8] c"Menu :\00"
define void @menu() {
%1 = alloca [99 x i8]
%2 = alloca [99 x i8]
%3 = getelementptr inbounds [99 x i8], [99 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [99 x i8], [99 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [99 x i8], [99 x i8]* %2, i64 0, i64 0
br label %6
6: ; preds = %0, %6
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%10 = call i32 @strcpy(i8* %4, i8* %5)
%11 = call i32 @condition(i8* %4)
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6
ret void
}