#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int choose_size() {
  int size;
  printf("Entrer la taille du jeu (entre 3 et 24) :\n");
  scanf("%d", &size);
  while (size < 3 || size > 24) {
    printf("La taille doit être comprise entre 4 et 24.\n");
    scanf("%d", &size);
  }
  return size;
}


x86 assembly (clang, -O0):
<choose_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x3,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     115d <choose_size+0x3d>
cmpl   $0x18,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    116d <choose_size+0x4d>
jmp    118e <choose_size+0x6e>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1144 <choose_size+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose_size>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x19(%rax),%ecx
cmp    $0xffffffe9,%ecx
ja     118f <choose_size+0x6f>
lea    0xed4(%rip),%r14
lea    0xea0(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x19(%rax),%ecx
cmp    $0xffffffea,%ecx
jb     1170 <choose_size+0x50>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Entrer la taille du jeu (entre 3 et 24) :\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [46 x i8] c"La taille doit \C3\AAtre comprise entre 4 et 24.\0A\00"
define i32 @choose_size() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 3
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 24
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ true, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %4
15: ; preds = %10
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [42 x i8] c"Entrer la taille du jeu (entre 3 et 24) :\00"
@str.3 = [45 x i8] c"La taille doit \C3\AAtre comprise entre 4 et 24.\00"
define i32 @choose_size() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add i32 %5, -25
%7 = icmp ult i32 %6, -22
br i1 %7, label %8, label %14
8: ; preds = %0, %8
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = add i32 %11, -25
%13 = icmp ult i32 %12, -22
br i1 %13, label %8, label %14
14: ; preds = %8, %0
%15 = phi i32 [ %5, %0 ], [ %11, %8 ]
ret i32 %15
}