#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 */
scalar_t__ estDansListeDeJeux(int);
int debloquerProchainJeux(void) {
  int index, nbJeuxDebloqueVIP;
  nbJeuxDebloqueVIP = 0;
  for (index = 0; index < 8; index++) {
    if (estDansListeDeJeux(index) == 0) {
      if (nbJeuxDebloqueVIP == 0)
        return index;
      else
        break;
      nbJeuxDebloqueVIP++;
    }
  }
}


x86 assembly (clang, -O0):
<debloquerProchainJeux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    116f <debloquerProchainJeux+0x5f>
mov    -0x8(%rbp),%edi
call   1030 <estDansListeDeJeux@plt>
cmp    $0x0,%rax
jne    115c <debloquerProchainJeux+0x4c>
cmpl   $0x0,-0xc(%rbp)
jne    1157 <debloquerProchainJeux+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <debloquerProchainJeux+0x5f>
jmp    116f <debloquerProchainJeux+0x5f>
jmp    1161 <debloquerProchainJeux+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <debloquerProchainJeux+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debloquerProchainJeux>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <estDansListeDeJeux@plt>
test   %rax,%rax
je     11b1 <debloquerProchainJeux+0xa1>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <estDansListeDeJeux@plt>
test   %rax,%rax
je     11b1 <debloquerProchainJeux+0xa1>
mov    $0x2,%ebx
mov    $0x2,%edi
call   1030 <estDansListeDeJeux@plt>
test   %rax,%rax
je     11b1 <debloquerProchainJeux+0xa1>
mov    $0x3,%ebx
mov    $0x3,%edi
call   1030 <estDansListeDeJeux@plt>
test   %rax,%rax
je     11b1 <debloquerProchainJeux+0xa1>
mov    $0x4,%ebx
mov    $0x4,%edi
call   1030 <estDansListeDeJeux@plt>
test   %rax,%rax
je     11b1 <debloquerProchainJeux+0xa1>
mov    $0x5,%ebx
mov    $0x5,%edi
call   1030 <estDansListeDeJeux@plt>
test   %rax,%rax
je     11b1 <debloquerProchainJeux+0xa1>
mov    $0x6,%ebx
mov    $0x6,%edi
call   1030 <estDansListeDeJeux@plt>
test   %rax,%rax
je     11b1 <debloquerProchainJeux+0xa1>
mov    $0x7,%edi
call   1030 <estDansListeDeJeux@plt>
cmp    $0x1,%rax
mov    $0x8,%ebx
sbb    $0x0,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @debloquerProchainJeux() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i64 @estDansListeDeJeux(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* %2
store i32 %15, i32* %1
br label %21
16: ; preds = %11
br label %21
17: ; preds = %7
br label %18
18: ; preds = %17
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %4
21: ; preds = %14, %16, %4
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
define i32 @debloquerProchainJeux() {
%1 = tail call i64 @estDansListeDeJeux(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %25, label %3
3: ; preds = %0
%4 = tail call i64 @estDansListeDeJeux(i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %25, label %6
6: ; preds = %3
%7 = tail call i64 @estDansListeDeJeux(i32 2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %6
%10 = tail call i64 @estDansListeDeJeux(i32 3)
%11 = icmp eq i64 %10, 0
br i1 %11, label %25, label %12
12: ; preds = %9
%13 = tail call i64 @estDansListeDeJeux(i32 4)
%14 = icmp eq i64 %13, 0
br i1 %14, label %25, label %15
15: ; preds = %12
%16 = tail call i64 @estDansListeDeJeux(i32 5)
%17 = icmp eq i64 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %15
%19 = tail call i64 @estDansListeDeJeux(i32 6)
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %18
%22 = tail call i64 @estDansListeDeJeux(i32 7)
%23 = icmp eq i64 %22, 0
%24 = select i1 %23, i32 7, i32 8
br label %25
25: ; preds = %21, %18, %15, %12, %9, %6, %3, %0
%26 = phi i32 [ 0, %0 ], [ 1, %3 ], [ 2, %6 ], [ 3, %9 ], [ 4, %12 ], [ 5, %15 ], [ 6, %18 ], [ %24, %21 ]
ret i32 %26
}