#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 display_messages(int message) {
  if (message == 1) {
    printf("*******************************************************************"
           "************\n");
    printf("***************************** Welcome to Craps "
           "********************************\n");
    printf("*******************************************************************"
           "************\n\n");
  } else if (message == 2) {
    printf("Please set your wager first.\n");
  } else if (message == 3) {
    printf("*******************************************************************"
           "************\n");
    printf("*********************** Defeat!!!!!!!!!!!!!!!!!!!!!! "
           "**************************\n");
    printf("*******************************************************************"
           "************\n\n");
  }
}


x86 assembly (clang, -O0):
<display_messages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114e <display_messages+0x3e>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf19(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5e(%rip),%rdi
call   1030 <printf@plt>
jmp    11a1 <display_messages+0x91>
cmpl   $0x2,-0x8(%rbp)
jne    1169 <display_messages+0x59>
lea    0xf95(%rip),%rdi
call   1030 <printf@plt>
jmp    119c <display_messages+0x8c>
cmpl   $0x3,-0x8(%rbp)
jne    1197 <display_messages+0x87>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
jmp    119c <display_messages+0x8c>
jmp    11a1 <display_messages+0x91>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_messages>:
push   %rbx
cmp    $0x1,%edi
je     1129 <display_messages+0x19>
cmp    $0x2,%edi
je     114d <display_messages+0x3d>
cmp    $0x3,%edi
jne    1159 <display_messages+0x49>
lea    0xed9(%rip),%rbx
jmp    1130 <display_messages+0x20>
lea    0xf8d(%rip),%rbx
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xfc2(%rip),%rdi
jmp    1154 <display_messages+0x44>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [81 x i8] c"*******************************************************************************\0A\00"
@.str.1 = [81 x i8] c"***************************** Welcome to Craps ********************************\0A\00"
@.str.2 = [82 x i8] c"*******************************************************************************\0A\0A\00"
@.str.3 = [30 x i8] c"Please set your wager first.\0A\00"
@.str.4 = [81 x i8] c"*********************** Defeat!!!!!!!!!!!!!!!!!!!!!! **************************\0A\00"
define i32 @display_messages(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.2, i64 0, i64 0))
br label %24
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %23
15: ; preds = %10
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %18, %15
br label %23
23: ; preds = %22, %13
br label %24
24: ; preds = %23, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@str.5 = [80 x i8] c"*********************** Defeat!!!!!!!!!!!!!!!!!!!!!! **************************\00"
@str.7 = [29 x i8] c"Please set your wager first.\00"
@str.8 = [80 x i8] c"*******************************************************************************\00"
@str.9 = [80 x i8] c"***************************** Welcome to Craps ********************************\00"
@str.10 = [81 x i8] c"*******************************************************************************\0A\00"
define i32 @display_messages(i32 %0) {
switch i32 %0, label %12 [
i32 1, label %3
i32 2, label %9
i32 3, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i8* [ getelementptr inbounds ([80 x i8], [80 x i8]* @str.8, i64 0, i64 0), %2 ], [ getelementptr inbounds ([80 x i8], [80 x i8]* @str.8, i64 0, i64 0), %1 ]
%5 = phi i8* [ getelementptr inbounds ([80 x i8], [80 x i8]* @str.5, i64 0, i64 0), %2 ], [ getelementptr inbounds ([80 x i8], [80 x i8]* @str.9, i64 0, i64 0), %1 ]
%6 = phi i8* [ getelementptr inbounds ([81 x i8], [81 x i8]* @str.10, i64 0, i64 0), %2 ], [ getelementptr inbounds ([81 x i8], [81 x i8]* @str.10, i64 0, i64 0), %1 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %4)
%8 = tail call i32 @puts(i8* dereferenceable(1) %5)
br label %9
9: ; preds = %3, %1
%10 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.7, i64 0, i64 0), %1 ], [ %6, %3 ]
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
br label %12
12: ; preds = %9, %1
ret i32 undef
}