#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*/ actionMagasin(int);
int afficherMagasin();
int choixMenu(int, int);
int /*<<< orphan*/ magasinPointsVIP();
int menuMagasinChoix();
int /*<<< orphan*/ titre(char *);
void magasin(void) {
  int maxJeux;
  int menuChoisis, choix;
  titre("Magasin");
  menuChoisis = menuMagasinChoix();
  if (menuChoisis == 1) {
    do {
      maxJeux = afficherMagasin();
      choix = choixMenu(1, maxJeux);
      actionMagasin(choix);
    } while (choix != -1 || choix != 0);
  } else
    magasinPointsVIP();
}


x86 assembly (clang, -O0):
<magasin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
call   1080 <titre@plt>
mov    $0x0,%al
call   1040 <menuMagasinChoix@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11d8 <magasin+0x78>
jmp    118d <magasin+0x2d>
mov    $0x0,%al
call   1050 <afficherMagasin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <choixMenu@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1070 <actionMagasin@plt>
mov    $0x1,%al
cmpl   $0xffffffff,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jne    11c8 <magasin+0x68>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    118d <magasin+0x2d>
jmp    11df <magasin+0x7f>
mov    $0x0,%al
call   1060 <magasinPointsVIP@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magasin>:
push   %rax
lea    0xe98(%rip),%rdi
call   1080 <titre@plt>
xor    %eax,%eax
call   1040 <menuMagasinChoix@plt>
cmp    $0x1,%eax
jne    119c <magasin+0x3c>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <afficherMagasin@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1030 <choixMenu@plt>
mov    %eax,%edi
call   1070 <actionMagasin@plt>
jmp    1180 <magasin+0x20>
xor    %eax,%eax
pop    %rcx
jmp    1060 <magasinPointsVIP@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Magasin\00"
define void @magasin() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @titre(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @menuMagasinChoix()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %24
8: ; preds = %0
br label %9
9: ; preds = %21, %8
%10 = call i32 (...) @afficherMagasin()
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = call i32 @choixMenu(i32 1, i32 %11)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 @actionMagasin(i32 %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = icmp ne i32 %16, -1
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %18, %15
%22 = phi i1 [ true, %15 ], [ %20, %18 ]
br i1 %22, label %9, label %23
23: ; preds = %21
br label %26
24: ; preds = %0
%25 = call i32 (...) @magasinPointsVIP()
br label %26
26: ; preds = %24, %23
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Magasin\00"
define void @magasin() {
%1 = tail call i32 @titre(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @menuMagasinChoix()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %0, %4
%5 = tail call i32 (...) @afficherMagasin()
%6 = tail call i32 @choixMenu(i32 1, i32 %5)
%7 = tail call i32 @actionMagasin(i32 %6)
br label %4
8: ; preds = %0
%9 = tail call i32 (...) @magasinPointsVIP()
ret void
}