#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 *);
void print_color(int id) {
  if (id == 0)
    printf("\033[39;49m");
  else if (id == 1)
    printf("\033[48;5;154m");
  else if (id == 2)
    printf("\033[48;5;220m");
  else if (id == 3)
    printf("\033[48;5;028m");
  else if (id == 4)
    printf("\033[48;5;020m");
  else if (id == 5)
    printf("\033[48;5;124m");
  else if (id == 6)
    printf("\033[48;5;208m");
  else if (id == 7)
    printf("\033[48;5;054m");
  else if (id == 8)
    printf("\033[48;5;198m");
  else if (id == 9)
    printf("\033[48;5;136m");
  else if (id == 10)
    printf("\033[48;5;069m");
  else if (id == 11)
    printf("\033[48;5;052m");
  else if (id == 12)
    printf("\033[48;5;123m");
  else if (id == -1)
    printf("\033[48;5;232m");
  else
    printf("\033[48;5;232m");
}


x86 assembly (clang, -O0):
<print_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <print_color+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    12e2 <print_color+0x1d2>
cmpl   $0x1,-0x4(%rbp)
jne    1151 <print_color+0x41>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    12dd <print_color+0x1cd>
cmpl   $0x2,-0x4(%rbp)
jne    116c <print_color+0x5c>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    12d8 <print_color+0x1c8>
cmpl   $0x3,-0x4(%rbp)
jne    1187 <print_color+0x77>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    12d3 <print_color+0x1c3>
cmpl   $0x4,-0x4(%rbp)
jne    11a2 <print_color+0x92>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    12ce <print_color+0x1be>
cmpl   $0x5,-0x4(%rbp)
jne    11bd <print_color+0xad>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
jmp    12c9 <print_color+0x1b9>
cmpl   $0x6,-0x4(%rbp)
jne    11d8 <print_color+0xc8>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
jmp    12c4 <print_color+0x1b4>
cmpl   $0x7,-0x4(%rbp)
jne    11f3 <print_color+0xe3>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
jmp    12bf <print_color+0x1af>
cmpl   $0x8,-0x4(%rbp)
jne    120e <print_color+0xfe>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
jmp    12ba <print_color+0x1aa>
cmpl   $0x9,-0x4(%rbp)
jne    1229 <print_color+0x119>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    12b5 <print_color+0x1a5>
cmpl   $0xa,-0x4(%rbp)
jne    1244 <print_color+0x134>
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
jmp    12b0 <print_color+0x1a0>
cmpl   $0xb,-0x4(%rbp)
jne    125f <print_color+0x14f>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    12ab <print_color+0x19b>
cmpl   $0xc,-0x4(%rbp)
jne    127a <print_color+0x16a>
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
jmp    12a6 <print_color+0x196>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1295 <print_color+0x185>
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
jmp    12a1 <print_color+0x191>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
jmp    12a6 <print_color+0x196>
jmp    12ab <print_color+0x19b>
jmp    12b0 <print_color+0x1a0>
jmp    12b5 <print_color+0x1a5>
jmp    12ba <print_color+0x1aa>
jmp    12bf <print_color+0x1af>
jmp    12c4 <print_color+0x1b4>
jmp    12c9 <print_color+0x1b9>
jmp    12ce <print_color+0x1be>
jmp    12d3 <print_color+0x1c3>
jmp    12d8 <print_color+0x1c8>
jmp    12dd <print_color+0x1cd>
jmp    12e2 <print_color+0x1d2>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_color>:
add    $0x1,%edi
cmp    $0xd,%edi
ja     112e <print_color+0x1e>
movslq %edi,%rax
lea    0xf86(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <printf@plt>
lea    0xf64(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[39;49m\00"
@.str.1 = [12 x i8] c"\1B[48;5;154m\00"
@.str.2 = [12 x i8] c"\1B[48;5;220m\00"
@.str.3 = [12 x i8] c"\1B[48;5;028m\00"
@.str.4 = [12 x i8] c"\1B[48;5;020m\00"
@.str.5 = [12 x i8] c"\1B[48;5;124m\00"
@.str.6 = [12 x i8] c"\1B[48;5;208m\00"
@.str.7 = [12 x i8] c"\1B[48;5;054m\00"
@.str.8 = [12 x i8] c"\1B[48;5;198m\00"
@.str.9 = [12 x i8] c"\1B[48;5;136m\00"
@.str.10 = [12 x i8] c"\1B[48;5;069m\00"
@.str.11 = [12 x i8] c"\1B[48;5;052m\00"
@.str.12 = [12 x i8] c"\1B[48;5;123m\00"
@.str.13 = [12 x i8] c"\1B[48;5;232m\00"
define void @print_color(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %87
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %86
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %85
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %84
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 4
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %83
27: ; preds = %22
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 5
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %82
32: ; preds = %27
%33 = load i32, i32* %2
%34 = icmp eq i32 %33, 6
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %81
37: ; preds = %32
%38 = load i32, i32* %2
%39 = icmp eq i32 %38, 7
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %80
42: ; preds = %37
%43 = load i32, i32* %2
%44 = icmp eq i32 %43, 8
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %79
47: ; preds = %42
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 9
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %78
52: ; preds = %47
%53 = load i32, i32* %2
%54 = icmp eq i32 %53, 10
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %77
57: ; preds = %52
%58 = load i32, i32* %2
%59 = icmp eq i32 %58, 11
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
br label %76
62: ; preds = %57
%63 = load i32, i32* %2
%64 = icmp eq i32 %63, 12
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0))
br label %75
67: ; preds = %62
%68 = load i32, i32* %2
%69 = icmp eq i32 %68, -1
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %74
72: ; preds = %67
%73 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %74
74: ; preds = %72, %70
br label %75
75: ; preds = %74, %65
br label %76
76: ; preds = %75, %60
br label %77
77: ; preds = %76, %55
br label %78
78: ; preds = %77, %50
br label %79
79: ; preds = %78, %45
br label %80
80: ; preds = %79, %40
br label %81
81: ; preds = %80, %35
br label %82
82: ; preds = %81, %30
br label %83
83: ; preds = %82, %25
br label %84
84: ; preds = %83, %20
br label %85
85: ; preds = %84, %15
br label %86
86: ; preds = %85, %10
br label %87
87: ; preds = %86, %5
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[39;49m\00"
@.str.1 = [12 x i8] c"\1B[48;5;154m\00"
@.str.2 = [12 x i8] c"\1B[48;5;220m\00"
@.str.3 = [12 x i8] c"\1B[48;5;028m\00"
@.str.4 = [12 x i8] c"\1B[48;5;020m\00"
@.str.5 = [12 x i8] c"\1B[48;5;124m\00"
@.str.6 = [12 x i8] c"\1B[48;5;208m\00"
@.str.7 = [12 x i8] c"\1B[48;5;054m\00"
@.str.8 = [12 x i8] c"\1B[48;5;198m\00"
@.str.9 = [12 x i8] c"\1B[48;5;136m\00"
@.str.10 = [12 x i8] c"\1B[48;5;069m\00"
@.str.11 = [12 x i8] c"\1B[48;5;052m\00"
@.str.12 = [12 x i8] c"\1B[48;5;123m\00"
@.str.13 = [12 x i8] c"\1B[48;5;232m\00"
@reltable.print_color = [14 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.13 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.1 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.2 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.3 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.4 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.5 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.6 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.7 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.8 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.9 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.10 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.11 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.12 to i64), i64 ptrtoint ([14 x i32]* @reltable.print_color to i64)) to i32)]
define void @print_color(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 14
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([14 x i32]* @reltable.print_color to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), %1 ]
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
ret void
}