#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 print_file_color(int mode, char *name) {
  if ((mode & 0xf000) == 0x4000) {
    printf("%s%s%s", "\033[1;34m", name, "\033[0m");
  } else if (mode & 0x1) {
    printf("%s%s%s", "\033[1;32m", name, "\033[0m");
  } else {
    printf("%s", name);
  }
}


x86 assembly (clang, -O0):
<print_file_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf000,%eax
cmp    $0x4000,%eax
jne    1157 <print_file_color+0x47>
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
lea    0xec3(%rip),%rsi
lea    0xec4(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a2 <print_file_color+0x92>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     118b <print_file_color+0x7b>
mov    -0x10(%rbp),%rdx
lea    0xe8f(%rip),%rdi
lea    0xe9c(%rip),%rsi
lea    0xe90(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119d <print_file_color+0x8d>
mov    -0x10(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a2 <print_file_color+0x92>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_file_color>:
mov    %rsi,%rdx
mov    %edi,%eax
and    $0xf000,%eax
cmp    $0x4000,%eax
jne    1131 <print_file_color+0x21>
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
jmp    1156 <print_file_color+0x46>
test   $0x1,%dil
jne    1148 <print_file_color+0x38>
lea    0xec6(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    0xebe(%rip),%rsi
lea    0xeb2(%rip),%rcx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [8 x i8] c"\1B[1;34m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [8 x i8] c"\1B[1;32m\00"
@.str.4 = [3 x i8] c"%s\00"
define void @print_file_color(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 61440
%7 = icmp eq i32 %6, 16384
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %22
11: ; preds = %2
%12 = load i32, i32* %3
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %21
18: ; preds = %11
%19 = load i8*, i8** %4
%20 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %18, %15
br label %22
22: ; preds = %21, %8
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [8 x i8] c"\1B[1;34m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [8 x i8] c"\1B[1;32m\00"
@.str.4 = [3 x i8] c"%s\00"
define void @print_file_color(i32 %0, i8* %1) {
%3 = and i32 %0, 61440
%4 = icmp eq i32 %3, 16384
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %14
7: ; preds = %2
%8 = and i32 %0, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %7
%13 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
br label %14
14: ; preds = %10, %12, %5
ret void
}