#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 *, ...);
int /*<<< orphan*/ system(char *);
void printChar(short int input) {
  if (input >= 0 && input < 94) {
    printf("%c", (char)input + 32);
  } else if (input >= 94) {
    printf("☺");
  } else if (input == -1) {
    printf("\n");
  } else if (input == -999) {
    system("clear");
  } else {
    printf("☹");
  }
}


x86 assembly (clang, -O0):
<printChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     1166 <printChar+0x46>
movswl -0x2(%rbp),%eax
cmp    $0x5e,%eax
jge    1166 <printChar+0x46>
mov    -0x2(%rbp),%ax
movsbl %al,%esi
add    $0x20,%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e3 <printChar+0xc3>
movswl -0x2(%rbp),%eax
cmp    $0x5e,%eax
jl     1186 <printChar+0x66>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11de <printChar+0xbe>
movswl -0x2(%rbp),%eax
cmp    $0xffffffff,%eax
jne    11a6 <printChar+0x86>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d9 <printChar+0xb9>
movswl -0x2(%rbp),%eax
cmp    $0xfffffc19,%eax
jne    11c6 <printChar+0xa6>
lea    0xe4d(%rip),%rdi
call   1030 <system@plt>
jmp    11d4 <printChar+0xb4>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d9 <printChar+0xb9>
jmp    11de <printChar+0xbe>
jmp    11e3 <printChar+0xc3>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printChar>:
cmp    $0x5d,%di
ja     1141 <printChar+0x11>
movzwl %di,%edi
add    $0x20,%edi
jmp    1030 <putchar@plt>
jle    1151 <printChar+0x21>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
jmp    1050 <printf@plt>
movzwl %di,%eax
cmp    $0xfc19,%eax
je     116b <printChar+0x3b>
cmp    $0xffff,%di
jne    1177 <printChar+0x47>
mov    $0xa,%edi
jmp    1030 <putchar@plt>
lea    0xe92(%rip),%rdi
jmp    1040 <system@plt>
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"\E2\98\BA\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [6 x i8] c"clear\00"
@.str.4 = [4 x i8] c"\E2\98\B9\00"
define void @printChar(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %8, 94
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i16, i16* %2
%12 = trunc i16 %11 to i8
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %39
16: ; preds = %6, %1
%17 = load i16, i16* %2
%18 = sext i16 %17 to i32
%19 = icmp sge i32 %18, 94
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %38
22: ; preds = %16
%23 = load i16, i16* %2
%24 = sext i16 %23 to i32
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %37
28: ; preds = %22
%29 = load i16, i16* %2
%30 = sext i16 %29 to i32
%31 = icmp eq i32 %30, -999
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %36
34: ; preds = %28
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
br label %37
37: ; preds = %36, %26
br label %38
38: ; preds = %37, %20
br label %39
39: ; preds = %38, %10
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"\E2\98\BA\00"
@.str.3 = [6 x i8] c"clear\00"
@.str.4 = [4 x i8] c"\E2\98\B9\00"
define void @printChar(i16 signext %0) {
%2 = icmp ult i16 %0, 94
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = zext i16 %0 to i32
%5 = add nuw nsw i32 %4, 32
%6 = tail call i32 @putchar(i32 %5)
br label %18
7: ; preds = %1
%8 = icmp sgt i16 %0, 93
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %18
11: ; preds = %7
switch i16 %0, label %16 [
i16 -1, label %12
i16 -999, label %14
]
12: ; preds = %11
%13 = tail call i32 @putchar(i32 10)
br label %18
14: ; preds = %11
%15 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %18
16: ; preds = %11
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %9, %14, %16, %12, %3
ret void
}