char *interp(s)
register char *s;
{
  static char buf[256];
  register char *p = buf, c, *q;
  while ((c = *s++)) {
    for (q = "\nn\rr\tt\ff\033E\bb"; *q; q++)
      if (*q++ == c) {
        *p++ = '\\';
        *p++ = *q;
        goto next;
      }
    if (c < 040) {
      *p++ = '^';
      *p++ = c + 'A' - 1;
    } else if (c == 0177) {
      *p++ = '^';
      *p++ = '?';
    } else
      *p++ = c;
  next:;
  }
  *p = '\0';
  return (buf);
}


x86 assembly (clang, -O0):
<interp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0x2f21(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1243 <interp+0x143>
lea    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a9 <interp+0xa9>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1193 <interp+0x93>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x5c,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    123e <interp+0x13e>
jmp    1198 <interp+0x98>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113a <interp+0x3a>
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
jge    11ea <interp+0xea>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x5e,(%rax)
movsbl -0x11(%rbp),%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1239 <interp+0x139>
movsbl -0x11(%rbp),%eax
cmp    $0x7f,%eax
jne    1220 <interp+0x120>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x5e,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x3f,(%rax)
jmp    1234 <interp+0x134>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1239 <interp+0x139>
jmp    123e <interp+0x13e>
jmp    1113 <interp+0x13>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2ddf(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%bl
test   %bl,%bl
je     11bf <interp+0xbf>
add    $0x1,%rdi
lea    0x2f16(%rip),%rax
lea    0xf2f(%rip),%r15
lea    0xed8(%rip),%rdx
lea    0xf2b(%rip),%r8
lea    0xf1e(%rip),%r9
lea    0xf19(%rip),%r10
lea    0xf0e(%rip),%r11
lea    0xf0d(%rip),%r14
nopl   0x0(%rax,%rax,1)
lea    -0x8(%rbx),%ecx
cmp    $0x13,%cl
ja     1171 <interp+0x71>
movzbl %cl,%ecx
movslq (%rdx,%rcx,4),%rsi
add    %rdx,%rsi
mov    %r15,%rcx
jmp    *%rsi
mov    %r8,%rcx
jmp    1190 <interp+0x90>
mov    %r9,%rcx
jmp    1190 <interp+0x90>
cmp    $0x1f,%bl
jg     11ab <interp+0xab>
movb   $0x5e,(%rax)
add    $0x40,%bl
mov    %bl,0x1(%rax)
jmp    119a <interp+0x9a>
mov    %r10,%rcx
jmp    1190 <interp+0x90>
mov    %r11,%rcx
jmp    1190 <interp+0x90>
mov    %r14,%rcx
xchg   %ax,%ax
movb   $0x5c,(%rax)
movzbl 0x1(%rcx),%ecx
mov    %cl,0x1(%rax)
add    $0x2,%rax
movzbl (%rdi),%ebx
add    $0x1,%rdi
test   %bl,%bl
jne    1150 <interp+0x50>
jmp    11c6 <interp+0xc6>
cmp    $0x7f,%bl
jne    11b7 <interp+0xb7>
movw   $0x3f5e,(%rax)
jmp    119a <interp+0x9a>
mov    %bl,(%rax)
add    $0x1,%rax
jmp    119e <interp+0x9e>
lea    0x2e6a(%rip),%rax
movb   $0x0,(%rax)
lea    0x2e60(%rip),%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@interp.buf = internal global [256 x i8] zeroinitializer
@.str = [13 x i8] c"\0An\0Dr\09t\0Cf\1BE\08b\00"
define i8* @interp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @interp.buf, i64 0, i64 0), i8** %3
br label %6
6: ; preds = %64, %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
%9 = load i8, i8* %7
store i8 %9, i8* %4
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %65
11: ; preds = %6
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %5
br label %12
12: ; preds = %32, %11
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %16, label %35
16: ; preds = %12
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %5
%19 = load i8, i8* %17
%20 = sext i8 %19 to i32
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %20, %22
br i1 %23, label %24, label %31
24: ; preds = %16
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
store i8 92, i8* %25
%27 = load i8*, i8** %5
%28 = load i8, i8* %27
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
store i8 %28, i8* %29
br label %64
31: ; preds = %16
br label %32
32: ; preds = %31
%33 = load i8*, i8** %5
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %5
br label %12
35: ; preds = %12
%36 = load i8, i8* %4
%37 = sext i8 %36 to i32
%38 = icmp slt i32 %37, 32
br i1 %38, label %39, label %49
39: ; preds = %35
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %3
store i8 94, i8* %40
%42 = load i8, i8* %4
%43 = sext i8 %42 to i32
%44 = add nsw i32 %43, 65
%45 = sub nsw i32 %44, 1
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i32 1
store i8* %48, i8** %3
store i8 %46, i8* %47
br label %63
49: ; preds = %35
%50 = load i8, i8* %4
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 127
br i1 %52, label %53, label %58
53: ; preds = %49
%54 = load i8*, i8** %3
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %3
store i8 94, i8* %54
%56 = load i8*, i8** %3
%57 = getelementptr inbounds i8, i8* %56, i32 1
store i8* %57, i8** %3
store i8 63, i8* %56
br label %62
58: ; preds = %49
%59 = load i8, i8* %4
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i32 1
store i8* %61, i8** %3
store i8 %59, i8* %60
br label %62
62: ; preds = %58, %53
br label %63
63: ; preds = %62, %39
br label %64
64: ; preds = %63, %24
br label %6
65: ; preds = %6
%66 = load i8*, i8** %3
store i8 0, i8* %66
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @interp.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@interp.buf = internal global [256 x i8] zeroinitializer
@.str = [13 x i8] c"\0An\0Dr\09t\0Cf\1BE\08b\00"
define i8* @interp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %36, label %4
4: ; preds = %1, %32
%5 = phi i8 [ %34, %32 ], [ %2, %1 ]
%6 = phi i8* [ %8, %32 ], [ %0, %1 ]
%7 = phi i8* [ %33, %32 ], [ getelementptr inbounds ([256 x i8], [256 x i8]* @interp.buf, i64 0, i64 0), %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
switch i8 %5, label %20 [
i8 10, label %14
i8 13, label %9
i8 9, label %10
i8 12, label %11
i8 27, label %12
i8 8, label %13
]
9: ; preds = %4
br label %14
10: ; preds = %4
br label %14
11: ; preds = %4
br label %14
12: ; preds = %4
br label %14
13: ; preds = %4
br label %14
14: ; preds = %4, %13, %12, %11, %10, %9
%15 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 2), %9 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 4), %10 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 6), %11 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 8), %12 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 10), %13 ]
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = getelementptr inbounds i8, i8* %7, i64 1
store i8 92, i8* %7
%18 = load i8, i8* %16
%19 = getelementptr inbounds i8, i8* %7, i64 2
store i8 %18, i8* %17
br label %32
20: ; preds = %4
%21 = icmp slt i8 %5, 32
br i1 %21, label %22, label %26
22: ; preds = %20
%23 = getelementptr inbounds i8, i8* %7, i64 1
store i8 94, i8* %7
%24 = add nsw i8 %5, 64
%25 = getelementptr inbounds i8, i8* %7, i64 2
store i8 %24, i8* %23
br label %32
26: ; preds = %20
%27 = icmp eq i8 %5, 127
%28 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %27, label %29, label %31
29: ; preds = %26
store i8 94, i8* %7
%30 = getelementptr inbounds i8, i8* %7, i64 2
store i8 63, i8* %28
br label %32
31: ; preds = %26
store i8 %5, i8* %7
br label %32
32: ; preds = %22, %31, %29, %14
%33 = phi i8* [ %19, %14 ], [ %25, %22 ], [ %30, %29 ], [ %28, %31 ]
%34 = load i8, i8* %8
%35 = icmp eq i8 %34, 0
br i1 %35, label %36, label %4
36: ; preds = %32, %1
%37 = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @interp.buf, i64 0, i64 0), %1 ], [ %33, %32 ]
store i8 0, i8* %37
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @interp.buf, i64 0, i64 0)
}