mapch(c) {
  extern peekc;
  auto a;
  if ((a = xread()) == c)
    return (-1);
  if (a == '\n' | a == 0 | a == 4) {
    error('cc');
    peekc = a;
    return (-1);
  }
  if (a == '*') {
    a = xread();
    if (a == '0')
      return (0);
    if (a == 'e')
      return (4);
    if (a == '(')
      return ('{');
    if (a == ')')
      return ('}');
    if (a == 't')
      return ('\t');
    if (a == 'r')
      return ('\r');
    if (a == 'n')
      return ('\n');
  }
  return (a);
}


x86 assembly (clang, -O0):
<mapch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <xread@plt>
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jne    114a <mapch+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0xa,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0xc(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpl   $0x4,-0xc(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     11a1 <mapch+0x81>
mov    $0x6363,%edi
mov    $0x0,%al
call   1040 <error@plt>
mov    -0xc(%rbp),%ecx
mov    0x2e4d(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0x2a,-0xc(%rbp)
jne    1254 <mapch+0x134>
mov    $0x0,%al
call   1030 <xread@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x30,-0xc(%rbp)
jne    11cb <mapch+0xab>
movl   $0x0,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0x65,-0xc(%rbp)
jne    11e1 <mapch+0xc1>
movl   $0x4,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0x28,-0xc(%rbp)
jne    11f7 <mapch+0xd7>
movl   $0x7b,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0x29,-0xc(%rbp)
jne    120d <mapch+0xed>
movl   $0x7d,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0x74,-0xc(%rbp)
jne    1223 <mapch+0x103>
movl   $0x9,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0x72,-0xc(%rbp)
jne    1239 <mapch+0x119>
movl   $0xd,-0x4(%rbp)
jmp    125a <mapch+0x13a>
cmpl   $0x6e,-0xc(%rbp)
jne    124f <mapch+0x12f>
movl   $0xa,-0x4(%rbp)
jmp    125a <mapch+0x13a>
jmp    1254 <mapch+0x134>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapch>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <xread@plt>
mov    $0xffffffff,%r14d
cmp    %ebx,%eax
je     11af <mapch+0x8f>
mov    %eax,%ebp
cmp    $0x9,%eax
jg     1149 <mapch+0x29>
test   %ebp,%ebp
je     1153 <mapch+0x33>
cmp    $0x4,%ebp
je     1153 <mapch+0x33>
jmp    11ac <mapch+0x8c>
cmp    $0x2a,%ebp
je     116a <mapch+0x4a>
cmp    $0xa,%ebp
jne    11ac <mapch+0x8c>
mov    $0x6363,%edi
xor    %eax,%eax
call   1040 <error@plt>
mov    0x2e7a(%rip),%rax
mov    %ebp,(%rax)
jmp    11af <mapch+0x8f>
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <xread@plt>
mov    %eax,%ebp
cmp    $0x64,%eax
jle    119d <mapch+0x7d>
mov    %ebp,%eax
add    $0xffffff9b,%eax
cmp    $0xf,%eax
ja     11ac <mapch+0x8c>
lea    0xe74(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x4,%r14d
jmp    11af <mapch+0x8f>
cmp    $0x28,%ebp
je     11cf <mapch+0xaf>
cmp    $0x29,%ebp
je     11d7 <mapch+0xb7>
cmp    $0x30,%ebp
je     11af <mapch+0x8f>
mov    %ebp,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0xa,%r14d
jmp    11af <mapch+0x8f>
mov    $0xd,%r14d
jmp    11af <mapch+0x8f>
mov    $0x9,%r14d
jmp    11af <mapch+0x8f>
mov    $0x7b,%r14d
jmp    11af <mapch+0x8f>
mov    $0x7d,%r14d
jmp    11af <mapch+0x8f>

LLVM IR (-O0):
@peekc = external global i32
define i32 @mapch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @xread()
store i32 %5, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %60
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 10
%12 = zext i1 %11 to i32
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = or i32 %12, %15
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 4
%19 = zext i1 %18 to i32
%20 = or i32 %16, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %9
%23 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 25443)
%24 = load i32, i32* %4
store i32 %24, i32* @peekc
store i32 -1, i32* %2
br label %60
25: ; preds = %9
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 42
br i1 %27, label %28, label %58
28: ; preds = %25
%29 = call i32 (...) @xread()
store i32 %29, i32* %4
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 48
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 0, i32* %2
br label %60
33: ; preds = %28
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 101
br i1 %35, label %36, label %37
36: ; preds = %33
store i32 4, i32* %2
br label %60
37: ; preds = %33
%38 = load i32, i32* %4
%39 = icmp eq i32 %38, 40
br i1 %39, label %40, label %41
40: ; preds = %37
store i32 123, i32* %2
br label %60
41: ; preds = %37
%42 = load i32, i32* %4
%43 = icmp eq i32 %42, 41
br i1 %43, label %44, label %45
44: ; preds = %41
store i32 125, i32* %2
br label %60
45: ; preds = %41
%46 = load i32, i32* %4
%47 = icmp eq i32 %46, 116
br i1 %47, label %48, label %49
48: ; preds = %45
store i32 9, i32* %2
br label %60
49: ; preds = %45
%50 = load i32, i32* %4
%51 = icmp eq i32 %50, 114
br i1 %51, label %52, label %53
52: ; preds = %49
store i32 13, i32* %2
br label %60
53: ; preds = %49
%54 = load i32, i32* %4
%55 = icmp eq i32 %54, 110
br i1 %55, label %56, label %57
56: ; preds = %53
store i32 10, i32* %2
br label %60
57: ; preds = %53
br label %58
58: ; preds = %57, %25
%59 = load i32, i32* %4
store i32 %59, i32* %2
br label %60
60: ; preds = %58, %56, %52, %48, %44, %40, %36, %32, %22, %8
%61 = load i32, i32* %2
ret i32 %61
}

LLVM IR (-O2):
@peekc = external global i32
define i32 @mapch(i32 %0) {
%2 = tail call i32 (...) @xread()
%3 = icmp eq i32 %2, %0
br i1 %3, label %17, label %4
4: ; preds = %1
switch i32 %2, label %15 [
i32 10, label %5
i32 4, label %5
i32 0, label %5
i32 42, label %7
]
5: ; preds = %4, %4, %4
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 25443)
store i32 %2, i32* @peekc
br label %17
7: ; preds = %4
%8 = tail call i32 (...) @xread()
switch i32 %8, label %15 [
i32 48, label %17
i32 101, label %9
i32 40, label %10
i32 41, label %11
i32 116, label %12
i32 114, label %13
i32 110, label %14
]
9: ; preds = %7
br label %17
10: ; preds = %7
br label %17
11: ; preds = %7
br label %17
12: ; preds = %7
br label %17
13: ; preds = %7
br label %17
14: ; preds = %7
br label %17
15: ; preds = %7, %4
%16 = phi i32 [ %2, %4 ], [ %8, %7 ]
br label %17
17: ; preds = %7, %1, %15, %14, %13, %12, %11, %10, %9, %5
%18 = phi i32 [ -1, %5 ], [ 4, %9 ], [ 123, %10 ], [ 125, %11 ], [ 9, %12 ], [ 13, %13 ], [ 10, %14 ], [ %16, %15 ], [ -1, %1 ], [ 0, %7 ]
ret i32 %18
}