#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*/ diagd(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ diagu(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ horizontal(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ vertical(int, int, int /*<<< orphan*/);
void drawThousands(int thousands) {
  switch (thousands) {
  case 1:
    horizontal(0, 4, 14);
    break;
  case 2:
    horizontal(0, 4, 10);
    break;
  case 3:
    diagd(0, 4, 10);
    break;
  case 4:
    diagu(0, 4, 14);
    break;
  case 5:
    drawThousands(1);
    drawThousands(4);
    break;
  case 6:
    vertical(10, 14, 0);
    break;
  case 7:
    drawThousands(1);
    drawThousands(6);
    break;
  case 8:
    drawThousands(2);
    drawThousands(6);
    break;
  case 9:
    drawThousands(1);
    drawThousands(8);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<drawThousands>:
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    $0x8,%eax
ja     1256 <drawThousands+0x106>
mov    -0x10(%rbp),%rax
lea    0xe85(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xe,%edx
call   1060 <horizontal@plt>
jmp    125b <drawThousands+0x10b>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xa,%edx
call   1060 <horizontal@plt>
jmp    125b <drawThousands+0x10b>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xa,%edx
call   1070 <diagd@plt>
jmp    125b <drawThousands+0x10b>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xe,%edx
call   1040 <diagu@plt>
jmp    125b <drawThousands+0x10b>
mov    $0x1,%edi
call   1050 <drawThousands@plt>
mov    $0x4,%edi
call   1050 <drawThousands@plt>
jmp    125b <drawThousands+0x10b>
mov    $0xa,%edi
mov    $0xe,%esi
xor    %edx,%edx
call   1030 <vertical@plt>
jmp    125b <drawThousands+0x10b>
mov    $0x1,%edi
call   1050 <drawThousands@plt>
mov    $0x6,%edi
call   1050 <drawThousands@plt>
jmp    125b <drawThousands+0x10b>
mov    $0x2,%edi
call   1050 <drawThousands@plt>
mov    $0x6,%edi
call   1050 <drawThousands@plt>
jmp    125b <drawThousands+0x10b>
mov    $0x1,%edi
call   1050 <drawThousands@plt>
mov    $0x8,%edi
call   1050 <drawThousands@plt>
jmp    125b <drawThousands+0x10b>
jmp    125b <drawThousands+0x10b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawThousands>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x8,%edi
ja     116b <drawThousands+0x2b>
lea    0xeb0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xe,%edx
pop    %rax
jmp    1050 <horizontal@plt>
pop    %rax
ret
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xa,%edx
pop    %rax
jmp    1050 <horizontal@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xa,%edx
pop    %rax
jmp    1060 <diagd@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xe,%edx
call   1050 <horizontal@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xe,%edx
pop    %rax
jmp    1040 <diagu@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xe,%edx
jmp    11df <drawThousands+0x9f>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xe,%edx
call   1050 <horizontal@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0xa,%edx
call   1050 <horizontal@plt>
mov    $0xa,%edi
mov    $0xe,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <vertical@plt>

LLVM IR (-O0):
define void @drawThousands(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %18 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %13
i32 7, label %15
i32 8, label %16
i32 9, label %17
]
4: ; preds = %1
%5 = call i32 @horizontal(i32 0, i32 4, i32 14)
br label %19
6: ; preds = %1
%7 = call i32 @horizontal(i32 0, i32 4, i32 10)
br label %19
8: ; preds = %1
%9 = call i32 @diagd(i32 0, i32 4, i32 10)
br label %19
10: ; preds = %1
%11 = call i32 @diagu(i32 0, i32 4, i32 14)
br label %19
12: ; preds = %1
br label %19
13: ; preds = %1
%14 = call i32 @vertical(i32 10, i32 14, i32 0)
br label %19
15: ; preds = %1
br label %19
16: ; preds = %1
br label %19
17: ; preds = %1
br label %19
18: ; preds = %1
br label %19
19: ; preds = %18, %17, %16, %15, %13, %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @drawThousands(i32 %0) {
switch i32 %0, label %25 [
i32 1, label %2
i32 2, label %4
i32 3, label %6
i32 4, label %8
i32 5, label %10
i32 6, label %13
i32 7, label %15
i32 8, label %18
i32 9, label %21
]
2: ; preds = %1
%3 = tail call i32 @horizontal(i32 0, i32 4, i32 14)
br label %25
4: ; preds = %1
%5 = tail call i32 @horizontal(i32 0, i32 4, i32 10)
br label %25
6: ; preds = %1
%7 = tail call i32 @diagd(i32 0, i32 4, i32 10)
br label %25
8: ; preds = %1
%9 = tail call i32 @diagu(i32 0, i32 4, i32 14)
br label %25
10: ; preds = %1
%11 = tail call i32 @horizontal(i32 0, i32 4, i32 14)
%12 = tail call i32 @diagu(i32 0, i32 4, i32 14)
br label %25
13: ; preds = %1
%14 = tail call i32 @vertical(i32 10, i32 14, i32 0)
br label %25
15: ; preds = %1
%16 = tail call i32 @horizontal(i32 0, i32 4, i32 14)
%17 = tail call i32 @vertical(i32 10, i32 14, i32 0)
br label %25
18: ; preds = %1
%19 = tail call i32 @horizontal(i32 0, i32 4, i32 10)
%20 = tail call i32 @vertical(i32 10, i32 14, i32 0)
br label %25
21: ; preds = %1
%22 = tail call i32 @horizontal(i32 0, i32 4, i32 14)
%23 = tail call i32 @horizontal(i32 0, i32 4, i32 10)
%24 = tail call i32 @vertical(i32 10, i32 14, i32 0)
br label %25
25: ; preds = %1, %21, %18, %15, %13, %10, %8, %6, %4, %2
ret void
}