#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*/ digit0();
int /*<<< orphan*/ digit1();
int /*<<< orphan*/ digit2();
int /*<<< orphan*/ digit3();
int /*<<< orphan*/ digit4();
int /*<<< orphan*/ digit5();
int /*<<< orphan*/ digit6();
int /*<<< orphan*/ digit7();
int /*<<< orphan*/ digit8();
int /*<<< orphan*/ digit9();
void showdigit(int digit) {
  switch (digit) {
  case 0:
    digit0();
    break;
  case 1:
    digit1();
    break;
  case 2:
    digit2();
    break;
  case 3:
    digit3();
    break;
  case 4:
    digit4();
    break;
  case 5:
    digit5();
    break;
  case 6:
    digit6();
    break;
  case 7:
    digit7();
    break;
  case 8:
    digit8();
    break;
  case 9:
    digit9();
    break;
  default:
    break;
  };
}


x86 assembly (clang, -O0):
<showdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     1248 <showdigit+0xa8>
mov    -0x10(%rbp),%rax
lea    0xe39(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10a0 <digit0@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   1030 <digit1@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   1080 <digit2@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   1060 <digit3@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   10b0 <digit4@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   1040 <digit5@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   1090 <digit6@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   1070 <digit7@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   10c0 <digit8@plt>
jmp    124d <showdigit+0xad>
mov    $0x0,%al
call   1050 <digit9@plt>
jmp    124d <showdigit+0xad>
jmp    124d <showdigit+0xad>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showdigit>:
cmp    $0x9,%edi
ja     11be <showdigit+0x1e>
mov    %edi,%eax
lea    0xe52(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
jmp    10a0 <digit0@plt>
ret
xor    %eax,%eax
jmp    1030 <digit1@plt>
xor    %eax,%eax
jmp    1080 <digit2@plt>
xor    %eax,%eax
jmp    1060 <digit3@plt>
xor    %eax,%eax
jmp    10b0 <digit4@plt>
xor    %eax,%eax
jmp    1040 <digit5@plt>
xor    %eax,%eax
jmp    1090 <digit6@plt>
xor    %eax,%eax
jmp    1070 <digit7@plt>
xor    %eax,%eax
jmp    1050 <digit9@plt>
xor    %eax,%eax
jmp    10c0 <digit8@plt>

LLVM IR (-O0):
define void @showdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %24 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 5, label %14
i32 6, label %16
i32 7, label %18
i32 8, label %20
i32 9, label %22
]
4: ; preds = %1
%5 = call i32 (...) @digit0()
br label %25
6: ; preds = %1
%7 = call i32 (...) @digit1()
br label %25
8: ; preds = %1
%9 = call i32 (...) @digit2()
br label %25
10: ; preds = %1
%11 = call i32 (...) @digit3()
br label %25
12: ; preds = %1
%13 = call i32 (...) @digit4()
br label %25
14: ; preds = %1
%15 = call i32 (...) @digit5()
br label %25
16: ; preds = %1
%17 = call i32 (...) @digit6()
br label %25
18: ; preds = %1
%19 = call i32 (...) @digit7()
br label %25
20: ; preds = %1
%21 = call i32 (...) @digit8()
br label %25
22: ; preds = %1
%23 = call i32 (...) @digit9()
br label %25
24: ; preds = %1
br label %25
25: ; preds = %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @showdigit(i32 %0) {
switch i32 %0, label %22 [
i32 0, label %2
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
]
2: ; preds = %1
%3 = tail call i32 (...) @digit0()
br label %22
4: ; preds = %1
%5 = tail call i32 (...) @digit1()
br label %22
6: ; preds = %1
%7 = tail call i32 (...) @digit2()
br label %22
8: ; preds = %1
%9 = tail call i32 (...) @digit3()
br label %22
10: ; preds = %1
%11 = tail call i32 (...) @digit4()
br label %22
12: ; preds = %1
%13 = tail call i32 (...) @digit5()
br label %22
14: ; preds = %1
%15 = tail call i32 (...) @digit6()
br label %22
16: ; preds = %1
%17 = tail call i32 (...) @digit7()
br label %22
18: ; preds = %1
%19 = tail call i32 (...) @digit8()
br label %22
20: ; preds = %1
%21 = tail call i32 (...) @digit9()
br label %22
22: ; preds = %1, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}