#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 say(const char *msg, int smile) {
  if (smile) {
    printf("%c[%d;%d;%dm<#_#>", 0x1B, 1, 0 + 30, 3 + 40);
  }
  printf("%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
  if (smile) {
    printf(" ");
  }
  printf("%s", msg);
}


x86 assembly (clang, -O0):
<say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <say+0x3c>
lea    0xed0(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    $0x1e,%ecx
mov    $0x2b,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x1b,%esi
xor    %edx,%edx
mov    $0x25,%ecx
mov    $0x28,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1184 <say+0x74>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
je     1177 <say+0x57>
lea    0xed1(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    $0x1e,%ecx
mov    $0x2b,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x1b,%esi
xor    %edx,%edx
mov    $0x25,%ecx
mov    $0x28,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1197 <say+0x77>
lea    0xe94(%rip),%rdi
mov    $0x1b,%esi
xor    %edx,%edx
mov    $0x25,%ecx
mov    $0x28,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%c[%d;%d;%dm<#_#>\00"
@.str.1 = [13 x i8] c"%c[%d;%d;%dm\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c"%s\00"
define void @say(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 27, i32 1, i32 30, i32 43)
br label %9
9: ; preds = %7, %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 27, i32 0, i32 37, i32 40)
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = load i8*, i8** %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%c[%d;%d;%dm<#_#>\00"
@.str.1 = [13 x i8] c"%c[%d;%d;%dm\00"
@.str.3 = [3 x i8] c"%s\00"
define void @say(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 27, i32 1, i32 30, i32 43)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 27, i32 0, i32 37, i32 40)
%7 = tail call i32 @putchar(i32 32)
br label %10
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 27, i32 0, i32 37, i32 40)
br label %10
10: ; preds = %8, %4
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %0)
ret void
}