#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void _print_result(FILE *fp, int success, int color) {
  if (color) {
    if (success)
      fprintf(fp, "\x1B[32m"
                  "[PASSED]"
                  "\x1B[0m");
    else
      fprintf(fp, "\x1B[31m"
                  "[FAILED]"
                  "\x1B[0m");
  } else {
    if (success)
      fprintf(fp, "[PASSED]");
    else
      fprintf(fp, "[FAILED]");
  }
}


x86 assembly (clang, -O0):
<_print_result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1160 <_print_result+0x50>
cmpl   $0x0,-0xc(%rbp)
je     114b <_print_result+0x3b>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
jmp    115b <_print_result+0x4b>
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1194 <_print_result+0x84>
cmpl   $0x0,-0xc(%rbp)
je     117f <_print_result+0x6f>
mov    -0x8(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
jmp    118f <_print_result+0x7f>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1194 <_print_result+0x84>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_result>:
mov    %rdi,%rcx
test   %edx,%edx
je     1124 <_print_result+0x14>
test   %esi,%esi
je     1131 <_print_result+0x21>
lea    0xede(%rip),%rdi
jmp    1138 <_print_result+0x28>
test   %esi,%esi
je     1147 <_print_result+0x37>
lea    0xef5(%rip),%rdi
jmp    114e <_print_result+0x3e>
lea    0xeda(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
lea    0xedf(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\1B[32m[PASSED]\1B[0m\00"
@.str.1 = [18 x i8] c"\1B[31m[FAILED]\1B[0m\00"
@.str.2 = [9 x i8] c"[PASSED]\00"
@.str.3 = [9 x i8] c"[FAILED]\00"
define void @_print_result(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %18
15: ; preds = %9
%16 = load i32*, i32** %4
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %12
br label %29
19: ; preds = %3
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32*, i32** %4
%24 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %28
25: ; preds = %19
%26 = load i32*, i32** %4
%27 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %25, %22
br label %29
29: ; preds = %28, %18
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\1B[32m[PASSED]\1B[0m\00"
@.str.1 = [18 x i8] c"\1B[31m[FAILED]\1B[0m\00"
@.str.2 = [9 x i8] c"[PASSED]\00"
@.str.3 = [9 x i8] c"[FAILED]\00"
define void @_print_result(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = icmp eq i32 %1, 0
br i1 %4, label %11, label %6
6: ; preds = %3
br i1 %5, label %9, label %7
7: ; preds = %6
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 17, i64 1, i32* %0)
br label %16
9: ; preds = %6
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 17, i64 1, i32* %0)
br label %16
11: ; preds = %3
br i1 %5, label %14, label %12
12: ; preds = %11
%13 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 8, i64 1, i32* %0)
br label %16
14: ; preds = %11
%15 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 8, i64 1, i32* %0)
br label %16
16: ; preds = %12, %14, %7, %9
ret void
}