char myesc(array)
char array[];
{
  switch (array[1]) {
  case 'n':
    return ('\n');
  case 't':
    return ('\t');
  case 'f':
    return ('\f');
  case 'r':
    return ('\r');
  case 'b':
    return ('\b');
  case '0':
    if (isdigit(array[2])) {
      char c, esc_char;
      register int sptr = 2;
      while (isdigit(array[sptr]))
        ++sptr;
      c = array[sptr];
      array[sptr] = '\0';
      esc_char = otoi(array + 2);
      array[sptr] = c;
      if (esc_char == '\0') {
        synerr("escape sequence for null not allowed");
        return (1);
      }
      return (esc_char);
    } else {
      synerr("escape sequence for null not allowed");
      return (1);
    }
  }
  return (array[1]);
}


x86 assembly (clang, -O0):
<myesc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x30,%eax
je     11d7 <myesc+0xa7>
jmp    1155 <myesc+0x25>
mov    -0x1c(%rbp),%eax
sub    $0x62,%eax
je     11ce <myesc+0x9e>
jmp    1166 <myesc+0x36>
mov    -0x1c(%rbp),%eax
sub    $0x66,%eax
je     11bc <myesc+0x8c>
jmp    1177 <myesc+0x47>
mov    -0x1c(%rbp),%eax
sub    $0x6e,%eax
je     11aa <myesc+0x7a>
jmp    1188 <myesc+0x58>
mov    -0x1c(%rbp),%eax
sub    $0x72,%eax
je     11c5 <myesc+0x95>
jmp    1199 <myesc+0x69>
mov    -0x1c(%rbp),%eax
sub    $0x74,%eax
je     11b3 <myesc+0x83>
jmp    129c <myesc+0x16c>
movb   $0xa,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
movb   $0x9,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
movb   $0xc,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
movb   $0xd,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
movb   $0x8,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1285 <myesc+0x155>
movl   $0x2,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     121c <myesc+0xec>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f4 <myesc+0xc4>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
mov    $0x0,%al
call   1050 <otoi@plt>
mov    %al,-0x12(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jne    127a <myesc+0x14a>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1040 <synerr@plt>
movb   $0x1,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
mov    -0x12(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1040 <synerr@plt>
movb   $0x1,-0x1(%rbp)
jmp    12a6 <myesc+0x176>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myesc>:
push   %r15
push   %r14
push   %rbx
mov    0x1(%rdi),%cl
movsbl %cl,%eax
lea    -0x62(%rax),%edx
cmp    $0x12,%edx
ja     1149 <myesc+0x29>
mov    $0xa,%al
lea    0xec4(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    $0x8,%al
jmp    11b9 <myesc+0x99>
cmp    $0x30,%eax
jne    11ab <myesc+0x8b>
mov    %rdi,%r14
add    $0x2,%rdi
mov    0x2(%r14),%bl
movsbl %bl,%eax
add    $0xffffffd0,%eax
cmp    $0x9,%eax
ja     1199 <myesc+0x79>
mov    $0x2,%eax
ja     1182 <myesc+0x62>
mov    $0x2,%eax
movsbl 0x1(%r14,%rax,1),%ebx
lea    -0x30(%rbx),%ecx
add    $0x1,%rax
cmp    $0xa,%ecx
jb     1170 <myesc+0x50>
mov    %eax,%r15d
movb   $0x0,(%r14,%r15,1)
xor    %eax,%eax
call   1040 <otoi@plt>
mov    %bl,(%r14,%r15,1)
test   %al,%al
jne    11b9 <myesc+0x99>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <synerr@plt>
mov    $0x1,%al
jmp    11b9 <myesc+0x99>
mov    %ecx,%eax
jmp    11b9 <myesc+0x99>
mov    $0xc,%al
jmp    11b9 <myesc+0x99>
mov    $0xd,%al
jmp    11b9 <myesc+0x99>
mov    $0x9,%al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"escape sequence for null not allowed\00"
define signext i8 @myesc(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
switch i32 %10, label %64 [
i32 110, label %11
i32 116, label %12
i32 102, label %13
i32 114, label %14
i32 98, label %15
i32 48, label %16
]
11: ; preds = %1
store i8 10, i8* %2
br label %68
12: ; preds = %1
store i8 9, i8* %2
br label %68
13: ; preds = %1
store i8 12, i8* %2
br label %68
14: ; preds = %1
store i8 13, i8* %2
br label %68
15: ; preds = %1
store i8 8, i8* %2
br label %68
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = call i32 @isdigit(i32 %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %62
23: ; preds = %16
store i32 2, i32* %6
br label %24
24: ; preds = %33, %23
%25 = load i8*, i8** %3
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = call i32 @isdigit(i32 %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %24
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %24
36: ; preds = %24
%37 = load i8*, i8** %3
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = load i8, i8* %40
store i8 %41, i8* %4
%42 = load i8*, i8** %3
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
store i8 0, i8* %45
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i64 2
%48 = call i32 (i8*, ...) bitcast (i32 (...)* @otoi to i32 (i8*, ...)*)(i8* %47)
%49 = trunc i32 %48 to i8
store i8 %49, i8* %5
%50 = load i8, i8* %4
%51 = load i8*, i8** %3
%52 = load i32, i32* %6
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
store i8 %50, i8* %54
%55 = load i8, i8* %5
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %36
%59 = call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i8 1, i8* %2
br label %68
60: ; preds = %36
%61 = load i8, i8* %5
store i8 %61, i8* %2
br label %68
62: ; preds = %16
%63 = call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i8 1, i8* %2
br label %68
64: ; preds = %1
%65 = load i8*, i8** %3
%66 = getelementptr inbounds i8, i8* %65, i64 1
%67 = load i8, i8* %66
store i8 %67, i8* %2
br label %68
68: ; preds = %64, %62, %60, %58, %15, %14, %13, %12, %11
%69 = load i8, i8* %2
ret i8 %69
}

LLVM IR (-O2):
@.str = [37 x i8] c"escape sequence for null not allowed\00"
define signext i8 @myesc(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %41 [
i32 110, label %42
i32 116, label %5
i32 102, label %6
i32 114, label %7
i32 98, label %8
i32 48, label %9
]
5: ; preds = %1
br label %42
6: ; preds = %1
br label %42
7: ; preds = %1
br label %42
8: ; preds = %1
br label %42
9: ; preds = %1
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, -48
%14 = icmp ult i32 %13, 10
br i1 %14, label %15, label %39
15: ; preds = %9
%16 = sext i8 %11 to i32
%17 = add nsw i32 %16, -48
%18 = icmp ult i32 %17, 10
br i1 %18, label %19, label %27
19: ; preds = %15, %19
%20 = phi i64 [ %26, %19 ], [ 3, %15 ]
%21 = getelementptr inbounds i8, i8* %0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, -48
%25 = icmp ult i32 %24, 10
%26 = add nuw i64 %20, 1
br i1 %25, label %19, label %27
27: ; preds = %19, %15
%28 = phi i8 [ %11, %15 ], [ %22, %19 ]
%29 = phi i64 [ 2, %15 ], [ %20, %19 ]
%30 = and i64 %29, 4294967295
%31 = getelementptr inbounds i8, i8* %0, i64 %30
store i8 0, i8* %31
%32 = tail call i32 (i8*, ...) bitcast (i32 (...)* @otoi to i32 (i8*, ...)*)(i8* %10)
store i8 %28, i8* %31
%33 = and i32 %32, 255
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %27
%36 = tail call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %42
37: ; preds = %27
%38 = trunc i32 %32 to i8
br label %42
39: ; preds = %9
%40 = tail call i32 (i8*, ...) bitcast (i32 (...)* @synerr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %42
41: ; preds = %1
br label %42
42: ; preds = %35, %37, %1, %41, %39, %8, %7, %6, %5
%43 = phi i8 [ %3, %41 ], [ 1, %39 ], [ 8, %8 ], [ 13, %7 ], [ 12, %6 ], [ 9, %5 ], [ 10, %1 ], [ 1, %35 ], [ %38, %37 ]
ret i8 %43
}