#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 *, ...);
int print_number(int val) {
  switch (val) {
  case 0:
    printf("%s", "  ");
    break;
  case 1:
  case 8:
    printf("\033[35;1m%2d\033[0m", val);
    break;
  case 2:
  case 7:
    printf("\033[32;1m%2d\033[0m", val);
    break;
  case 3:
  case 6:
    printf("\033[33;1m%2d\033[0m", val);
    break;
  case 4:
  case 5:
    printf("\033[31;1m%2d\033[0m", val);
    break;
  case 456:
    printf("\033[31;41;1m%2s\033[0m", "!F");
    break;
  case 123:
    printf("\033[31;44;1m%2s\033[0m", "  ");
    break;
  case 1000:
    printf("\033[31;46;1m%2s\033[0m", "#*");
    break;
  }
  return val;
}


x86 assembly (clang, -O0):
<print_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     11df <print_number+0xcf>
jmp    112e <print_number+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     11f9 <print_number+0xe9>
jmp    113f <print_number+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     120f <print_number+0xff>
jmp    1150 <print_number+0x40>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1225 <print_number+0x115>
jmp    1161 <print_number+0x51>
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
jb     123b <print_number+0x12b>
jmp    1175 <print_number+0x65>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
je     1225 <print_number+0x115>
jmp    1186 <print_number+0x76>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
je     120f <print_number+0xff>
jmp    1197 <print_number+0x87>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
je     11f9 <print_number+0xe9>
jmp    11a8 <print_number+0x98>
mov    -0x8(%rbp),%eax
sub    $0x7b,%eax
je     126b <print_number+0x15b>
jmp    11b9 <print_number+0xa9>
mov    -0x8(%rbp),%eax
sub    $0x1c8,%eax
je     1251 <print_number+0x141>
jmp    11cc <print_number+0xbc>
mov    -0x8(%rbp),%eax
sub    $0x3e8,%eax
je     1285 <print_number+0x175>
jmp    129a <print_number+0x18a>
lea    0xe1a(%rip),%rdi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <print_number+0x18a>
mov    -0x4(%rbp),%esi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <print_number+0x18a>
mov    -0x4(%rbp),%esi
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <print_number+0x18a>
mov    -0x4(%rbp),%esi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <print_number+0x18a>
mov    -0x4(%rbp),%esi
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <print_number+0x18a>
lea    0xdea(%rip),%rdi
lea    0xdf5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <print_number+0x18a>
lea    0xde5(%rip),%rdi
lea    0xd8a(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <print_number+0x18a>
lea    0xddd(%rip),%rdi
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_number>:
push   %rbx
mov    %edi,%ebx
cmp    $0x7a,%edi
jg     113c <print_number+0x2c>
cmp    $0x8,%ebx
ja     11ba <print_number+0xaa>
mov    %ebx,%eax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef0(%rip),%rdi
jmp    117a <print_number+0x6a>
cmp    $0x7b,%ebx
je     1195 <print_number+0x85>
cmp    $0x1c8,%ebx
je     11a5 <print_number+0x95>
cmp    $0x3e8,%ebx
jne    11ba <print_number+0xaa>
lea    0xf35(%rip),%rdi
lea    0xf40(%rip),%rsi
jmp    11b3 <print_number+0xa3>
lea    0xed1(%rip),%rdi
jmp    117a <print_number+0x6a>
lea    0xed7(%rip),%rdi
jmp    117a <print_number+0x6a>
lea    0xedd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11ba <print_number+0xaa>
lea    0xe98(%rip),%rdi
lea    0xe94(%rip),%rsi
jmp    11b3 <print_number+0xa3>
lea    0xedf(%rip),%rdi
lea    0xe84(%rip),%rsi
jmp    11b3 <print_number+0xa3>
lea    0xeba(%rip),%rdi
lea    0xec5(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [15 x i8] c"\1B[35;1m%2d\1B[0m\00"
@.str.3 = [15 x i8] c"\1B[32;1m%2d\1B[0m\00"
@.str.4 = [15 x i8] c"\1B[33;1m%2d\1B[0m\00"
@.str.5 = [15 x i8] c"\1B[31;1m%2d\1B[0m\00"
@.str.6 = [18 x i8] c"\1B[31;41;1m%2s\1B[0m\00"
@.str.7 = [3 x i8] c"!F\00"
@.str.8 = [18 x i8] c"\1B[31;44;1m%2s\1B[0m\00"
@.str.9 = [18 x i8] c"\1B[31;46;1m%2s\1B[0m\00"
@.str.10 = [3 x i8] c"#*\00"
define i32 @print_number(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 8, label %6
i32 2, label %9
i32 7, label %9
i32 3, label %12
i32 6, label %12
i32 4, label %15
i32 5, label %15
i32 456, label %18
i32 123, label %20
i32 1000, label %22
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %24
6: ; preds = %1, %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %24
9: ; preds = %1, %1
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %10)
br label %24
12: ; preds = %1, %1
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %13)
br label %24
15: ; preds = %1, %1
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %16)
br label %24
18: ; preds = %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %24
20: ; preds = %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %24
22: ; preds = %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %24
24: ; preds = %1, %22, %20, %18, %15, %12, %9, %6, %4
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [15 x i8] c"\1B[35;1m%2d\1B[0m\00"
@.str.3 = [15 x i8] c"\1B[32;1m%2d\1B[0m\00"
@.str.4 = [15 x i8] c"\1B[33;1m%2d\1B[0m\00"
@.str.5 = [15 x i8] c"\1B[31;1m%2d\1B[0m\00"
@.str.6 = [18 x i8] c"\1B[31;41;1m%2s\1B[0m\00"
@.str.7 = [3 x i8] c"!F\00"
@.str.8 = [18 x i8] c"\1B[31;44;1m%2s\1B[0m\00"
@.str.9 = [18 x i8] c"\1B[31;46;1m%2s\1B[0m\00"
@.str.10 = [3 x i8] c"#*\00"
define i32 @print_number(i32 returned %0) {
switch i32 %0, label %18 [
i32 0, label %2
i32 1, label %4
i32 8, label %4
i32 2, label %6
i32 7, label %6
i32 3, label %8
i32 6, label %8
i32 4, label %10
i32 5, label %10
i32 456, label %12
i32 123, label %14
i32 1000, label %16
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %18
4: ; preds = %1, %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %18
6: ; preds = %1, %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %0)
br label %18
8: ; preds = %1, %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %0)
br label %18
10: ; preds = %1, %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %0)
br label %18
12: ; preds = %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %18
14: ; preds = %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %18
16: ; preds = %1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %18
18: ; preds = %1, %16, %14, %12, %10, %8, %6, %4, %2
ret i32 %0
}