#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 *, ...);
void printswitch(int ploidy) {
  switch (ploidy) {
  case 1:
    printf("HAPLOID");
    break;
  case 2:
    printf("DIPLOID");
    break;
  case 3:
    printf("TRIPLOID");
    break;
  case 4:
    printf("TETRAPLOID");
    break;
  case 5:
    printf("PENTAPLOID");
    break;
  case 6:
    printf("HEXAPLOID");
    break;
  case 7:
    printf("SEPTAPLOID");
    break;
  case 8:
    printf("OCTAPLOID");
    break;
  case 9:
    printf("NONAPLOID");
    break;
  case 10:
    printf("DECAPLOID");
    break;
  case 11:
    printf("HENDECAPLOID");
    break;
  case 12:
    printf("DODECAPLOID");
    break;
  default:
    printf("%d-PLOID", ploidy);
    break;
  }
}


x86 assembly (clang, -O0):
<printswitch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xb,%eax
ja     1228 <printswitch+0x118>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1239 <printswitch+0x129>
mov    -0x4(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printswitch>:
mov    %edi,%esi
lea    -0x1(%rsi),%eax
cmp    $0xb,%eax
ja     11d6 <printswitch+0xc6>
lea    0xedb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xefb(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xef5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeef(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xee4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"HAPLOID\00"
@.str.1 = [8 x i8] c"DIPLOID\00"
@.str.2 = [9 x i8] c"TRIPLOID\00"
@.str.3 = [11 x i8] c"TETRAPLOID\00"
@.str.4 = [11 x i8] c"PENTAPLOID\00"
@.str.5 = [10 x i8] c"HEXAPLOID\00"
@.str.6 = [11 x i8] c"SEPTAPLOID\00"
@.str.7 = [10 x i8] c"OCTAPLOID\00"
@.str.8 = [10 x i8] c"NONAPLOID\00"
@.str.9 = [10 x i8] c"DECAPLOID\00"
@.str.10 = [13 x i8] c"HENDECAPLOID\00"
@.str.11 = [12 x i8] c"DODECAPLOID\00"
@.str.12 = [9 x i8] c"%d-PLOID\00"
define void @printswitch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %28 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %14
i32 7, label %16
i32 8, label %18
i32 9, label %20
i32 10, label %22
i32 11, label %24
i32 12, label %26
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %31
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %31
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %31
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %31
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %31
14: ; preds = %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %31
16: ; preds = %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %31
18: ; preds = %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %31
20: ; preds = %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %31
22: ; preds = %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %31
24: ; preds = %1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %31
26: ; preds = %1
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
br label %31
28: ; preds = %1
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"HAPLOID\00"
@.str.1 = [8 x i8] c"DIPLOID\00"
@.str.2 = [9 x i8] c"TRIPLOID\00"
@.str.3 = [11 x i8] c"TETRAPLOID\00"
@.str.4 = [11 x i8] c"PENTAPLOID\00"
@.str.5 = [10 x i8] c"HEXAPLOID\00"
@.str.6 = [11 x i8] c"SEPTAPLOID\00"
@.str.7 = [10 x i8] c"OCTAPLOID\00"
@.str.8 = [10 x i8] c"NONAPLOID\00"
@.str.9 = [10 x i8] c"DECAPLOID\00"
@.str.10 = [13 x i8] c"HENDECAPLOID\00"
@.str.11 = [12 x i8] c"DODECAPLOID\00"
@.str.12 = [9 x i8] c"%d-PLOID\00"
define void @printswitch(i32 %0) {
switch i32 %0, label %26 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
i32 5, label %10
i32 6, label %12
i32 7, label %14
i32 8, label %16
i32 9, label %18
i32 10, label %20
i32 11, label %22
i32 12, label %24
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %28
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %28
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %28
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %28
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %28
12: ; preds = %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %28
14: ; preds = %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %28
16: ; preds = %1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %28
18: ; preds = %1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %28
20: ; preds = %1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %28
22: ; preds = %1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %28
24: ; preds = %1
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
br label %28
26: ; preds = %1
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %0)
br label %28
28: ; preds = %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}