#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 *);
void saisie_B_M(int B[9]) {
  int i;
  for (i = 0; i < 9; i++) {
    printf("Dans quel etat sera une cellule morte ayant %d voisins a la "
           "prochaine generation : ",
           i);
    scanf("%d", &B[i]);
    if ((B[i] != 0) && (B[i] != 1)) {
      printf("\n****** Erreur dans la saisie de l'etat de la cellule, veuillez "
             "saisir a nouveau ******");
      i--;
    }
  }
}


x86 assembly (clang, -O0):
<saisie_B_M>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    11b7 <saisie_B_M+0x97>
mov    -0xc(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xef0(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11a4 <saisie_B_M+0x84>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
je     11a4 <saisie_B_M+0x84>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11a9 <saisie_B_M+0x89>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <saisie_B_M+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saisie_B_M>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
lea    0xecb(%rip),%r14
lea    0xf18(%rip),%r15
lea    0xf14(%rip),%r12
xor    %ebx,%ebx
jmp    115a <saisie_B_M+0x3a>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%eax
cmp    $0x8,%ebx
mov    %eax,%ebx
jge    1193 <saisie_B_M+0x73>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movslq %ebx,%rbp
lea    0x0(,%rbp,4),%rsi
add    %r13,%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
cmpl   $0x2,0x0(%r13,%rbp,4)
jb     1150 <saisie_B_M+0x30>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jmp    1150 <saisie_B_M+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [84 x i8] c"Dans quel etat sera une cellule morte ayant %d voisins a la prochaine generation : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [88 x i8] c"\0A****** Erreur dans la saisie de l'etat de la cellule, veuillez saisir a nouveau ******\00"
define void @saisie_B_M(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %33, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 9
br i1 %6, label %7, label %36
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = load i32*, i32** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %32
21: ; preds = %7
%22 = load i32*, i32** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = icmp ne i32 %26, 1
br i1 %27, label %28, label %32
28: ; preds = %21
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* %3
%31 = add nsw i32 %30, -1
store i32 %31, i32* %3
br label %32
32: ; preds = %28, %21, %7
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %4
36: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [84 x i8] c"Dans quel etat sera une cellule morte ayant %d voisins a la prochaine generation : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [88 x i8] c"\0A****** Erreur dans la saisie de l'etat de la cellule, veuillez saisir a nouveau ******\00"
define void @saisie_B_M(i32* %0) {
br label %2
2: ; preds = %1, %13
%3 = phi i32 [ 0, %1 ], [ %15, %13 ]
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.2, i64 0, i64 0))
%12 = add nsw i32 %3, -1
br label %13
13: ; preds = %2, %10
%14 = phi i32 [ %12, %10 ], [ %3, %2 ]
%15 = add nsw i32 %14, 1
%16 = icmp slt i32 %14, 8
br i1 %16, label %2, label %17
17: ; preds = %13
ret void
}