#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ vt_write_str(char *);
int /*<<< orphan*/ vt_write_uint8(int);
void _color_set_8(uint8_t type, uint8_t color) {
  color += 0x10;
  vt_write_str("\x1B"
               "[");
  vt_write_uint8(type);
  vt_write_str(";5");
  vt_write_str(";");
  vt_write_uint8(color);
  vt_write_str("m");
}


x86 assembly (clang, -O0):
<_color_set_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x8(%rbp)
lea    0xec2(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    -0x4(%rbp),%edi
call   1030 <vt_write_uint8@plt>
lea    0xeb1(%rip),%rdi
call   1040 <vt_write_str@plt>
lea    0xea8(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    -0x8(%rbp),%edi
call   1030 <vt_write_uint8@plt>
lea    0xe96(%rip),%rdi
call   1040 <vt_write_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_color_set_8>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x10(%rsi),%ebp
lea    0xed1(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    %ebx,%edi
call   1030 <vt_write_uint8@plt>
lea    0xec1(%rip),%rdi
call   1040 <vt_write_str@plt>
lea    0xeb8(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    %ebp,%edi
call   1030 <vt_write_uint8@plt>
lea    0xea7(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vt_write_str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1B[\00"
@.str.1 = [3 x i8] c";5\00"
@.str.2 = [2 x i8] c";\00"
@.str.3 = [2 x i8] c"m\00"
define void @_color_set_8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 16
store i32 %6, i32* %4
%7 = call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = call i32 @vt_write_uint8(i32 %8)
%10 = call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = call i32 @vt_write_uint8(i32 %12)
%14 = call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1B[\00"
@.str.1 = [3 x i8] c";5\00"
@.str.2 = [2 x i8] c";\00"
@.str.3 = [2 x i8] c"m\00"
define void @_color_set_8(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 16
%4 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @vt_write_uint8(i32 %0)
%6 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @vt_write_uint8(i32 %3)
%9 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}