#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*/ fflush(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int /*<<< orphan*/ stdin;
int saisirJet() {
  int i, err = 0, c;
  do {
    printf(">> ");
    err = scanf("%i", &i);
    while ((c = getchar()) != '\n')
      ;
    fflush(stdin);
  } while (err == 0 || i > 12 || i < 2);
  return i;
}


x86 assembly (clang, -O0):
<saisirJet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1186 <saisirJet+0x46>
jmp    116e <saisirJet+0x2e>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11bc <saisirJet+0x7c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jg     11bc <saisirJet+0x7c>
cmpl   $0x2,-0x4(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114f <saisirJet+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saisirJet>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xead(%rip),%r14
lea    0xeaa(%rip),%r15
lea    0xc(%rsp),%r12
mov    0x2e82(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1190 <saisirJet+0x50>
mov    (%rbx),%edi
call   1050 <fflush@plt>
test   %ebp,%ebp
je     1170 <saisirJet+0x30>
mov    0xc(%rsp),%eax
cmp    $0xc,%eax
jg     1170 <saisirJet+0x30>
cmp    $0x2,%eax
jl     1170 <saisirJet+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c">> \00"
@.str.1 = [3 x i8] c"%i\00"
@stdin = global i32 0
define i32 @saisirJet() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %23, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
store i32 %6, i32* %2
br label %7
7: ; preds = %10, %4
%8 = call i32 (...) @getchar()
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %7
br label %7
11: ; preds = %7
%12 = load i32, i32* @stdin
%13 = call i32 @fflush(i32 %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i32, i32* %1
%19 = icmp sgt i32 %18, 12
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %1
%22 = icmp slt i32 %21, 2
br label %23
23: ; preds = %20, %17, %14
%24 = phi i1 [ true, %17 ], [ true, %14 ], [ %22, %20 ]
br i1 %24, label %4, label %25
25: ; preds = %23
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@.str = [4 x i8] c">> \00"
@.str.1 = [3 x i8] c"%i\00"
@stdin = global i32 0
define i32 @saisirJet() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %9, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %6
6: ; preds = %6, %3
%7 = call i32 (...) @getchar()
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %6
9: ; preds = %6
%10 = load i32, i32* @stdin
%11 = call i32 @fflush(i32 %10)
%12 = icmp eq i32 %5, 0
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 12
%15 = select i1 %12, i1 true, i1 %14
%16 = icmp slt i32 %13, 2
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %3, label %18
18: ; preds = %9
ret i32 %13
}