#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 enum state { ____Placeholder_state } state;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int Fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ Putchar(char);
scalar_t__ isprint(int);
int process_file(FILE *stream, int stop_on_first) {
  int found = 0;
  int c;
  enum state { got_nothing, got_at, got_open, got_hash, got_all };
  enum state st;
  st = got_nothing;
  while ((c = Fgetc(stream)) != EOF) {
    if (c == '@')
      st = got_at;
    else if ((st == got_at) && (c == '('))
      st = got_open;
    else if ((st == got_open) && (c == '#'))
      st = got_hash;
    else if ((st == got_hash) && (c == ')')) {
      found = 1;
      Putchar('\t');
      while (((c = Fgetc(stream)) != EOF) && isprint(c) && (c != '"') &&
             (c != '>') && (c != '\n') && (c != '\\') && (c != '\0')) {
        Putchar(c);
      }
      Putchar('\n');
      st = got_nothing;
      if (stop_on_first)
        break;
    } else
      st = got_nothing;
  }
  return found;
}


x86 assembly (clang, -O0):
<process_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
je     12c5 <process_file+0x195>
cmpl   $0x40,-0x14(%rbp)
jne    117e <process_file+0x4e>
movl   $0x1,-0x18(%rbp)
jmp    12c0 <process_file+0x190>
cmpl   $0x1,-0x18(%rbp)
jne    119e <process_file+0x6e>
cmpl   $0x28,-0x14(%rbp)
jne    119e <process_file+0x6e>
movl   $0x2,-0x18(%rbp)
jmp    12bb <process_file+0x18b>
cmpl   $0x2,-0x18(%rbp)
jne    11be <process_file+0x8e>
cmpl   $0x23,-0x14(%rbp)
jne    11be <process_file+0x8e>
movl   $0x3,-0x18(%rbp)
jmp    12b6 <process_file+0x186>
cmpl   $0x3,-0x18(%rbp)
jne    12aa <process_file+0x17a>
cmpl   $0x29,-0x14(%rbp)
jne    12aa <process_file+0x17a>
movl   $0x1,-0x10(%rbp)
mov    $0x9,%edi
call   1050 <Putchar@plt>
mov    -0x8(%rbp),%rdi
call   1030 <Fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
mov    0x2dee(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x19(%rbp)
je     1265 <process_file+0x135>
mov    -0x14(%rbp),%edi
call   1040 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1265 <process_file+0x135>
xor    %eax,%eax
cmpl   $0x22,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     1265 <process_file+0x135>
xor    %eax,%eax
cmpl   $0x3e,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     1265 <process_file+0x135>
xor    %eax,%eax
cmpl   $0xa,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     1265 <process_file+0x135>
xor    %eax,%eax
cmpl   $0x5c,-0x14(%rbp)
mov    %al,-0x19(%rbp)
je     1265 <process_file+0x135>
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1275 <process_file+0x145>
jmp    1285 <process_file+0x155>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1050 <Putchar@plt>
jmp    11e3 <process_file+0xb3>
mov    $0xa,%edi
call   1050 <Putchar@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     12a5 <process_file+0x175>
jmp    12c5 <process_file+0x195>
jmp    12b1 <process_file+0x181>
movl   $0x0,-0x18(%rbp)
jmp    12b6 <process_file+0x186>
jmp    12bb <process_file+0x18b>
jmp    12c0 <process_file+0x190>
jmp    114d <process_file+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_file>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r12
call   1030 <Fgetc@plt>
mov    0x2e9e(%rip),%r15
xor    %ebp,%ebp
cmp    (%r15),%eax
jne    115c <process_file+0x2c>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
xor    %ebp,%ebp
jmp    118f <process_file+0x5f>
mov    $0xa,%edi
call   1050 <Putchar@plt>
mov    $0x1,%ebp
test   %r14d,%r14d
jne    1151 <process_file+0x21>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <Fgetc@plt>
mov    %ebx,%ecx
cmp    (%r15),%eax
je     1151 <process_file+0x21>
mov    $0x1,%ebx
cmp    $0x40,%eax
je     1180 <process_file+0x50>
cmp    $0x1,%ecx
jne    11a8 <process_file+0x78>
mov    $0x2,%ebx
cmp    $0x28,%eax
je     1180 <process_file+0x50>
cmp    $0x2,%ecx
jne    11b7 <process_file+0x87>
mov    $0x3,%ebx
cmp    $0x23,%eax
je     1180 <process_file+0x50>
xor    %ebx,%ebx
cmp    $0x3,%ecx
jne    1180 <process_file+0x50>
cmp    $0x29,%eax
jne    1180 <process_file+0x50>
mov    $0x9,%edi
call   1050 <Putchar@plt>
mov    %r12,%rdi
call   1030 <Fgetc@plt>
cmp    (%r15),%eax
je     1162 <process_file+0x32>
mov    %eax,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
call   1040 <isprint@plt>
test   %rax,%rax
je     1162 <process_file+0x32>
cmp    $0x22,%ebp
je     1162 <process_file+0x32>
cmp    $0x3e,%ebp
je     1162 <process_file+0x32>
cmp    $0xa,%ebp
je     1162 <process_file+0x32>
cmp    $0x5c,%ebp
je     1162 <process_file+0x32>
test   %ebp,%ebp
je     1162 <process_file+0x32>
movsbl %bpl,%edi
call   1050 <Putchar@plt>
mov    %r12,%rdi
call   1030 <Fgetc@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
jne    11e0 <process_file+0xb0>
jmp    1162 <process_file+0x32>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @process_file(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %7
br label %8
8: ; preds = %79, %2
%9 = load i32*, i32** %3
%10 = call i32 @Fgetc(i32* %9)
store i32 %10, i32* %6
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %80
13: ; preds = %8
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 64
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %7
br label %79
17: ; preds = %13
%18 = load i32, i32* %7
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 40
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 2, i32* %7
br label %78
24: ; preds = %20, %17
%25 = load i32, i32* %7
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %6
%29 = icmp eq i32 %28, 35
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 3, i32* %7
br label %77
31: ; preds = %27, %24
%32 = load i32, i32* %7
%33 = icmp eq i32 %32, 3
br i1 %33, label %34, label %75
34: ; preds = %31
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, 41
br i1 %36, label %37, label %75
37: ; preds = %34
store i32 1, i32* %5
%38 = call i32 @Putchar(i8 signext 9)
br label %39
39: ; preds = %65, %37
%40 = load i32*, i32** %3
%41 = call i32 @Fgetc(i32* %40)
store i32 %41, i32* %6
%42 = load i32, i32* @EOF
%43 = icmp ne i32 %41, %42
br i1 %43, label %44, label %63
44: ; preds = %39
%45 = load i32, i32* %6
%46 = call i64 @isprint(i32 %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %63
48: ; preds = %44
%49 = load i32, i32* %6
%50 = icmp ne i32 %49, 34
br i1 %50, label %51, label %63
51: ; preds = %48
%52 = load i32, i32* %6
%53 = icmp ne i32 %52, 62
br i1 %53, label %54, label %63
54: ; preds = %51
%55 = load i32, i32* %6
%56 = icmp ne i32 %55, 10
br i1 %56, label %57, label %63
57: ; preds = %54
%58 = load i32, i32* %6
%59 = icmp ne i32 %58, 92
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = load i32, i32* %6
%62 = icmp ne i32 %61, 0
br label %63
63: ; preds = %60, %57, %54, %51, %48, %44, %39
%64 = phi i1 [ false, %57 ], [ false, %54 ], [ false, %51 ], [ false, %48 ], [ false, %44 ], [ false, %39 ], [ %62, %60 ]
br i1 %64, label %65, label %69
65: ; preds = %63
%66 = load i32, i32* %6
%67 = trunc i32 %66 to i8
%68 = call i32 @Putchar(i8 signext %67)
br label %39
69: ; preds = %63
%70 = call i32 @Putchar(i8 signext 10)
store i32 0, i32* %7
%71 = load i32, i32* %4
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %69
br label %80
74: ; preds = %69
br label %76
75: ; preds = %34, %31
store i32 0, i32* %7
br label %76
76: ; preds = %75, %74
br label %77
77: ; preds = %76, %30
br label %78
78: ; preds = %77, %23
br label %79
79: ; preds = %78, %16
br label %8
80: ; preds = %73, %8
%81 = load i32, i32* %5
ret i32 %81
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @process_file(i32* %0, i32 %1) {
%3 = tail call i32 @Fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %58, label %6
6: ; preds = %2
%7 = icmp eq i32 %1, 0
br label %8
8: ; preds = %6, %52
%9 = phi i32 [ %3, %6 ], [ %55, %52 ]
%10 = phi i32 [ 0, %6 ], [ %54, %52 ]
%11 = phi i32 [ 0, %6 ], [ %53, %52 ]
%12 = icmp eq i32 %9, 64
br i1 %12, label %52, label %13
13: ; preds = %8
%14 = icmp eq i32 %10, 1
%15 = icmp eq i32 %9, 40
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %52, label %17
17: ; preds = %13
%18 = icmp eq i32 %10, 2
%19 = icmp eq i32 %9, 35
%20 = select i1 %18, i1 %19, i1 false
br i1 %20, label %52, label %21
21: ; preds = %17
%22 = icmp eq i32 %10, 3
%23 = icmp eq i32 %9, 41
%24 = select i1 %22, i1 %23, i1 false
br i1 %24, label %25, label %52
25: ; preds = %21
%26 = tail call i32 @Putchar(i8 signext 9)
%27 = tail call i32 @Fgetc(i32* %0)
%28 = load i32, i32* @EOF
%29 = icmp eq i32 %27, %28
br i1 %29, label %50, label %30
30: ; preds = %25, %44
%31 = phi i32 [ %47, %44 ], [ %27, %25 ]
%32 = tail call i64 @isprint(i32 %31)
%33 = icmp ne i64 %32, 0
%34 = icmp ne i32 %31, 34
%35 = and i1 %33, %34
%36 = icmp ne i32 %31, 62
%37 = and i1 %35, %36
%38 = icmp ne i32 %31, 10
%39 = and i1 %37, %38
%40 = icmp ne i32 %31, 92
%41 = and i1 %39, %40
%42 = icmp ne i32 %31, 0
%43 = and i1 %41, %42
br i1 %43, label %44, label %50
44: ; preds = %30
%45 = trunc i32 %31 to i8
%46 = tail call i32 @Putchar(i8 signext %45)
%47 = tail call i32 @Fgetc(i32* %0)
%48 = load i32, i32* @EOF
%49 = icmp eq i32 %47, %48
br i1 %49, label %50, label %30
50: ; preds = %30, %44, %25
%51 = tail call i32 @Putchar(i8 signext 10)
br i1 %7, label %52, label %58
52: ; preds = %21, %17, %13, %8, %50
%53 = phi i32 [ 1, %50 ], [ %11, %8 ], [ %11, %13 ], [ %11, %17 ], [ %11, %21 ]
%54 = phi i32 [ 0, %50 ], [ 1, %8 ], [ 2, %13 ], [ 3, %17 ], [ 0, %21 ]
%55 = tail call i32 @Fgetc(i32* %0)
%56 = load i32, i32* @EOF
%57 = icmp eq i32 %55, %56
br i1 %57, label %58, label %8
58: ; preds = %52, %50, %2
%59 = phi i32 [ 0, %2 ], [ 1, %50 ], [ %53, %52 ]
ret i32 %59
}