#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 */
char ch();
int /*<<< orphan*/ gch();
spechar() {
  char c;
  c = ch();
  if (c == 'n')
    c = 10;
  else if (c == 't')
    c = 9;
  else if (c == 'r')
    c = 13;
  else if (c == 'f')
    c = 12;
  else if (c == 'b')
    c = 8;
  else if (c == '0')
    c = 0;
  else if (c == 0)
    return 0;
  gch();
  return (c);
}


x86 assembly (clang, -O0):
<spechar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ch@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x6e,%eax
jne    1148 <spechar+0x28>
movb   $0xa,-0x5(%rbp)
jmp    11ed <spechar+0xcd>
movsbl -0x5(%rbp),%eax
cmp    $0x74,%eax
jne    115e <spechar+0x3e>
movb   $0x9,-0x5(%rbp)
jmp    11e8 <spechar+0xc8>
movsbl -0x5(%rbp),%eax
cmp    $0x72,%eax
jne    1174 <spechar+0x54>
movb   $0xd,-0x5(%rbp)
jmp    11e3 <spechar+0xc3>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jne    118a <spechar+0x6a>
movb   $0xc,-0x5(%rbp)
jmp    11de <spechar+0xbe>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    11a0 <spechar+0x80>
movb   $0x8,-0x5(%rbp)
jmp    11d9 <spechar+0xb9>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    11b6 <spechar+0x96>
movb   $0x0,-0x5(%rbp)
jmp    11d4 <spechar+0xb4>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    11cf <spechar+0xaf>
movl   $0x0,-0x4(%rbp)
jmp    11fb <spechar+0xdb>
jmp    11d4 <spechar+0xb4>
jmp    11d9 <spechar+0xb9>
jmp    11de <spechar+0xbe>
jmp    11e3 <spechar+0xc3>
jmp    11e8 <spechar+0xc8>
jmp    11ed <spechar+0xcd>
mov    $0x0,%al
call   1040 <gch@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spechar>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <ch@plt>
lea    -0x62(%rax),%ecx
cmp    $0x12,%cl
ja     1151 <spechar+0x31>
mov    $0xa,%ebx
movzbl %cl,%ecx
lea    0xebf(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x8,%ebx
jmp    1175 <spechar+0x55>
test   %al,%al
je     117c <spechar+0x5c>
cmp    $0x30,%al
jne    115d <spechar+0x3d>
xor    %ebx,%ebx
jmp    1175 <spechar+0x55>
movsbl %al,%ebx
jmp    1175 <spechar+0x55>
mov    $0xc,%ebx
jmp    1175 <spechar+0x55>
mov    $0xd,%ebx
jmp    1175 <spechar+0x55>
mov    $0x9,%ebx
xor    %eax,%eax
call   1040 <gch@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @spechar() {
%1 = alloca i32
%2 = alloca i8
%3 = call signext i8 (...) @ch()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 110
br i1 %6, label %7, label %8
7: ; preds = %0
store i8 10, i8* %2
br label %44
8: ; preds = %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 116
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 9, i8* %2
br label %43
13: ; preds = %8
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 114
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 13, i8* %2
br label %42
18: ; preds = %13
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 102
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 12, i8* %2
br label %41
23: ; preds = %18
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 98
br i1 %26, label %27, label %28
27: ; preds = %23
store i8 8, i8* %2
br label %40
28: ; preds = %23
%29 = load i8, i8* %2
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 48
br i1 %31, label %32, label %33
32: ; preds = %28
store i8 0, i8* %2
br label %39
33: ; preds = %28
%34 = load i8, i8* %2
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 0, i32* %1
br label %48
38: ; preds = %33
br label %39
39: ; preds = %38, %32
br label %40
40: ; preds = %39, %27
br label %41
41: ; preds = %40, %22
br label %42
42: ; preds = %41, %17
br label %43
43: ; preds = %42, %12
br label %44
44: ; preds = %43, %7
%45 = call i32 (...) @gch()
%46 = load i8, i8* %2
%47 = sext i8 %46 to i32
store i32 %47, i32* %1
br label %48
48: ; preds = %44, %37
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
define i32 @spechar() {
%1 = tail call signext i8 (...) @ch()
switch i8 %1, label %7 [
i8 110, label %9
i8 116, label %2
i8 114, label %3
i8 102, label %4
i8 98, label %5
i8 48, label %6
i8 0, label %12
]
2: ; preds = %0
br label %9
3: ; preds = %0
br label %9
4: ; preds = %0
br label %9
5: ; preds = %0
br label %9
6: ; preds = %0
br label %9
7: ; preds = %0
%8 = sext i8 %1 to i32
br label %9
9: ; preds = %0, %7, %2, %4, %6, %5, %3
%10 = phi i32 [ 9, %2 ], [ 13, %3 ], [ 12, %4 ], [ 8, %5 ], [ 0, %6 ], [ 10, %0 ], [ %8, %7 ]
%11 = tail call i32 (...) @gch()
br label %12
12: ; preds = %0, %9
%13 = phi i32 [ %10, %9 ], [ 0, %0 ]
ret i32 %13
}