#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 showDice(int num) {
  switch (num) {
  case 1:
    printf("    +-------+\n");
    printf("    |       |\n");
    printf("    |   o   |\n");
    printf("    |       |\n");
    printf("    +-------+\n");
    break;
  case 2:
    printf("    +-------+\n");
    printf("    |       |\n");
    printf("    | o   o |\n");
    printf("    |       |\n");
    printf("    +-------+\n");
    break;
  case 3:
    printf("    +-------+\n");
    printf("    | o     |\n");
    printf("    |   o   |\n");
    printf("    |     o |\n");
    printf("    +-------+\n");
    break;
  case 4:
    printf("    +-------+\n");
    printf("    | o   o |\n");
    printf("    |       |\n");
    printf("    | o   o |\n");
    printf("    +-------+\n");
    break;
  case 5:
    printf("    +-------+\n");
    printf("    | o   o |\n");
    printf("    |   o   |\n");
    printf("    | o   o |\n");
    printf("    +-------+\n");
    break;
  case 6:
    printf("    +-------+\n");
    printf("    | o   o |\n");
    printf("    | o   o |\n");
    printf("    | o   o |\n");
    printf("    +-------+\n");
    break;
  default:
    printf("default answer");
    break;
  }
}


x86 assembly (clang, -O0):
<showDice>:
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    $0x5,%eax
ja     12ca <showDice+0x1ba>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    12d6 <showDice+0x1c6>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
jmp    12d6 <showDice+0x1c6>
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
jmp    12d6 <showDice+0x1c6>
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
lea    0xdda(%rip),%rdi
call   1030 <printf@plt>
jmp    12d6 <showDice+0x1c6>
lea    0xdc9(%rip),%rdi
call   1030 <printf@plt>
lea    0xdea(%rip),%rdi
call   1030 <printf@plt>
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
lea    0xd99(%rip),%rdi
call   1030 <printf@plt>
jmp    12d6 <showDice+0x1c6>
lea    0xd88(%rip),%rdi
call   1030 <printf@plt>
lea    0xda9(%rip),%rdi
call   1030 <printf@plt>
lea    0xd9d(%rip),%rdi
call   1030 <printf@plt>
lea    0xd91(%rip),%rdi
call   1030 <printf@plt>
lea    0xd58(%rip),%rdi
call   1030 <printf@plt>
jmp    12d6 <showDice+0x1c6>
lea    0xda1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showDice>:
push   %r14
push   %rbx
push   %rax
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     1157 <showDice+0x37>
lea    0xecd(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf2a(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rbx
jmp    1209 <showDice+0xe9>
lea    0xeba(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>
lea    0xefc(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
jmp    123b <showDice+0x11b>
lea    0xed2(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
jmp    124b <showDice+0x12b>
lea    0xe9a(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe61(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe6e(%rip),%rdi
jmp    123b <showDice+0x11b>
lea    0xe73(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe3a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe39(%rip),%rdi
jmp    123b <showDice+0x11b>
lea    0xe4c(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe13(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.6 = [15 x i8] c"default answer\00"
@str.22 = [14 x i8] c" | o |\00"
@str.24 = [14 x i8] c" | o |\00"
@str.28 = [14 x i8] c" | o o |\00"
@str.33 = [14 x i8] c" | o |\00"
@str.34 = [14 x i8] c" | |\00"
@str.35 = [14 x i8] c" +-------+\00"
define void @showDice(i32 %0) {
switch i32 %0, label %38 [
i32 1, label %2
i32 2, label %8
i32 3, label %14
i32 4, label %20
i32 5, label %26
i32 6, label %32
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.33, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
br label %40
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
br label %40
14: ; preds = %1
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.22, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.33, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.24, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
br label %40
20: ; preds = %1
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.34, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
br label %40
26: ; preds = %1
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.33, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
br label %40
32: ; preds = %1
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.28, i64 0, i64 0))
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.35, i64 0, i64 0))
br label %40
38: ; preds = %1
%39 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %40
40: ; preds = %38, %32, %26, %20, %14, %8, %2
ret void
}