#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, int);
void print_class1(int class, int win, int lost) {
  switch (class) {
  case 1:
    printf(": Druid      Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 2:
    printf(": Hunter     Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 3:
    printf(": Mage       Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 4:
    printf(": Paladin    Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 5:
    printf(": Priest     Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 6:
    printf(": Rogue      Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 7:
    printf(": Shaman     Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 8:
    printf(": Warlock    Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  case 9:
    printf(": Warrior    Wins - %2.d   Loss - %d  :\n", win, lost);
    break;
  }
}


x86 assembly (clang, -O0):
<print_class1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x8,%eax
ja     1214 <print_class1+0x104>
mov    -0x18(%rbp),%rax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xf27(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xf39(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xf4b(%rip),%rdi
call   1030 <printf@plt>
jmp    1214 <print_class1+0x104>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xf5d(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_class1>:
add    $0xffffffff,%edi
cmp    $0x8,%edi
ja     112e <print_class1+0x1e>
movslq %edi,%rax
lea    0x1052(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [41 x i8] c": Druid Wins - %2.d Loss - %d :\0A\00"
@.str.1 = [41 x i8] c": Hunter Wins - %2.d Loss - %d :\0A\00"
@.str.2 = [41 x i8] c": Mage Wins - %2.d Loss - %d :\0A\00"
@.str.3 = [41 x i8] c": Paladin Wins - %2.d Loss - %d :\0A\00"
@.str.4 = [41 x i8] c": Priest Wins - %2.d Loss - %d :\0A\00"
@.str.5 = [41 x i8] c": Rogue Wins - %2.d Loss - %d :\0A\00"
@.str.6 = [41 x i8] c": Shaman Wins - %2.d Loss - %d :\0A\00"
@.str.7 = [41 x i8] c": Warlock Wins - %2.d Loss - %d :\0A\00"
@.str.8 = [41 x i8] c": Warrior Wins - %2.d Loss - %d :\0A\00"
define void @print_class1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %44 [
i32 1, label %8
i32 2, label %12
i32 3, label %16
i32 4, label %20
i32 5, label %24
i32 6, label %28
i32 7, label %32
i32 8, label %36
i32 9, label %40
]
8: ; preds = %3
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %44
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
br label %44
16: ; preds = %3
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %18)
br label %44
20: ; preds = %3
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %22)
br label %44
24: ; preds = %3
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %25, i32 %26)
br label %44
28: ; preds = %3
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %29, i32 %30)
br label %44
32: ; preds = %3
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), i32 %33, i32 %34)
br label %44
36: ; preds = %3
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i32 %37, i32 %38)
br label %44
40: ; preds = %3
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 %41, i32 %42)
br label %44
44: ; preds = %3, %40, %36, %32, %28, %24, %20, %16, %12, %8
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c": Druid Wins - %2.d Loss - %d :\0A\00"
@.str.1 = [41 x i8] c": Hunter Wins - %2.d Loss - %d :\0A\00"
@.str.2 = [41 x i8] c": Mage Wins - %2.d Loss - %d :\0A\00"
@.str.3 = [41 x i8] c": Paladin Wins - %2.d Loss - %d :\0A\00"
@.str.4 = [41 x i8] c": Priest Wins - %2.d Loss - %d :\0A\00"
@.str.5 = [41 x i8] c": Rogue Wins - %2.d Loss - %d :\0A\00"
@.str.6 = [41 x i8] c": Shaman Wins - %2.d Loss - %d :\0A\00"
@.str.7 = [41 x i8] c": Warlock Wins - %2.d Loss - %d :\0A\00"
@.str.8 = [41 x i8] c": Warrior Wins - %2.d Loss - %d :\0A\00"
@reltable.print_class1 = [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.1 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.2 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.3 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.4 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.5 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.6 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.7 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.8 to i64), i64 ptrtoint ([9 x i32]* @reltable.print_class1 to i64)) to i32)]
define void @print_class1(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 9
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([9 x i32]* @reltable.print_class1 to i8*), i64 %8)
%10 = tail call i32 @printf(i8* %9, i32 %1, i32 %2)
br label %11
11: ; preds = %3, %6
ret void
}