#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*/ putchar(char);
void litputc(char c) {
  if (c & ~0177) {
    putchar('M');
    putchar('-');
    c &= 0177;
  }
  if (c < 0x20 || c == 0177) {
    if (c == '\b') {
      putchar('\\');
      putchar('b');
    } else if (c == '\f') {
      putchar('\\');
      putchar('f');
    } else if (c == '\n') {
      putchar('\\');
      putchar('n');
    } else if (c == '\r') {
      putchar('\\');
      putchar('r');
    } else if (c == '\t') {
      putchar('\\');
      putchar('t');
    } else {
      putchar('^');
      putchar(c ^ 0x40);
    }
  } else
    putchar(c);
}


x86 assembly (clang, -O0):
<litputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
je     114c <litputc+0x3c>
mov    $0x4d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%eax
and    $0x7f,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     1166 <litputc+0x56>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
jne    1256 <litputc+0x146>
movsbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jne    118c <litputc+0x7c>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x62,%edi
call   1030 <putchar@plt>
jmp    1251 <litputc+0x141>
movsbl -0x1(%rbp),%eax
cmp    $0xc,%eax
jne    11b2 <litputc+0xa2>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x66,%edi
call   1030 <putchar@plt>
jmp    124c <litputc+0x13c>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    11d8 <litputc+0xc8>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x6e,%edi
call   1030 <putchar@plt>
jmp    1247 <litputc+0x137>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    11fe <litputc+0xee>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
jmp    1242 <litputc+0x132>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jne    1224 <litputc+0x114>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
jmp    123d <litputc+0x12d>
mov    $0x5e,%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%eax
xor    $0x40,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1242 <litputc+0x132>
jmp    1247 <litputc+0x137>
jmp    124c <litputc+0x13c>
jmp    1251 <litputc+0x141>
jmp    125f <litputc+0x14f>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<litputc>:
push   %rbx
mov    %edi,%ebx
test   %bl,%bl
jns    112e <litputc+0x1e>
mov    $0x4d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
and    $0x7f,%bl
lea    -0x7f(%rbx),%eax
cmp    $0xa0,%al
ja     11a2 <litputc+0x92>
lea    -0x8(%rbx),%eax
cmp    $0x5,%al
ja     1179 <litputc+0x69>
movzbl %al,%eax
lea    0xeba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x62,%bl
jmp    11a2 <litputc+0x92>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x74,%bl
jmp    11a2 <litputc+0x92>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x6e,%bl
jmp    11a2 <litputc+0x92>
mov    $0x5e,%edi
call   1030 <putchar@plt>
xor    $0x40,%bl
jmp    11a2 <litputc+0x92>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x66,%bl
jmp    11a2 <litputc+0x92>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x72,%bl
movsbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @litputc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = call i32 @putchar(i8 signext 77)
%9 = call i32 @putchar(i8 signext 45)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = and i32 %11, 127
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %7, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 32
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 127
br i1 %21, label %22, label %69
22: ; preds = %18, %14
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 8
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = call i32 @putchar(i8 signext 92)
%28 = call i32 @putchar(i8 signext 98)
br label %68
29: ; preds = %22
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 12
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = call i32 @putchar(i8 signext 92)
%35 = call i32 @putchar(i8 signext 102)
br label %67
36: ; preds = %29
%37 = load i8, i8* %2
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 10
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = call i32 @putchar(i8 signext 92)
%42 = call i32 @putchar(i8 signext 110)
br label %66
43: ; preds = %36
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 13
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = call i32 @putchar(i8 signext 92)
%49 = call i32 @putchar(i8 signext 114)
br label %65
50: ; preds = %43
%51 = load i8, i8* %2
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 9
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = call i32 @putchar(i8 signext 92)
%56 = call i32 @putchar(i8 signext 116)
br label %64
57: ; preds = %50
%58 = call i32 @putchar(i8 signext 94)
%59 = load i8, i8* %2
%60 = sext i8 %59 to i32
%61 = xor i32 %60, 64
%62 = trunc i32 %61 to i8
%63 = call i32 @putchar(i8 signext %62)
br label %64
64: ; preds = %57, %54
br label %65
65: ; preds = %64, %47
br label %66
66: ; preds = %65, %40
br label %67
67: ; preds = %66, %33
br label %68
68: ; preds = %67, %26
br label %72
69: ; preds = %18
%70 = load i8, i8* %2
%71 = call i32 @putchar(i8 signext %70)
br label %72
72: ; preds = %69, %68
ret void
}

LLVM IR (-O2):
define void @litputc(i8 signext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @putchar(i8 signext 77)
%5 = tail call i32 @putchar(i8 signext 45)
%6 = and i8 %0, 127
br label %7
7: ; preds = %3, %1
%8 = phi i8 [ %6, %3 ], [ %0, %1 ]
%9 = add nsw i8 %8, -127
%10 = icmp ult i8 %9, -95
br i1 %10, label %11, label %25
11: ; preds = %7
switch i8 %8, label %22 [
i8 8, label %12
i8 12, label %14
i8 10, label %16
i8 13, label %18
i8 9, label %20
]
12: ; preds = %11
%13 = tail call i32 @putchar(i8 signext 92)
br label %25
14: ; preds = %11
%15 = tail call i32 @putchar(i8 signext 92)
br label %25
16: ; preds = %11
%17 = tail call i32 @putchar(i8 signext 92)
br label %25
18: ; preds = %11
%19 = tail call i32 @putchar(i8 signext 92)
br label %25
20: ; preds = %11
%21 = tail call i32 @putchar(i8 signext 92)
br label %25
22: ; preds = %11
%23 = tail call i32 @putchar(i8 signext 94)
%24 = xor i8 %8, 64
br label %25
25: ; preds = %7, %12, %16, %20, %22, %18, %14
%26 = phi i8 [ 98, %12 ], [ 110, %16 ], [ 116, %20 ], [ %24, %22 ], [ 114, %18 ], [ 102, %14 ], [ %8, %7 ]
%27 = tail call i32 @putchar(i8 signext %26)
ret void
}