#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(int);
void unescape(int c) {
  static bool in_escape = false;
  if (in_escape) {
    switch (c) {
    case 't':
      putchar('\t');
      break;
    case 'b':
      putchar('\b');
      break;
    case 'n':
      putchar('\n');
      break;
    case '\\':
      putchar('\\');
      break;
    default:
      putchar(c);
      break;
    }
    in_escape = false;
  } else if (c == '\\')
    in_escape = true;
  else
    putchar(c);
}


x86 assembly (clang, -O0):
<unescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2f0a(%rip)
je     11a4 <unescape+0x94>
mov    -0x4(%rbp),%eax
add    $0xffffffa4,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x18,%eax
ja     118d <unescape+0x7d>
mov    -0x10(%rbp),%rax
lea    0xeb8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x9,%edi
call   1030 <putchar@plt>
jmp    1195 <unescape+0x85>
mov    $0x8,%edi
call   1030 <putchar@plt>
jmp    1195 <unescape+0x85>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1195 <unescape+0x85>
mov    $0x5c,%edi
call   1030 <putchar@plt>
jmp    1195 <unescape+0x85>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x0,0x2e8d(%rip)
jmp    11ca <unescape+0xba>
cmpl   $0x5c,-0x4(%rbp)
jne    11bd <unescape+0xad>
movl   $0x1,0x2e74(%rip)
jmp    11c5 <unescape+0xb5>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    11ca <unescape+0xba>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unescape>:
push   %rax
cmpb   $0x1,0x2f14(%rip)
jne    113e <unescape+0x2e>
lea    -0x5c(%rdi),%ecx
cmp    $0x18,%ecx
ja     1152 <unescape+0x42>
mov    $0x9,%eax
lea    0xed2(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x5c,%eax
jmp    1162 <unescape+0x52>
cmp    $0x5c,%edi
jne    114c <unescape+0x3c>
movb   $0x1,0x2ee2(%rip)
pop    %rax
ret
pop    %rax
jmp    1030 <putchar@plt>
mov    %edi,%eax
jmp    1162 <unescape+0x52>
mov    $0x8,%eax
jmp    1162 <unescape+0x52>
mov    $0xa,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
movb   $0x0,0x2ebc(%rip)
pop    %rax
ret

LLVM IR (-O0):
@unescape.in_escape = internal global i32 0
define void @unescape(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @unescape.in_escape
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %19
5: ; preds = %1
%6 = load i32, i32* %2
switch i32 %6, label %15 [
i32 116, label %7
i32 98, label %9
i32 110, label %11
i32 92, label %13
]
7: ; preds = %5
%8 = call i32 @putchar(i32 9)
br label %18
9: ; preds = %5
%10 = call i32 @putchar(i32 8)
br label %18
11: ; preds = %5
%12 = call i32 @putchar(i32 10)
br label %18
13: ; preds = %5
%14 = call i32 @putchar(i32 92)
br label %18
15: ; preds = %5
%16 = load i32, i32* %2
%17 = call i32 @putchar(i32 %16)
br label %18
18: ; preds = %15, %13, %11, %9, %7
store i32 0, i32* @unescape.in_escape
br label %27
19: ; preds = %1
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 92
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 1, i32* @unescape.in_escape
br label %26
23: ; preds = %19
%24 = load i32, i32* %2
%25 = call i32 @putchar(i32 %24)
br label %26
26: ; preds = %23, %22
br label %27
27: ; preds = %26, %18
ret void
}

LLVM IR (-O2):
@unescape.in_escape = internal unnamed_addr global i1 false
define void @unescape(i32 %0) {
%2 = load i1, i1* @unescape.in_escape
br i1 %2, label %3, label %11
3: ; preds = %1
switch i32 %0, label %7 [
i32 116, label %8
i32 98, label %4
i32 110, label %5
i32 92, label %6
]
4: ; preds = %3
br label %8
5: ; preds = %3
br label %8
6: ; preds = %3
br label %8
7: ; preds = %3
br label %8
8: ; preds = %3, %7, %6, %5, %4
%9 = phi i32 [ %0, %7 ], [ 92, %6 ], [ 10, %5 ], [ 8, %4 ], [ 9, %3 ]
%10 = tail call i32 @putchar(i32 %9)
store i1 false, i1* @unescape.in_escape
br label %16
11: ; preds = %1
%12 = icmp eq i32 %0, 92
br i1 %12, label %13, label %14
13: ; preds = %11
store i1 true, i1* @unescape.in_escape
br label %16
14: ; preds = %11
%15 = tail call i32 @putchar(i32 %0)
br label %16
16: ; preds = %13, %14, %8
ret void
}