#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);
int handle_escape(int c) {
  switch (c) {
  case '"':
    putchar('"');
    break;
  case 'b':
    putchar('\b');
    break;
  case 'c':
    return -1;
  case 'e':
    putchar('\e');
    break;
  case 'f':
    putchar('\f');
    break;
  case 'n':
    putchar('\n');
    break;
  case 'r':
    putchar('\r');
    break;
  case 't':
    putchar('\t');
    break;
  case 'v':
    putchar('\v');
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<handle_escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffde,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x54,%eax
ja     11c8 <handle_escape+0xb8>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x22,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
mov    $0x8,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
movl   $0xffffffff,-0x4(%rbp)
jmp    11d4 <handle_escape+0xc4>
mov    $0x1b,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
mov    $0xc,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
mov    $0xd,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
mov    $0x9,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
mov    $0xb,%edi
call   1030 <putchar@plt>
jmp    11cd <handle_escape+0xbd>
jmp    11cd <handle_escape+0xbd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_escape>:
push   %rax
add    $0xffffffde,%edi
cmp    $0x54,%edi
ja     1152 <handle_escape+0x42>
mov    $0xffffffff,%eax
mov    $0x22,%cl
lea    0xed9(%rip),%rdx
movslq (%rdx,%rdi,4),%rsi
add    %rdx,%rsi
jmp    *%rsi
mov    $0x8,%cl
jmp    114a <handle_escape+0x3a>
mov    $0x1b,%cl
jmp    114a <handle_escape+0x3a>
mov    $0xc,%cl
jmp    114a <handle_escape+0x3a>
mov    $0xa,%cl
jmp    114a <handle_escape+0x3a>
mov    $0xd,%cl
jmp    114a <handle_escape+0x3a>
mov    $0x9,%cl
jmp    114a <handle_escape+0x3a>
mov    $0xb,%cl
movzbl %cl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @handle_escape(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %22 [
i32 34, label %5
i32 98, label %7
i32 99, label %9
i32 101, label %10
i32 102, label %12
i32 110, label %14
i32 114, label %16
i32 116, label %18
i32 118, label %20
]
5: ; preds = %1
%6 = call i32 @putchar(i8 signext 34)
br label %23
7: ; preds = %1
%8 = call i32 @putchar(i8 signext 8)
br label %23
9: ; preds = %1
store i32 -1, i32* %2
br label %24
10: ; preds = %1
%11 = call i32 @putchar(i8 signext 27)
br label %23
12: ; preds = %1
%13 = call i32 @putchar(i8 signext 12)
br label %23
14: ; preds = %1
%15 = call i32 @putchar(i8 signext 10)
br label %23
16: ; preds = %1
%17 = call i32 @putchar(i8 signext 13)
br label %23
18: ; preds = %1
%19 = call i32 @putchar(i8 signext 9)
br label %23
20: ; preds = %1
%21 = call i32 @putchar(i8 signext 11)
br label %23
22: ; preds = %1
br label %23
23: ; preds = %22, %20, %18, %16, %14, %12, %10, %7, %5
store i32 0, i32* %2
br label %24
24: ; preds = %23, %9
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @handle_escape(i32 %0) {
switch i32 %0, label %12 [
i32 34, label %9
i32 98, label %2
i32 99, label %13
i32 101, label %3
i32 102, label %4
i32 110, label %5
i32 114, label %6
i32 116, label %7
i32 118, label %8
]
2: ; preds = %1
br label %9
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %2, %3, %4, %5, %6, %7, %8
%10 = phi i8 [ 11, %8 ], [ 9, %7 ], [ 13, %6 ], [ 10, %5 ], [ 12, %4 ], [ 27, %3 ], [ 8, %2 ], [ 34, %1 ]
%11 = tail call i32 @putchar(i8 signext %10)
br label %12
12: ; preds = %9, %1
br label %13
13: ; preds = %1, %12
%14 = phi i32 [ 0, %12 ], [ -1, %1 ]
ret i32 %14
}