char *frombreak(buf, fbuf)
register char *buf, *fbuf;
{
  register char *p;
  p = fbuf;
  while (*++p != '\0')
    switch (*p) {
    case '\n':
    case '\t':
    case ' ':
      *p = '\0';
      break;
    case '\004':
      goto garbled;
    default:;
    }
  *++p = '\004';
  *++p = '\0';
  for (p = fbuf; *p != '\004' || p[1] != '\0'; p += strlen(p) + 1) {
    if (strcmp(p, "forwarded") == 0)
      return (buf);
    if (strcmp(p, "remote") == 0) {
      p += strlen(p) + 1;
      if (strcmp(p, "from") == 0) {
        p += strlen(p) + 1;
        strcpy(buf, p);
        strcat(buf, "!");
        return (buf + strlen(buf));
      }
    }
  }
garbled:
  strcat(buf, "???!");
  return (buf + 4);
}


x86 assembly (clang, -O0):
<frombreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     11cc <frombreak+0x8c>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x4,%eax
je     11bd <frombreak+0x7d>
jmp    118c <frombreak+0x4c>
mov    -0x24(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     11b1 <frombreak+0x71>
jmp    11a0 <frombreak+0x60>
mov    -0x24(%rbp),%eax
sub    $0x20,%eax
jne    11c2 <frombreak+0x82>
jmp    11b1 <frombreak+0x71>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
jmp    11c7 <frombreak+0x87>
jmp    131c <frombreak+0x1dc>
jmp    11c7 <frombreak+0x87>
jmp    1158 <frombreak+0x18>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x4,0x1(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x4,%ecx
mov    %al,-0x25(%rbp)
jne    1220 <frombreak+0xe0>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    1230 <frombreak+0xf0>
jmp    1317 <frombreak+0x1d7>
mov    -0x20(%rbp),%rdi
lea    0xdc5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1256 <frombreak+0x116>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1338 <frombreak+0x1f8>
mov    -0x20(%rbp),%rdi
lea    0xda9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12f8 <frombreak+0x1b8>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xd82(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12f3 <frombreak+0x1b3>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xd4f(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1338 <frombreak+0x1f8>
jmp    12f8 <frombreak+0x1b8>
jmp    12fd <frombreak+0x1bd>
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    11fa <frombreak+0xba>
jmp    131c <frombreak+0x1dc>
mov    -0x10(%rbp),%rdi
lea    0xcef(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frombreak>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x1(%rsi),%cl
mov    %rsi,%rax
test   %cl,%cl
je     1194 <frombreak+0x64>
mov    %rbx,%rax
jmp    1160 <frombreak+0x30>
xchg   %ax,%ax
movb   $0x0,0x1(%rax)
movzbl 0x2(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1194 <frombreak+0x64>
movsbl %cl,%ecx
lea    -0x9(%rcx),%edx
cmp    $0x2,%edx
jb     1150 <frombreak+0x20>
cmp    $0x20,%ecx
je     1150 <frombreak+0x20>
cmp    $0x4,%ecx
jne    1154 <frombreak+0x24>
mov    %r14,%rdi
call   1040 <strlen@plt>
movl   $0x213f3f3f,(%r14,%rax,1)
21
movb   $0x0,0x4(%r14,%rax,1)
add    $0x4,%r14
jmp    1248 <frombreak+0x118>
movw   $0x4,0x2(%rax)
lea    0xe5f(%rip),%r15
lea    0xe62(%rip),%r12
lea    0xe62(%rip),%r13
jmp    11cf <frombreak+0x9f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    %rax,%rbx
add    $0x1,%rbx
cmpb   $0x4,(%rbx)
jne    11da <frombreak+0xaa>
cmpb   $0x0,0x1(%rbx)
je     1175 <frombreak+0x45>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1248 <frombreak+0x118>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11c0 <frombreak+0x90>
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11c0 <frombreak+0x90>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    (%rax,%rbx,1),%rsi
add    $0x1,%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
movw   $0x21,(%r14,%rax,1)
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %rax,%r14
mov    %r14,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"forwarded\00"
@.str.1 = [7 x i8] c"remote\00"
@.str.2 = [5 x i8] c"from\00"
@.str.3 = [2 x i8] c"!\00"
@.str.4 = [5 x i8] c"???!\00"
define i8* @frombreak(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
store i8* %7, i8** %6
br label %8
8: ; preds = %22, %2
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %6
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %8
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %21 [
i32 10, label %18
i32 9, label %18
i32 32, label %18
i32 4, label %20
]
18: ; preds = %14, %14, %14
%19 = load i8*, i8** %6
store i8 0, i8* %19
br label %22
20: ; preds = %14
br label %85
21: ; preds = %14
br label %22
22: ; preds = %21, %18
br label %8
23: ; preds = %8
%24 = load i8*, i8** %6
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %6
store i8 4, i8* %25
%26 = load i8*, i8** %6
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %6
store i8 0, i8* %27
%28 = load i8*, i8** %5
store i8* %28, i8** %6
br label %29
29: ; preds = %78, %23
%30 = load i8*, i8** %6
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 4
br i1 %33, label %40, label %34
34: ; preds = %29
%35 = load i8*, i8** %6
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 0
br label %40
40: ; preds = %34, %29
%41 = phi i1 [ true, %29 ], [ %39, %34 ]
br i1 %41, label %42, label %84
42: ; preds = %40
%43 = load i8*, i8** %6
%44 = call i32 @strcmp(i8* %43, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %42
%47 = load i8*, i8** %4
store i8* %47, i8** %3
br label %90
48: ; preds = %42
%49 = load i8*, i8** %6
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %77
52: ; preds = %48
%53 = load i8*, i8** %6
%54 = call i64 @strlen(i8* %53)
%55 = add i64 %54, 1
%56 = load i8*, i8** %6
%57 = getelementptr inbounds i8, i8* %56, i64 %55
store i8* %57, i8** %6
%58 = load i8*, i8** %6
%59 = call i32 @strcmp(i8* %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %76
61: ; preds = %52
%62 = load i8*, i8** %6
%63 = call i64 @strlen(i8* %62)
%64 = add i64 %63, 1
%65 = load i8*, i8** %6
%66 = getelementptr inbounds i8, i8* %65, i64 %64
store i8* %66, i8** %6
%67 = load i8*, i8** %4
%68 = load i8*, i8** %6
%69 = call i8* @strcpy(i8* %67, i8* %68)
%70 = load i8*, i8** %4
%71 = call i8* @strcat(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%72 = load i8*, i8** %4
%73 = load i8*, i8** %4
%74 = call i64 @strlen(i8* %73)
%75 = getelementptr inbounds i8, i8* %72, i64 %74
store i8* %75, i8** %3
br label %90
76: ; preds = %52
br label %77
77: ; preds = %76, %48
br label %78
78: ; preds = %77
%79 = load i8*, i8** %6
%80 = call i64 @strlen(i8* %79)
%81 = add i64 %80, 1
%82 = load i8*, i8** %6
%83 = getelementptr inbounds i8, i8* %82, i64 %81
store i8* %83, i8** %6
br label %29
84: ; preds = %40
br label %85
85: ; preds = %84, %20
%86 = load i8*, i8** %4
%87 = call i8* @strcat(i8* %86, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%88 = load i8*, i8** %4
%89 = getelementptr inbounds i8, i8* %88, i64 4
store i8* %89, i8** %3
br label %90
90: ; preds = %85, %61, %46
%91 = load i8*, i8** %3
ret i8* %91
}

LLVM IR (-O2):
@.str = [10 x i8] c"forwarded\00"
@.str.1 = [7 x i8] c"remote\00"
@.str.2 = [5 x i8] c"from\00"
@.str.4 = [5 x i8] c"???!\00"
define i8* @frombreak(i8* %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2, %11
%7 = phi i8 [ %13, %11 ], [ %4, %2 ]
%8 = phi i8* [ %12, %11 ], [ %3, %2 ]
%9 = sext i8 %7 to i32
switch i32 %9, label %11 [
i32 10, label %10
i32 9, label %10
i32 32, label %10
i32 4, label %54
]
10: ; preds = %6, %6, %6
store i8 0, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %2
%16 = phi i8* [ %1, %2 ], [ %8, %11 ]
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 4, i8* %17
%18 = getelementptr inbounds i8, i8* %16, i64 3
store i8 0, i8* %18
br label %19
19: ; preds = %49, %15
%20 = phi i8* [ %1, %15 ], [ %53, %49 ]
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 4
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = getelementptr inbounds i8, i8* %20, i64 1
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %54, label %27
27: ; preds = %19, %23
%28 = tail call i32 @strcmp(i8* %20, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %58, label %30
30: ; preds = %27
%31 = tail call i32 @strcmp(i8* %20, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %49
33: ; preds = %30
%34 = tail call i64 @strlen(i8* %20)
%35 = add i64 %34, 1
%36 = getelementptr inbounds i8, i8* %20, i64 %35
%37 = tail call i32 @strcmp(i8* %36, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %49
39: ; preds = %33
%40 = tail call i64 @strlen(i8* %36)
%41 = add i64 %40, 1
%42 = getelementptr inbounds i8, i8* %36, i64 %41
%43 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* %42)
%44 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%45 = getelementptr i8, i8* %0, i64 %44
%46 = bitcast i8* %45 to i16*
store i16 33, i16* %46
%47 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%48 = getelementptr inbounds i8, i8* %0, i64 %47
br label %58
49: ; preds = %30, %33
%50 = phi i8* [ %36, %33 ], [ %20, %30 ]
%51 = tail call i64 @strlen(i8* dereferenceable(1) %50)
%52 = add i64 %51, 1
%53 = getelementptr inbounds i8, i8* %50, i64 %52
br label %19
54: ; preds = %6, %23
%55 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%56 = getelementptr i8, i8* %0, i64 %55
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %56, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5, i1 false)
%57 = getelementptr inbounds i8, i8* %0, i64 4
br label %58
58: ; preds = %27, %54, %39
%59 = phi i8* [ %57, %54 ], [ %48, %39 ], [ %0, %27 ]
ret i8* %59
}