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


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

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

LLVM IR (-O0):
define void @drawOnes(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 6, i32 10, i32 0)
br label %19
6: ; preds = %1
%7 = call i32 @horizontal(i32 6, i32 10, i32 4)
br label %19
8: ; preds = %1
%9 = call i32 @diagd(i32 6, i32 10, i32 0)
br label %19
10: ; preds = %1
%11 = call i32 @diagu(i32 6, i32 10, i32 4)
br label %19
12: ; preds = %1
br label %19
13: ; preds = %1
%14 = call i32 @vertical(i32 0, i32 4, i32 10)
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 @drawOnes(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 6, i32 10, i32 0)
br label %25
4: ; preds = %1
%5 = tail call i32 @horizontal(i32 6, i32 10, i32 4)
br label %25
6: ; preds = %1
%7 = tail call i32 @diagd(i32 6, i32 10, i32 0)
br label %25
8: ; preds = %1
%9 = tail call i32 @diagu(i32 6, i32 10, i32 4)
br label %25
10: ; preds = %1
%11 = tail call i32 @horizontal(i32 6, i32 10, i32 0)
%12 = tail call i32 @diagu(i32 6, i32 10, i32 4)
br label %25
13: ; preds = %1
%14 = tail call i32 @vertical(i32 0, i32 4, i32 10)
br label %25
15: ; preds = %1
%16 = tail call i32 @horizontal(i32 6, i32 10, i32 0)
%17 = tail call i32 @vertical(i32 0, i32 4, i32 10)
br label %25
18: ; preds = %1
%19 = tail call i32 @horizontal(i32 6, i32 10, i32 4)
%20 = tail call i32 @vertical(i32 0, i32 4, i32 10)
br label %25
21: ; preds = %1
%22 = tail call i32 @horizontal(i32 6, i32 10, i32 0)
%23 = tail call i32 @horizontal(i32 6, i32 10, i32 4)
%24 = tail call i32 @vertical(i32 0, i32 4, i32 10)
br label %25
25: ; preds = %1, %21, %18, %15, %13, %10, %8, %6, %4, %2
ret void
}