#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*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int getopt(int, char **, char *);
int optind;
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *tr_get_fp(char *);
int tr_reformat_usage();
int tr_reformat_task(int argc, char *argv[]) {
  int c;
  int one_line = 0;
  FILE *fp;
  while ((c = getopt(argc, argv, "1")) >= 0) {
    switch (c) {
    case '1':
      one_line = 1;
      break;
    }
  }
  if (argc == optind)
    return tr_reformat_usage();
  fp = tr_get_fp(argv[optind]);
  if (!one_line) {
    while (!feof(fp)) {
      c = fgetc(fp);
      if (c == EOF)
        break;
      if (c == '\\')
        c = fgetc(fp);
      else if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
        continue;
      else if (c == '(' || c == ',' || c == ';') {
        putchar(c);
        putchar('\n');
      } else if (c == ')') {
        putchar('\n');
        putchar(')');
      } else
        putchar(c);
    }
  } else {
    while (!feof(fp)) {
      c = fgetc(fp);
      if (c == EOF)
        break;
      if (c == '\\')
        c = fgetc(fp);
      else if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
        continue;
      else
        putchar(c);
    }
    putchar('\n');
  }
  if (fp != stdin)
    fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<tr_reformat_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe6c(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     11c2 <tr_reformat_task+0x52>
mov    -0x14(%rbp),%eax
sub    $0x31,%eax
jne    11bd <tr_reformat_task+0x4d>
jmp    11b6 <tr_reformat_task+0x46>
movl   $0x1,-0x18(%rbp)
jmp    1186 <tr_reformat_task+0x16>
mov    -0x8(%rbp),%eax
mov    0x2e0c(%rip),%rcx
cmp    (%rcx),%eax
jne    11e3 <tr_reformat_task+0x73>
mov    $0x0,%al
call   1040 <tr_reformat_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    13e6 <tr_reformat_task+0x276>
mov    -0x10(%rbp),%rax
mov    0x2dea(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
call   1080 <tr_get_fp@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1315 <tr_reformat_task+0x1a5>
jmp    120d <tr_reformat_task+0x9d>
mov    -0x20(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    122b <tr_reformat_task+0xbb>
jmp    1310 <tr_reformat_task+0x1a0>
mov    -0x20(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2d9f(%rip),%rcx
cmp    (%rcx),%eax
jne    124e <tr_reformat_task+0xde>
jmp    1310 <tr_reformat_task+0x1a0>
cmpl   $0x5c,-0x14(%rbp)
jne    1269 <tr_reformat_task+0xf9>
mov    -0x20(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x14(%rbp)
jmp    130b <tr_reformat_task+0x19b>
cmpl   $0x20,-0x14(%rbp)
je     1291 <tr_reformat_task+0x121>
cmpl   $0x9,-0x14(%rbp)
je     1291 <tr_reformat_task+0x121>
cmpl   $0xd,-0x14(%rbp)
je     1291 <tr_reformat_task+0x121>
cmpl   $0xa,-0x14(%rbp)
jne    1296 <tr_reformat_task+0x126>
jmp    120d <tr_reformat_task+0x9d>
cmpl   $0x28,-0x14(%rbp)
je     12b4 <tr_reformat_task+0x144>
cmpl   $0x2c,-0x14(%rbp)
je     12b4 <tr_reformat_task+0x144>
cmpl   $0x3b,-0x14(%rbp)
jne    12ce <tr_reformat_task+0x15e>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1301 <tr_reformat_task+0x191>
cmpl   $0x29,-0x14(%rbp)
jne    12f1 <tr_reformat_task+0x181>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x29,%edi
call   1030 <putchar@plt>
jmp    12fc <tr_reformat_task+0x18c>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1301 <tr_reformat_task+0x191>
jmp    1306 <tr_reformat_task+0x196>
jmp    130b <tr_reformat_task+0x19b>
jmp    120d <tr_reformat_task+0x9d>
jmp    13c2 <tr_reformat_task+0x252>
jmp    131a <tr_reformat_task+0x1aa>
mov    -0x20(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1338 <tr_reformat_task+0x1c8>
jmp    13b8 <tr_reformat_task+0x248>
mov    -0x20(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2c92(%rip),%rcx
cmp    (%rcx),%eax
jne    135b <tr_reformat_task+0x1eb>
jmp    13b8 <tr_reformat_task+0x248>
cmpl   $0x5c,-0x14(%rbp)
jne    1376 <tr_reformat_task+0x206>
mov    -0x20(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x14(%rbp)
jmp    13b3 <tr_reformat_task+0x243>
cmpl   $0x20,-0x14(%rbp)
je     139e <tr_reformat_task+0x22e>
cmpl   $0x9,-0x14(%rbp)
je     139e <tr_reformat_task+0x22e>
cmpl   $0xd,-0x14(%rbp)
je     139e <tr_reformat_task+0x22e>
cmpl   $0xa,-0x14(%rbp)
jne    13a3 <tr_reformat_task+0x233>
jmp    131a <tr_reformat_task+0x1aa>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    13b3 <tr_reformat_task+0x243>
jmp    131a <tr_reformat_task+0x1aa>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%rax
mov    0x2c1b(%rip),%rcx
cmp    (%rcx),%rax
je     13df <tr_reformat_task+0x26f>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_reformat_task>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%ebp
lea    0xfcc(%rip),%rdx
call   1090 <getopt@plt>
xor    %ebx,%ebx
test   %eax,%eax
js     11b8 <tr_reformat_task+0x48>
mov    $0x1,%r12d
lea    0xfb4(%rip),%r14
nopl   0x0(%rax)
cmp    $0x31,%eax
cmove  %r12d,%ebx
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1090 <getopt@plt>
test   %eax,%eax
jns    11a0 <tr_reformat_task+0x30>
mov    0x2e19(%rip),%rax
movslq (%rax),%rax
cmp    %ebp,%eax
jne    11d5 <tr_reformat_task+0x65>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <tr_reformat_usage@plt>
mov    (%r15,%rax,8),%rdi
call   1080 <tr_get_fp@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1070 <feof@plt>
test   %ebx,%ebx
je     11fd <tr_reformat_task+0x8d>
test   %eax,%eax
je     1220 <tr_reformat_task+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1201 <tr_reformat_task+0x91>
test   %eax,%eax
je     1274 <tr_reformat_task+0x104>
mov    0x2de0(%rip),%rax
cmp    (%rax),%rbp
je     1215 <tr_reformat_task+0xa5>
mov    %rbp,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2db9(%rip),%rbx
movabs $0x100002600,%r14
jmp    124c <tr_reformat_task+0xdc>
movsbl %al,%edi
call   1030 <putchar@plt>
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    11f1 <tr_reformat_task+0x81>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
cmp    (%rbx),%eax
je     11f1 <tr_reformat_task+0x81>
cmp    $0x20,%eax
ja     1265 <tr_reformat_task+0xf5>
mov    %eax,%ecx
bt     %rcx,%r14
jb     1240 <tr_reformat_task+0xd0>
cmp    $0x5c,%eax
jne    1233 <tr_reformat_task+0xc3>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
jmp    1240 <tr_reformat_task+0xd0>
mov    0x2d65(%rip),%r14
lea    0xd7e(%rip),%rbx
jmp    12a5 <tr_reformat_task+0x135>
movsbl %al,%edi
nopw   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
mov    %rbp,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    1201 <tr_reformat_task+0x91>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
cmp    (%r14),%eax
je     1201 <tr_reformat_task+0x91>
mov    %eax,%ecx
add    $0xfffffff7,%ecx
cmp    $0x53,%ecx
ja     1284 <tr_reformat_task+0x114>
movslq (%rbx,%rcx,4),%rcx
add    %rbx,%rcx
jmp    *%rcx
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
jmp    1290 <tr_reformat_task+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x29,%edi
jmp    1290 <tr_reformat_task+0x120>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
jmp    1295 <tr_reformat_task+0x125>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@optind = global i32 0
@EOF = global i32 0
@stdin = global i32* null
define i32 @tr_reformat_task(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt(i32 %10, i8** %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %6
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32, i32* %6
switch i32 %15, label %17 [
i32 49, label %16
]
16: ; preds = %14
store i32 1, i32* %7
br label %17
17: ; preds = %14, %16
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
%20 = load i32, i32* @optind
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (...) @tr_reformat_usage()
store i32 %23, i32* %3
br label %142
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = load i32, i32* @optind
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32* @tr_get_fp(i8* %29)
store i32* %30, i32** %8
%31 = load i32, i32* %7
%32 = icmp ne i32 %31, 0
br i1 %32, label %94, label %33
33: ; preds = %24
br label %34
34: ; preds = %92, %64, %33
%35 = load i32*, i32** %8
%36 = call i32 @feof(i32* %35)
%37 = icmp ne i32 %36, 0
%38 = xor i1 %37, true
br i1 %38, label %39, label %93
39: ; preds = %34
%40 = load i32*, i32** %8
%41 = call i32 @fgetc(i32* %40)
store i32 %41, i32* %6
%42 = load i32, i32* %6
%43 = load i32, i32* @EOF
%44 = icmp eq i32 %42, %43
br i1 %44, label %45, label %46
45: ; preds = %39
br label %93
46: ; preds = %39
%47 = load i32, i32* %6
%48 = icmp eq i32 %47, 92
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i32*, i32** %8
%51 = call i32 @fgetc(i32* %50)
store i32 %51, i32* %6
br label %92
52: ; preds = %46
%53 = load i32, i32* %6
%54 = icmp eq i32 %53, 32
br i1 %54, label %64, label %55
55: ; preds = %52
%56 = load i32, i32* %6
%57 = icmp eq i32 %56, 9
br i1 %57, label %64, label %58
58: ; preds = %55
%59 = load i32, i32* %6
%60 = icmp eq i32 %59, 13
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = load i32, i32* %6
%63 = icmp eq i32 %62, 10
br i1 %63, label %64, label %65
64: ; preds = %61, %58, %55, %52
br label %34
65: ; preds = %61
%66 = load i32, i32* %6
%67 = icmp eq i32 %66, 40
br i1 %67, label %74, label %68
68: ; preds = %65
%69 = load i32, i32* %6
%70 = icmp eq i32 %69, 44
br i1 %70, label %74, label %71
71: ; preds = %68
%72 = load i32, i32* %6
%73 = icmp eq i32 %72, 59
br i1 %73, label %74, label %79
74: ; preds = %71, %68, %65
%75 = load i32, i32* %6
%76 = trunc i32 %75 to i8
%77 = call i32 @putchar(i8 signext %76)
%78 = call i32 @putchar(i8 signext 10)
br label %90
79: ; preds = %71
%80 = load i32, i32* %6
%81 = icmp eq i32 %80, 41
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = call i32 @putchar(i8 signext 10)
%84 = call i32 @putchar(i8 signext 41)
br label %89
85: ; preds = %79
%86 = load i32, i32* %6
%87 = trunc i32 %86 to i8
%88 = call i32 @putchar(i8 signext %87)
br label %89
89: ; preds = %85, %82
br label %90
90: ; preds = %89, %74
br label %91
91: ; preds = %90
br label %92
92: ; preds = %91, %49
br label %34
93: ; preds = %45, %34
br label %134
94: ; preds = %24
br label %95
95: ; preds = %131, %125, %94
%96 = load i32*, i32** %8
%97 = call i32 @feof(i32* %96)
%98 = icmp ne i32 %97, 0
%99 = xor i1 %98, true
br i1 %99, label %100, label %132
100: ; preds = %95
%101 = load i32*, i32** %8
%102 = call i32 @fgetc(i32* %101)
store i32 %102, i32* %6
%103 = load i32, i32* %6
%104 = load i32, i32* @EOF
%105 = icmp eq i32 %103, %104
br i1 %105, label %106, label %107
106: ; preds = %100
br label %132
107: ; preds = %100
%108 = load i32, i32* %6
%109 = icmp eq i32 %108, 92
br i1 %109, label %110, label %113
110: ; preds = %107
%111 = load i32*, i32** %8
%112 = call i32 @fgetc(i32* %111)
store i32 %112, i32* %6
br label %131
113: ; preds = %107
%114 = load i32, i32* %6
%115 = icmp eq i32 %114, 32
br i1 %115, label %125, label %116
116: ; preds = %113
%117 = load i32, i32* %6
%118 = icmp eq i32 %117, 9
br i1 %118, label %125, label %119
119: ; preds = %116
%120 = load i32, i32* %6
%121 = icmp eq i32 %120, 13
br i1 %121, label %125, label %122
122: ; preds = %119
%123 = load i32, i32* %6
%124 = icmp eq i32 %123, 10
br i1 %124, label %125, label %126
125: ; preds = %122, %119, %116, %113
br label %95
126: ; preds = %122
%127 = load i32, i32* %6
%128 = trunc i32 %127 to i8
%129 = call i32 @putchar(i8 signext %128)
br label %130
130: ; preds = %126
br label %131
131: ; preds = %130, %110
br label %95
132: ; preds = %106, %95
%133 = call i32 @putchar(i8 signext 10)
br label %134
134: ; preds = %132, %93
%135 = load i32*, i32** %8
%136 = load i32*, i32** @stdin
%137 = icmp ne i32* %135, %136
br i1 %137, label %138, label %141
138: ; preds = %134
%139 = load i32*, i32** %8
%140 = call i32 @fclose(i32* %139)
br label %141
141: ; preds = %138, %134
store i32 0, i32* %3
br label %142
142: ; preds = %141, %22
%143 = load i32, i32* %3
ret i32 %143
}

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@optind = global i32 0
@EOF = global i32 0
@stdin = global i32* null
define i32 @tr_reformat_task(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = icmp eq i32 %6, 49
%9 = select i1 %8, i32 1, i32 %7
%10 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp sgt i32 %10, -1
br i1 %11, label %5, label %12
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %9, %5 ]
%14 = load i32, i32* @optind
%15 = icmp eq i32 %14, %0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 (...) @tr_reformat_usage()
br label %68
18: ; preds = %12
%19 = sext i32 %14 to i64
%20 = getelementptr inbounds i8*, i8** %1, i64 %19
%21 = load i8*, i8** %20
%22 = tail call i32* @tr_get_fp(i8* %21)
%23 = icmp eq i32 %13, 0
%24 = tail call i32 @feof(i32* %22)
%25 = icmp eq i32 %24, 0
br i1 %23, label %27, label %26
26: ; preds = %18
br i1 %25, label %48, label %61
27: ; preds = %18
br i1 %25, label %28, label %63
28: ; preds = %27, %45
%29 = tail call i32 @fgetc(i32* %22)
%30 = load i32, i32* @EOF
%31 = icmp eq i32 %29, %30
br i1 %31, label %63, label %32
32: ; preds = %28
switch i32 %29, label %42 [
i32 92, label %33
i32 32, label %45
i32 13, label %45
i32 10, label %45
i32 9, label %45
i32 59, label %35
i32 44, label %35
i32 40, label %35
i32 41, label %39
]
33: ; preds = %32
%34 = tail call i32 @fgetc(i32* %22)
br label %45
35: ; preds = %32, %32, %32
%36 = trunc i32 %29 to i8
%37 = tail call i32 @putchar(i8 signext %36)
%38 = tail call i32 @putchar(i8 signext 10)
br label %45
39: ; preds = %32
%40 = tail call i32 @putchar(i8 signext 10)
%41 = tail call i32 @putchar(i8 signext 41)
br label %45
42: ; preds = %32
%43 = trunc i32 %29 to i8
%44 = tail call i32 @putchar(i8 signext %43)
br label %45
45: ; preds = %33, %35, %42, %39, %32, %32, %32, %32
%46 = tail call i32 @feof(i32* %22)
%47 = icmp eq i32 %46, 0
br i1 %47, label %28, label %63
48: ; preds = %26, %58
%49 = tail call i32 @fgetc(i32* %22)
%50 = load i32, i32* @EOF
%51 = icmp eq i32 %49, %50
br i1 %51, label %61, label %52
52: ; preds = %48
switch i32 %49, label %55 [
i32 92, label %53
i32 32, label %58
i32 13, label %58
i32 10, label %58
i32 9, label %58
]
53: ; preds = %52
%54 = tail call i32 @fgetc(i32* %22)
br label %58
55: ; preds = %52
%56 = trunc i32 %49 to i8
%57 = tail call i32 @putchar(i8 signext %56)
br label %58
58: ; preds = %53, %55, %52, %52, %52, %52
%59 = tail call i32 @feof(i32* %22)
%60 = icmp eq i32 %59, 0
br i1 %60, label %48, label %61
61: ; preds = %58, %48, %26
%62 = tail call i32 @putchar(i8 signext 10)
br label %63
63: ; preds = %28, %45, %27, %61
%64 = load i32*, i32** @stdin
%65 = icmp eq i32* %22, %64
br i1 %65, label %68, label %66
66: ; preds = %63
%67 = tail call i32 @fclose(i32* %22)
br label %68
68: ; preds = %63, %66, %16
%69 = phi i32 [ %17, %16 ], [ 0, %66 ], [ 0, %63 ]
ret i32 %69
}