#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int, char *, char *);
int /*<<< orphan*/ stdout;
void so_log_is(char c, int i, char *s) {
  switch (c) {
  case 'r':
    printf("%s[###### %d ## %s ######]%s\n", "\x1b[31m", i, s, "\x1b[0m");
    break;
  case 'g':
    printf("%s[###### %d ## %s ######]%s\n", "\x1b[32m", i, s, "\x1b[0m");
    break;
  case 'y':
    printf("%s[###### %d ## %s ######]%s\n", "\x1b[33m", i, s, "\x1b[0m");
    break;
  case 'b':
    printf("%s[###### %d ## %s ######]%s\n", "\x1b[34m", i, s, "\x1b[0m");
    break;
  case 'm':
    printf("%s[###### %d ## %s ######]%s\n", "\x1b[35m", i, s, "\x1b[0m");
    break;
  case 'c':
    printf("%s[###### %d ## %s ######]%s\n", "\x1b[36m", i, s, "\x1b[0m");
    break;
  default:
    printf("%s[###### %d ## %s ######]%s\n", "\x1b[31m", i, s, "\x1b[0m");
    break;
  }
  fflush(stdout);
}


x86 assembly (clang, -O0):
<so_log_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x17,%eax
ja     1243 <so_log_is+0x123>
mov    -0x18(%rbp),%rax
lea    0xeaa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xef3(%rip),%rdi
lea    0xf0a(%rip),%rsi
lea    0xf09(%rip),%r8
call   1030 <printf@plt>
jmp    1264 <so_log_is+0x144>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xecd(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xee3(%rip),%r8
call   1030 <printf@plt>
jmp    1264 <so_log_is+0x144>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xea7(%rip),%rdi
lea    0xecf(%rip),%rsi
lea    0xebd(%rip),%r8
call   1030 <printf@plt>
jmp    1264 <so_log_is+0x144>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe81(%rip),%rdi
lea    0xeaf(%rip),%rsi
lea    0xe97(%rip),%r8
call   1030 <printf@plt>
jmp    1264 <so_log_is+0x144>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe5b(%rip),%rdi
lea    0xe8f(%rip),%rsi
lea    0xe71(%rip),%r8
call   1030 <printf@plt>
jmp    1264 <so_log_is+0x144>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe35(%rip),%rdi
lea    0xe6f(%rip),%rsi
lea    0xe4b(%rip),%r8
call   1030 <printf@plt>
jmp    1264 <so_log_is+0x144>
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe0f(%rip),%rdi
lea    0xe26(%rip),%rsi
lea    0xe25(%rip),%r8
call   1030 <printf@plt>
mov    0x2d75(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<so_log_is>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
lea    0xf51(%rip),%rsi
add    $0xffffff9e,%edi
cmp    $0x17,%edi
ja     1170 <so_log_is+0x50>
lea    0xec4(%rip),%rax
movslq (%rax,%rdi,4),%rdi
add    %rax,%rdi
jmp    *%rdi
lea    0xf49(%rip),%rsi
jmp    1170 <so_log_is+0x50>
lea    0xf4c(%rip),%rsi
jmp    1170 <so_log_is+0x50>
lea    0xf2b(%rip),%rsi
jmp    1170 <so_log_is+0x50>
lea    0xf34(%rip),%rsi
jmp    1170 <so_log_is+0x50>
lea    0xf1f(%rip),%rsi
lea    0xee9(%rip),%rdi
lea    0xf06(%rip),%r8
call   1030 <printf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%s[###### %d ## %s ######]%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [6 x i8] c"\1B[32m\00"
@.str.4 = [6 x i8] c"\1B[33m\00"
@.str.5 = [6 x i8] c"\1B[34m\00"
@.str.6 = [6 x i8] c"\1B[35m\00"
@.str.7 = [6 x i8] c"\1B[36m\00"
@stdout = global i32 0
define void @so_log_is(i8 signext %0, i32 %1, i8* %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
store i8 %0, i8* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
switch i32 %8, label %33 [
i32 114, label %9
i32 103, label %13
i32 121, label %17
i32 98, label %21
i32 109, label %25
i32 99, label %29
]
9: ; preds = %3
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %37
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i8*, i8** %6
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %14, i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %37
17: ; preds = %3
%18 = load i32, i32* %5
%19 = load i8*, i8** %6
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %18, i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %37
21: ; preds = %3
%22 = load i32, i32* %5
%23 = load i8*, i8** %6
%24 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %22, i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %37
25: ; preds = %3
%26 = load i32, i32* %5
%27 = load i8*, i8** %6
%28 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %26, i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %37
29: ; preds = %3
%30 = load i32, i32* %5
%31 = load i8*, i8** %6
%32 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %30, i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %37
33: ; preds = %3
%34 = load i32, i32* %5
%35 = load i8*, i8** %6
%36 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %34, i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %33, %29, %25, %21, %17, %13, %9
%38 = load i32, i32* @stdout
%39 = call i32 @fflush(i32 %38)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s[###### %d ## %s ######]%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [6 x i8] c"\1B[32m\00"
@.str.4 = [6 x i8] c"\1B[33m\00"
@.str.5 = [6 x i8] c"\1B[34m\00"
@.str.6 = [6 x i8] c"\1B[35m\00"
@.str.7 = [6 x i8] c"\1B[36m\00"
@stdout = global i32 0
define void @so_log_is(i8 signext %0, i32 %1, i8* %2) {
%4 = sext i8 %0 to i32
switch i32 %4, label %10 [
i32 99, label %9
i32 103, label %5
i32 121, label %6
i32 98, label %7
i32 109, label %8
]
5: ; preds = %3
br label %10
6: ; preds = %3
br label %10
7: ; preds = %3
br label %10
8: ; preds = %3
br label %10
9: ; preds = %3
br label %10
10: ; preds = %3, %9, %8, %7, %6, %5
%11 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %3 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %1, i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* @stdout
%14 = tail call i32 @fflush(i32 %13)
ret void
}