char *addr(text)
char *text;
{
  static char buf[128];
  register char *cp, *bufp;
  int textseen, blankseen;
  char *copyaddr();
  textseen = blankseen = 0;
  bufp = buf;
  if (!text)
    return (0);
  for (cp = text; (*cp == ' ' || *cp == '\t'); cp++)
    ;
  for (;; cp++) {
    switch (*cp) {
    default:
      textseen++;
      break;
    case ' ':
    case '\t':
      blankseen++;
      break;
    case 'a':
      if (!blankseen || !textseen || !ssequal("at ", cp)) {
        textseen++;
        break;
      }
      bufp = copy(" at ", buf);
      copyaddr(cp + 3, bufp);
      return (buf);
    case '@':
      if (!textseen)
        return (0);
      bufp = copy(" @ ", buf);
      copyaddr(cp + 1, bufp);
      return (buf);
    case ',':
    case '\n':
    case 0:
      return (0);
    }
  }
}


x86 assembly (clang, -O0):
<addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0x2eff(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <addr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1351 <addr+0x221>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x29(%rbp)
je     119a <addr+0x6a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11aa <addr+0x7a>
jmp    11c0 <addr+0x90>
jmp    11af <addr+0x7f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1175 <addr+0x45>
jmp    11c5 <addr+0x95>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x30(%rbp)
test   %eax,%eax
je     132e <addr+0x1fe>
jmp    11dc <addr+0xac>
mov    -0x30(%rbp),%eax
sub    $0x9,%eax
je     1250 <addr+0x120>
jmp    11ed <addr+0xbd>
mov    -0x30(%rbp),%eax
sub    $0xa,%eax
je     132e <addr+0x1fe>
jmp    11fe <addr+0xce>
mov    -0x30(%rbp),%eax
sub    $0x20,%eax
je     1250 <addr+0x120>
jmp    120f <addr+0xdf>
mov    -0x30(%rbp),%eax
sub    $0x2c,%eax
je     132e <addr+0x1fe>
jmp    1220 <addr+0xf0>
mov    -0x30(%rbp),%eax
sub    $0x40,%eax
je     12d9 <addr+0x1a9>
jmp    1231 <addr+0x101>
mov    -0x30(%rbp),%eax
sub    $0x61,%eax
je     125e <addr+0x12e>
jmp    1242 <addr+0x112>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    133b <addr+0x20b>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    133b <addr+0x20b>
cmpl   $0x0,-0x28(%rbp)
je     128d <addr+0x15d>
cmpl   $0x0,-0x24(%rbp)
je     128d <addr+0x15d>
mov    -0x18(%rbp),%rsi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1050 <ssequal@plt>
cmp    $0x0,%eax
jne    129b <addr+0x16b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    133b <addr+0x20b>
lea    0xd5e(%rip),%rdi
lea    0x2da7(%rip),%rsi
mov    $0x0,%al
call   1040 <copy@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x3,%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <copyaddr@plt>
lea    0x2d80(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1351 <addr+0x221>
cmpl   $0x0,-0x24(%rbp)
jne    12f0 <addr+0x1c0>
movq   $0x0,-0x8(%rbp)
jmp    1351 <addr+0x221>
lea    0xd0e(%rip),%rdi
lea    0x2d52(%rip),%rsi
mov    $0x0,%al
call   1040 <copy@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <copyaddr@plt>
lea    0x2d2b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1351 <addr+0x221>
movq   $0x0,-0x8(%rbp)
jmp    1351 <addr+0x221>
jmp    1340 <addr+0x210>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11c5 <addr+0x95>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     121b <addr+0xeb>
mov    %rdi,%rbx
jmp    1154 <addr+0x24>
nopl   0x0(%rax)
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x9,%al
je     1150 <addr+0x20>
cmp    $0x20,%al
je     1150 <addr+0x20>
lea    0xe9b(%rip),%r15
movabs $0x100000200,%r12
movabs $0x100000000401,%r13
xor    %ebp,%ebp
xor    %r14d,%r14d
jmp    11a0 <addr+0x70>
bt     %rax,%r13
jb     121b <addr+0xeb>
cmp    $0x61,%eax
je     11c0 <addr+0x90>
cmp    $0x40,%eax
je     11e8 <addr+0xb8>
add    $0x1,%ebp
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
movsbl %al,%eax
cmp    $0x2c,%eax
ja     118b <addr+0x5b>
bt     %rax,%r12
jae    1181 <addr+0x51>
add    $0x1,%r14d
jmp    1198 <addr+0x68>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r14d,%r14d
je     1195 <addr+0x65>
test   %ebp,%ebp
je     1195 <addr+0x65>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <ssequal@plt>
test   %eax,%eax
je     1195 <addr+0x65>
mov    $0x3,%ebp
lea    0xe1a(%rip),%rdi
jmp    11f8 <addr+0xc8>
test   %ebp,%ebp
je     121b <addr+0xeb>
mov    $0x1,%ebp
lea    0xe0d(%rip),%rdi
lea    0x2e51(%rip),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <copy@plt>
movslq %eax,%rsi
add    %rbp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <copyaddr@plt>
jmp    121e <addr+0xee>
xor    %r15d,%r15d
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@addr.buf = internal global [128 x i8] zeroinitializer
@.str = [4 x i8] c"at \00"
@.str.1 = [5 x i8] c" at \00"
@.str.2 = [4 x i8] c" @ \00"
define i8* @addr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %7
store i32 0, i32* %6
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr.buf, i64 0, i64 0), i8** %5
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i8* null, i8** %2
br label %78
11: ; preds = %1
%12 = load i8*, i8** %3
store i8* %12, i8** %4
br label %13
13: ; preds = %26, %11
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 32
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 9
br label %23
23: ; preds = %18, %13
%24 = phi i1 [ true, %13 ], [ %22, %18 ]
br i1 %24, label %25, label %29
25: ; preds = %23
br label %26
26: ; preds = %25
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
br label %13
29: ; preds = %23
br label %30
30: ; preds = %75, %29
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
switch i32 %33, label %34 [
i32 32, label %37
i32 9, label %37
i32 97, label %40
i32 64, label %61
i32 44, label %73
i32 10, label %73
i32 0, label %73
]
34: ; preds = %30
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %74
37: ; preds = %30, %30
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %74
40: ; preds = %30
%41 = load i32, i32* %7
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %50
43: ; preds = %40
%44 = load i32, i32* %6
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %43
%47 = load i8*, i8** %4
%48 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ssequal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %47)
%49 = icmp ne i32 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %46, %43, %40
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %74
53: ; preds = %46
%54 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @copy to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr.buf, i64 0, i64 0))
%55 = sext i32 %54 to i64
%56 = inttoptr i64 %55 to i8*
store i8* %56, i8** %5
%57 = load i8*, i8** %4
%58 = getelementptr inbounds i8, i8* %57, i64 3
%59 = load i8*, i8** %5
%60 = call i8* (i8*, i8*, ...) bitcast (i8* (...)* @copyaddr to i8* (i8*, i8*, ...)*)(i8* %58, i8* %59)
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr.buf, i64 0, i64 0), i8** %2
br label %78
61: ; preds = %30
%62 = load i32, i32* %6
%63 = icmp ne i32 %62, 0
br i1 %63, label %65, label %64
64: ; preds = %61
store i8* null, i8** %2
br label %78
65: ; preds = %61
%66 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @copy to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr.buf, i64 0, i64 0))
%67 = sext i32 %66 to i64
%68 = inttoptr i64 %67 to i8*
store i8* %68, i8** %5
%69 = load i8*, i8** %4
%70 = getelementptr inbounds i8, i8* %69, i64 1
%71 = load i8*, i8** %5
%72 = call i8* (i8*, i8*, ...) bitcast (i8* (...)* @copyaddr to i8* (i8*, i8*, ...)*)(i8* %70, i8* %71)
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr.buf, i64 0, i64 0), i8** %2
br label %78
73: ; preds = %30, %30, %30
store i8* null, i8** %2
br label %78
74: ; preds = %50, %37, %34
br label %75
75: ; preds = %74
%76 = load i8*, i8** %4
%77 = getelementptr inbounds i8, i8* %76, i32 1
store i8* %77, i8** %4
br label %30
78: ; preds = %73, %65, %64, %53, %10
%79 = load i8*, i8** %2
ret i8* %79
}

LLVM IR (-O2):
@addr.buf = internal global [128 x i8] zeroinitializer
@.str = [4 x i8] c"at \00"
@.str.1 = [5 x i8] c" at \00"
@.str.2 = [4 x i8] c" @ \00"
define i8* @addr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %42, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %29
%9 = phi i8 [ %33, %29 ], [ %5, %3 ]
%10 = phi i8* [ %32, %29 ], [ %4, %3 ]
%11 = phi i32 [ %30, %29 ], [ 0, %3 ]
%12 = phi i32 [ %31, %29 ], [ 0, %3 ]
%13 = sext i8 %9 to i32
switch i32 %13, label %14 [
i32 32, label %16
i32 9, label %16
i32 97, label %18
i32 64, label %27
i32 44, label %42
i32 10, label %42
i32 0, label %42
]
14: ; preds = %8
%15 = add nsw i32 %11, 1
br label %29
16: ; preds = %8, %8
%17 = add nsw i32 %12, 1
br label %29
18: ; preds = %8
%19 = icmp ne i32 %12, 0
%20 = icmp ne i32 %11, 0
%21 = select i1 %19, i1 %20, i1 false
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ssequal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %22, %18
%26 = add nsw i32 %11, 1
br label %29
27: ; preds = %8
%28 = icmp eq i32 %11, 0
br i1 %28, label %42, label %34
29: ; preds = %14, %16, %25
%30 = phi i32 [ %15, %14 ], [ %26, %25 ], [ %11, %16 ]
%31 = phi i32 [ %12, %14 ], [ %12, %25 ], [ %17, %16 ]
%32 = getelementptr inbounds i8, i8* %10, i64 1
%33 = load i8, i8* %32
br label %8
34: ; preds = %22, %27
%35 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %27 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %22 ]
%36 = phi i64 [ 1, %27 ], [ 3, %22 ]
%37 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @copy to i32 (i8*, i8*, ...)*)(i8* %35, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @addr.buf, i64 0, i64 0))
%38 = sext i32 %37 to i64
%39 = inttoptr i64 %38 to i8*
%40 = getelementptr inbounds i8, i8* %10, i64 %36
%41 = tail call i8* (i8*, i8*, ...) bitcast (i8* (...)* @copyaddr to i8* (i8*, i8*, ...)*)(i8* %40, i8* %39)
br label %42
42: ; preds = %8, %8, %8, %34, %27, %1
%43 = phi i8* [ null, %1 ], [ null, %27 ], [ getelementptr inbounds ([128 x i8], [128 x i8]* @addr.buf, i64 0, i64 0), %34 ], [ null, %8 ], [ null, %8 ], [ null, %8 ]
ret i8* %43
}