#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
char *strtok(char *, char *);
void list_mb(FILE *in) {
  char buf[512];
  while (fgets(buf, sizeof(buf), in) != NULL) {
    char *p;
    for (p = buf; *p == ' ' || *p == '\t' || *p == '%'; ++p)
      ;
    if (p[0] == '@' && p[1] == 'o') {
      p = strtok(p, " \t\r\n");
      p = strtok(NULL, " \t\r\n");
      if (p)
        printf("%s\n", p);
    }
  }
}


x86 assembly (clang, -O0):
<list_mb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     126a <list_mb+0x13a>
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x218(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x219(%rbp)
je     11b8 <list_mb+0x88>
mov    -0x218(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x219(%rbp)
je     11b8 <list_mb+0x88>
mov    -0x218(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
sete   %al
mov    %al,-0x219(%rbp)
mov    -0x219(%rbp),%al
test   $0x1,%al
jne    11cb <list_mb+0x9b>
jmp    11e7 <list_mb+0xb7>
jmp    11d0 <list_mb+0xa0>
mov    -0x218(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x218(%rbp)
jmp    116c <list_mb+0x3c>
mov    -0x218(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1265 <list_mb+0x135>
mov    -0x218(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6f,%eax
jne    1265 <list_mb+0x135>
mov    -0x218(%rbp),%rdi
lea    0xde4(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x218(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdcd(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x218(%rbp)
cmpq   $0x0,-0x218(%rbp)
je     1260 <list_mb+0x130>
mov    -0x218(%rbp),%rsi
lea    0xdaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1265 <list_mb+0x135>
jmp    113f <list_mb+0xf>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_mb>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     11e8 <list_mb+0xb8>
lea    0xe9c(%rip),%r15
lea    0xe9a(%rip),%r12
mov    %r14,%rdi
jmp    1174 <list_mb+0x44>
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x24,%al
jg     1190 <list_mb+0x60>
cmp    $0x9,%al
je     1170 <list_mb+0x40>
cmp    $0x20,%al
je     1170 <list_mb+0x40>
jmp    11d0 <list_mb+0xa0>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x40,%al
je     11a0 <list_mb+0x70>
cmp    $0x25,%al
je     1170 <list_mb+0x40>
jmp    11d0 <list_mb+0xa0>
nopw   0x0(%rax,%rax,1)
cmpb   $0x6f,0x1(%rdi)
jne    11d0 <list_mb+0xa0>
mov    %r15,%rsi
call   1050 <strtok@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   1050 <strtok@plt>
test   %rax,%rax
je     11d0 <list_mb+0xa0>
mov    %r12,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
mov    %r14,%rdi
test   %rax,%rax
jne    1174 <list_mb+0x44>
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0D\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @list_mb(i32* %0) {
%2 = alloca i32*
%3 = alloca [512 x i8]
%4 = alloca i8*
store i32* %0, i32** %2
br label %5
5: ; preds = %55, %1
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32* @fgets(i8* %6, i32 512, i32* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %56
10: ; preds = %5
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
store i8* %11, i8** %4
br label %12
12: ; preds = %30, %10
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 32
br i1 %16, label %27, label %17
17: ; preds = %12
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 9
br i1 %21, label %27, label %22
22: ; preds = %17
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 37
br label %27
27: ; preds = %22, %17, %12
%28 = phi i1 [ true, %17 ], [ true, %12 ], [ %26, %22 ]
br i1 %28, label %29, label %33
29: ; preds = %27
br label %30
30: ; preds = %29
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %4
br label %12
33: ; preds = %27
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 64
br i1 %38, label %39, label %55
39: ; preds = %33
%40 = load i8*, i8** %4
%41 = getelementptr inbounds i8, i8* %40, i64 1
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 111
br i1 %44, label %45, label %55
45: ; preds = %39
%46 = load i8*, i8** %4
%47 = call i8* @strtok(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %47, i8** %4
%48 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %48, i8** %4
%49 = load i8*, i8** %4
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %54
51: ; preds = %45
%52 = load i8*, i8** %4
%53 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %51, %45
br label %55
55: ; preds = %54, %39, %33
br label %5
56: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0D\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @list_mb(i32* nocapture %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32* @fgets(i8* %3, i32 512, i32* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %26, label %6
6: ; preds = %1, %11
%7 = phi i8* [ %12, %11 ], [ %3, %1 ]
%8 = load i8, i8* %7
switch i8 %8, label %23 [
i8 32, label %9
i8 9, label %9
i8 37, label %9
i8 64, label %13
]
9: ; preds = %6, %6, %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
br label %11
11: ; preds = %9, %23
%12 = phi i8* [ %10, %9 ], [ %3, %23 ]
br label %6
13: ; preds = %6
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 111
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = call i8* @strtok(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%19 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i8* %19, null
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %23
23: ; preds = %6, %17, %21, %13
%24 = call i32* @fgets(i8* %3, i32 512, i32* %0)
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %11
26: ; preds = %23, %1
ret void
}