#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*/ Clean_Music();
int /*<<< orphan*/ Load_Music(char *);
int /*<<< orphan*/ Play_Music(unsigned char);
void Play_GameMusic(unsigned char song) {
  unsigned char loop;
  Clean_Music();
  loop = 1;
  switch (song) {
  case 0:
    Load_Music("MUS/auss.mp3");
    break;
  case 1:
    Load_Music("MUS/batt.mp3");
    break;
  case 2:
    Load_Music("MUS/end.mp3");
    break;
  case 3:
    Load_Music("MUS/inst.mp3");
    loop = 0;
    break;
  case 4:
    Load_Music("MUS/hero.mp3");
    break;
  case 5:
    Load_Music("MUS/win.mp3");
    loop = 0;
    break;
  }
  Play_Music(loop);
}


x86 assembly (clang, -O0):
<Play_GameMusic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
call   1050 <Clean_Music@plt>
movb   $0x1,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     11d8 <Play_GameMusic+0xa8>
mov    -0x10(%rbp),%rax
lea    0xe9a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea2(%rip),%rdi
call   1040 <Load_Music@plt>
jmp    11d8 <Play_GameMusic+0xa8>
lea    0xe9e(%rip),%rdi
call   1040 <Load_Music@plt>
jmp    11d8 <Play_GameMusic+0xa8>
lea    0xe9a(%rip),%rdi
call   1040 <Load_Music@plt>
jmp    11d8 <Play_GameMusic+0xa8>
lea    0xe95(%rip),%rdi
call   1040 <Load_Music@plt>
movb   $0x0,-0x2(%rbp)
jmp    11d8 <Play_GameMusic+0xa8>
lea    0xe8d(%rip),%rdi
call   1040 <Load_Music@plt>
jmp    11d8 <Play_GameMusic+0xa8>
lea    0xe89(%rip),%rdi
call   1040 <Load_Music@plt>
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <Play_Music@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Play_GameMusic>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <Clean_Music@plt>
mov    $0x1,%bl
cmp    $0x5,%bpl
ja     116f <Play_GameMusic+0x3f>
movsbq %bpl,%rax
lea    0xefd(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
movzbl %bpl,%ecx
shl    $0x3,%ecx
movabs $0x100010101,%rbx
shr    %cl,%rbx
call   1040 <Load_Music@plt>
movzbl %bl,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <Play_Music@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"MUS/auss.mp3\00"
@.str.1 = [13 x i8] c"MUS/batt.mp3\00"
@.str.2 = [12 x i8] c"MUS/end.mp3\00"
@.str.3 = [13 x i8] c"MUS/inst.mp3\00"
@.str.4 = [13 x i8] c"MUS/hero.mp3\00"
@.str.5 = [12 x i8] c"MUS/win.mp3\00"
define void @Play_GameMusic(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 (...) @Clean_Music()
store i8 1, i8* %3
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
switch i32 %6, label %19 [
i32 0, label %7
i32 1, label %9
i32 2, label %11
i32 3, label %13
i32 4, label %15
i32 5, label %17
]
7: ; preds = %1
%8 = call i32 @Load_Music(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %19
9: ; preds = %1
%10 = call i32 @Load_Music(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %19
11: ; preds = %1
%12 = call i32 @Load_Music(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %19
13: ; preds = %1
%14 = call i32 @Load_Music(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i8 0, i8* %3
br label %19
15: ; preds = %1
%16 = call i32 @Load_Music(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %19
17: ; preds = %1
%18 = call i32 @Load_Music(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
store i8 0, i8* %3
br label %19
19: ; preds = %1, %17, %15, %13, %11, %9, %7
%20 = load i8, i8* %3
%21 = call i32 @Play_Music(i8 zeroext %20)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"MUS/auss.mp3\00"
@.str.1 = [13 x i8] c"MUS/batt.mp3\00"
@.str.2 = [12 x i8] c"MUS/end.mp3\00"
@.str.3 = [13 x i8] c"MUS/inst.mp3\00"
@.str.4 = [13 x i8] c"MUS/hero.mp3\00"
@.str.5 = [12 x i8] c"MUS/win.mp3\00"
@reltable.Play_GameMusic = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.Play_GameMusic to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.Play_GameMusic to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.Play_GameMusic to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.3 to i64), i64 ptrtoint ([6 x i32]* @reltable.Play_GameMusic to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.4 to i64), i64 ptrtoint ([6 x i32]* @reltable.Play_GameMusic to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.5 to i64), i64 ptrtoint ([6 x i32]* @reltable.Play_GameMusic to i64)) to i32)]
define void @Play_GameMusic(i8 zeroext %0) {
%2 = tail call i32 (...) @Clean_Music()
%3 = icmp ult i8 %0, 6
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = sext i8 %0 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.Play_GameMusic to i8*), i64 %6)
%8 = zext i8 %0 to i48
%9 = shl nuw nsw i48 %8, 3
%10 = lshr i48 4295033089, %9
%11 = trunc i48 %10 to i8
%12 = tail call i32 @Load_Music(i8* %7)
br label %13
13: ; preds = %1, %4
%14 = phi i8 [ 1, %1 ], [ %11, %4 ]
%15 = tail call i32 @Play_Music(i8 zeroext %14)
ret void
}