#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 *, char *);
void color_space(int val) {
  switch (val) {
  case 0:
  case 1:
  case 8:
  case 2:
  case 7:
  case 3:
  case 6:
  case 4:
  case 5:
    printf("%s", "  ");
    break;
  case 456:
    printf("\033[31;42;1m%s\033[0m", "  ");
    break;
  case 123:
    printf("\033[31;44;1m%2s\033[0m", "  ");
    break;
  case 1000:
    printf("\033[33;44;1m%s\033[0m", "  ");
    break;
  }
}


x86 assembly (clang, -O0):
<color_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x9,%eax
jb     1166 <color_space+0x56>
jmp    112f <color_space+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x7b,%eax
je     1196 <color_space+0x86>
jmp    1140 <color_space+0x30>
mov    -0x8(%rbp),%eax
sub    $0x1c8,%eax
je     117e <color_space+0x6e>
jmp    1153 <color_space+0x43>
mov    -0x8(%rbp),%eax
sub    $0x3e8,%eax
je     11ae <color_space+0x9e>
jmp    11c1 <color_space+0xb1>
lea    0xe93(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <printf@plt>
jmp    11c1 <color_space+0xb1>
lea    0xe81(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1030 <printf@plt>
jmp    11c1 <color_space+0xb1>
lea    0xe7a(%rip),%rdi
lea    0xe5f(%rip),%rsi
call   1030 <printf@plt>
jmp    11c1 <color_space+0xb1>
lea    0xe74(%rip),%rdi
lea    0xe47(%rip),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_space>:
cmp    $0x9,%edi
jae    1128 <color_space+0x18>
lea    0xee4(%rip),%rdi
lea    0xee0(%rip),%rsi
jmp    1030 <printf@plt>
cmp    $0x7b,%edi
je     1150 <color_space+0x40>
cmp    $0x3e8,%edi
je     1163 <color_space+0x53>
cmp    $0x1c8,%edi
jne    1176 <color_space+0x66>
lea    0xec2(%rip),%rdi
lea    0xeb8(%rip),%rsi
jmp    1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0xea5(%rip),%rsi
jmp    1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0xe92(%rip),%rsi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [17 x i8] c"\1B[31;42;1m%s\1B[0m\00"
@.str.3 = [18 x i8] c"\1B[31;44;1m%2s\1B[0m\00"
@.str.4 = [17 x i8] c"\1B[33;44;1m%s\1B[0m\00"
define void @color_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 0, label %4
i32 1, label %4
i32 8, label %4
i32 2, label %4
i32 7, label %4
i32 3, label %4
i32 6, label %4
i32 4, label %4
i32 5, label %4
i32 456, label %6
i32 123, label %8
i32 1000, label %10
]
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1
%5 = call i32 @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 %12
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %1, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [17 x i8] c"\1B[31;42;1m%s\1B[0m\00"
@.str.3 = [18 x i8] c"\1B[31;44;1m%2s\1B[0m\00"
@.str.4 = [17 x i8] c"\1B[33;44;1m%s\1B[0m\00"
define void @color_space(i32 %0) {
switch i32 %0, label %8 [
i32 0, label %5
i32 1, label %5
i32 8, label %5
i32 2, label %5
i32 7, label %5
i32 3, label %5
i32 6, label %5
i32 4, label %5
i32 5, label %5
i32 456, label %2
i32 123, label %3
i32 1000, label %4
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %2, %3, %4
%6 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), %4 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %3 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
%7 = tail call i32 @printf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret void
}