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

/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main(void) {
  char c;
  int state_bak;
  int state;
  state = 0;
  while ((c = getchar()) != EOF) {
    switch (state) {
    case 0:
      state_bak = 0;
      if (c == '/') {
        state = 2;
      } else if (c == '\\') {
        state = 1;
        putchar(c);
      } else if (c == '\'') {
        state = 6;
        putchar(c);
      } else if (c == '"') {
        state = 8;
        putchar(c);
      } else {
        putchar(c);
      }
      break;
    case 1:
      state = state_bak;
      putchar(c);
      break;
    case 6:
      state_bak = 6;
      putchar(c);
      if (c == '\'')
        state = 0;
      else if (c == '\\')
        state = 1;
      else
        state = 7;
      break;
    case 7:
      state = 0;
      putchar(c);
      break;
    case 2:
      if (c == '*') {
        state = 4;
      } else if (c == '/') {
        state = 5;
      } else {
        state = 0;
        putchar('/');
        putchar(c);
      }
      break;
    case 4:
      if (c == '*')
        state = 3;
      break;
    case 5:
      if (c == '\n') {
        state = 0;
        putchar(c);
      }
      break;
    case 3:
      if (c == '/')
        state = 0;
      else
        state = 4;
      break;
    case 8:
      state_bak = 8;
      putchar(c);
      if (c == '\\')
        state = 1;
      else if (c == '"' || c == '\n')
        state = 0;
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     13a8 <main+0x288>
mov    -0x10(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x8,%rax
ja     13a3 <main+0x283>
mov    -0x18(%rbp),%rax
lea    0xe8f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    119a <main+0x7a>
movl   $0x2,-0x10(%rbp)
jmp    1218 <main+0xf8>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    11bc <main+0x9c>
movl   $0x1,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    1213 <main+0xf3>
movsbl -0x5(%rbp),%eax
cmp    $0x27,%eax
jne    11de <main+0xbe>
movl   $0x6,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    120e <main+0xee>
movsbl -0x5(%rbp),%eax
cmp    $0x22,%eax
jne    1200 <main+0xe0>
movl   $0x8,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    1209 <main+0xe9>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    120e <main+0xee>
jmp    1213 <main+0xf3>
jmp    1218 <main+0xf8>
jmp    13a3 <main+0x283>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    13a3 <main+0x283>
movl   $0x6,-0xc(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x27,%eax
jne    125a <main+0x13a>
movl   $0x0,-0x10(%rbp)
jmp    127f <main+0x15f>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    1273 <main+0x153>
movl   $0x1,-0x10(%rbp)
jmp    127a <main+0x15a>
movl   $0x7,-0x10(%rbp)
jmp    127f <main+0x15f>
jmp    13a3 <main+0x283>
movl   $0x0,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    13a3 <main+0x283>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
jne    12b2 <main+0x192>
movl   $0x4,-0x10(%rbp)
jmp    12ea <main+0x1ca>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    12cb <main+0x1ab>
movl   $0x5,-0x10(%rbp)
jmp    12e5 <main+0x1c5>
movl   $0x0,-0x10(%rbp)
mov    $0x2f,%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    12ea <main+0x1ca>
jmp    13a3 <main+0x283>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
jne    1303 <main+0x1e3>
movl   $0x3,-0x10(%rbp)
jmp    13a3 <main+0x283>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1325 <main+0x205>
movl   $0x0,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    13a3 <main+0x283>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    1343 <main+0x223>
movl   $0x0,-0x10(%rbp)
jmp    134a <main+0x22a>
movl   $0x4,-0x10(%rbp)
jmp    13a3 <main+0x283>
movl   $0x8,-0xc(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
jne    1378 <main+0x258>
movl   $0x1,-0x10(%rbp)
jmp    139e <main+0x27e>
movsbl -0x5(%rbp),%eax
cmp    $0x22,%eax
je     1392 <main+0x272>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1399 <main+0x279>
movl   $0x0,-0x10(%rbp)
jmp    139e <main+0x27e>
jmp    13a3 <main+0x283>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb2(%rip),%r14
cmp    (%r14),%al
jne    1146 <main+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebx
lea    0xeb1(%rip),%r15
xor    %ebp,%ebp
jmp    116e <main+0x4e>
xor    %ebp,%ebp
cmp    $0x2f,%bl
setne  %bpl
shl    $0x2,%ebp
nop
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     113b <main+0x1b>
cmp    $0x8,%ebp
ja     1160 <main+0x40>
mov    %ebp,%eax
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %r12d,%r12d
cmp    $0x2e,%bl
jg     1254 <main+0x134>
cmp    $0x22,%bl
je     1295 <main+0x175>
cmp    $0x27,%bl
jne    12b3 <main+0x193>
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    $0x6,%ebp
jmp    1160 <main+0x40>
movsbl %bl,%edi
call   1030 <putchar@plt>
mov    %r12d,%ebp
jmp    1160 <main+0x40>
cmp    $0x2a,%bl
je     1272 <main+0x152>
cmp    $0x2f,%bl
jne    127c <main+0x15c>
mov    $0x5,%ebp
jmp    1160 <main+0x40>
movsbl %bl,%edi
call   1030 <putchar@plt>
mov    $0x6,%r12d
cmp    $0x27,%bl
je     128e <main+0x16e>
cmp    $0x5c,%bl
je     124a <main+0x12a>
mov    $0x7,%ebp
jmp    1160 <main+0x40>
xor    %eax,%eax
cmp    $0x2a,%bl
sete   %al
mov    $0x4,%ebp
sub    %eax,%ebp
jmp    1160 <main+0x40>
mov    $0x5,%ebp
cmp    $0xa,%bl
jne    1160 <main+0x40>
mov    $0xa,%edi
jmp    1289 <main+0x169>
movsbl %bl,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    $0x8,%r12d
cmp    $0xa,%bpl
je     128e <main+0x16e>
cmp    $0x5c,%bl
je     124a <main+0x12a>
cmp    $0x22,%bl
je     128e <main+0x16e>
mov    $0x8,%r12d
jmp    129f <main+0x17f>
mov    $0x1,%ebp
jmp    1160 <main+0x40>
cmp    $0x2f,%bl
je     12a9 <main+0x189>
cmp    $0x5c,%bl
jne    12b3 <main+0x193>
mov    $0x5c,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebp
jmp    1160 <main+0x40>
mov    $0x4,%ebp
jmp    1160 <main+0x40>
mov    $0x2f,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
jmp    1160 <main+0x40>
mov    $0x22,%edi
call   1030 <putchar@plt>
mov    $0x8,%ebp
jmp    1160 <main+0x40>
mov    $0x2,%ebp
jmp    1160 <main+0x40>
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %r12d,%r12d
xor    %ebp,%ebp
jmp    1160 <main+0x40>

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %123, %0
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
%7 = sext i8 %6 to i32
%8 = load i8, i8* @EOF
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %7, %9
br i1 %10, label %11, label %124
11: ; preds = %5
%12 = load i32, i32* %4
switch i32 %12, label %123 [
i32 0, label %13
i32 1, label %46
i32 6, label %50
i32 7, label %65
i32 2, label %68
i32 4, label %84
i32 5, label %90
i32 3, label %98
i32 8, label %105
]
13: ; preds = %11
store i32 0, i32* %3
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 47
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %4
br label %45
18: ; preds = %13
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 92
br i1 %21, label %22, label %25
22: ; preds = %18
store i32 1, i32* %4
%23 = load i8, i8* %2
%24 = call i32 @putchar(i8 signext %23)
br label %44
25: ; preds = %18
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 39
br i1 %28, label %29, label %32
29: ; preds = %25
store i32 6, i32* %4
%30 = load i8, i8* %2
%31 = call i32 @putchar(i8 signext %30)
br label %43
32: ; preds = %25
%33 = load i8, i8* %2
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 34
br i1 %35, label %36, label %39
36: ; preds = %32
store i32 8, i32* %4
%37 = load i8, i8* %2
%38 = call i32 @putchar(i8 signext %37)
br label %42
39: ; preds = %32
%40 = load i8, i8* %2
%41 = call i32 @putchar(i8 signext %40)
br label %42
42: ; preds = %39, %36
br label %43
43: ; preds = %42, %29
br label %44
44: ; preds = %43, %22
br label %45
45: ; preds = %44, %17
br label %123
46: ; preds = %11
%47 = load i32, i32* %3
store i32 %47, i32* %4
%48 = load i8, i8* %2
%49 = call i32 @putchar(i8 signext %48)
br label %123
50: ; preds = %11
store i32 6, i32* %3
%51 = load i8, i8* %2
%52 = call i32 @putchar(i8 signext %51)
%53 = load i8, i8* %2
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 39
br i1 %55, label %56, label %57
56: ; preds = %50
store i32 0, i32* %4
br label %64
57: ; preds = %50
%58 = load i8, i8* %2
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 92
br i1 %60, label %61, label %62
61: ; preds = %57
store i32 1, i32* %4
br label %63
62: ; preds = %57
store i32 7, i32* %4
br label %63
63: ; preds = %62, %61
br label %64
64: ; preds = %63, %56
br label %123
65: ; preds = %11
store i32 0, i32* %4
%66 = load i8, i8* %2
%67 = call i32 @putchar(i8 signext %66)
br label %123
68: ; preds = %11
%69 = load i8, i8* %2
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 42
br i1 %71, label %72, label %73
72: ; preds = %68
store i32 4, i32* %4
br label %83
73: ; preds = %68
%74 = load i8, i8* %2
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 47
br i1 %76, label %77, label %78
77: ; preds = %73
store i32 5, i32* %4
br label %82
78: ; preds = %73
store i32 0, i32* %4
%79 = call i32 @putchar(i8 signext 47)
%80 = load i8, i8* %2
%81 = call i32 @putchar(i8 signext %80)
br label %82
82: ; preds = %78, %77
br label %83
83: ; preds = %82, %72
br label %123
84: ; preds = %11
%85 = load i8, i8* %2
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 42
br i1 %87, label %88, label %89
88: ; preds = %84
store i32 3, i32* %4
br label %89
89: ; preds = %88, %84
br label %123
90: ; preds = %11
%91 = load i8, i8* %2
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 10
br i1 %93, label %94, label %97
94: ; preds = %90
store i32 0, i32* %4
%95 = load i8, i8* %2
%96 = call i32 @putchar(i8 signext %95)
br label %97
97: ; preds = %94, %90
br label %123
98: ; preds = %11
%99 = load i8, i8* %2
%100 = sext i8 %99 to i32
%101 = icmp eq i32 %100, 47
br i1 %101, label %102, label %103
102: ; preds = %98
store i32 0, i32* %4
br label %104
103: ; preds = %98
store i32 4, i32* %4
br label %104
104: ; preds = %103, %102
br label %123
105: ; preds = %11
store i32 8, i32* %3
%106 = load i8, i8* %2
%107 = call i32 @putchar(i8 signext %106)
%108 = load i8, i8* %2
%109 = sext i8 %108 to i32
%110 = icmp eq i32 %109, 92
br i1 %110, label %111, label %112
111: ; preds = %105
store i32 1, i32* %4
br label %122
112: ; preds = %105
%113 = load i8, i8* %2
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 34
br i1 %115, label %120, label %116
116: ; preds = %112
%117 = load i8, i8* %2
%118 = sext i8 %117 to i32
%119 = icmp eq i32 %118, 10
br i1 %119, label %120, label %121
120: ; preds = %116, %112
store i32 0, i32* %4
br label %121
121: ; preds = %120, %116
br label %122
122: ; preds = %121, %111
br label %123
123: ; preds = %11, %122, %104, %97, %89, %83, %65, %64, %46, %45
br label %5
124: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %50, label %4
4: ; preds = %0, %44
%5 = phi i8 [ %47, %44 ], [ %1, %0 ]
%6 = phi i32 [ %46, %44 ], [ 0, %0 ]
%7 = phi i32 [ %45, %44 ], [ undef, %0 ]
switch i32 %6, label %44 [
i32 0, label %8
i32 1, label %17
i32 6, label %19
i32 7, label %23
i32 2, label %25
i32 4, label %30
i32 5, label %33
i32 3, label %37
i32 8, label %40
]
8: ; preds = %4
switch i8 %5, label %15 [
i8 47, label %44
i8 92, label %9
i8 39, label %11
i8 34, label %13
]
9: ; preds = %8
%10 = tail call i32 @putchar(i8 signext 92)
br label %44
11: ; preds = %8
%12 = tail call i32 @putchar(i8 signext 39)
br label %44
13: ; preds = %8
%14 = tail call i32 @putchar(i8 signext 34)
br label %44
15: ; preds = %8
%16 = tail call i32 @putchar(i8 signext %5)
br label %44
17: ; preds = %4
%18 = tail call i32 @putchar(i8 signext %5)
br label %44
19: ; preds = %4
%20 = tail call i32 @putchar(i8 signext %5)
switch i8 %5, label %22 [
i8 39, label %44
i8 92, label %21
]
21: ; preds = %19
br label %44
22: ; preds = %19
br label %44
23: ; preds = %4
%24 = tail call i32 @putchar(i8 signext %5)
br label %44
25: ; preds = %4
switch i8 %5, label %27 [
i8 42, label %44
i8 47, label %26
]
26: ; preds = %25
br label %44
27: ; preds = %25
%28 = tail call i32 @putchar(i8 signext 47)
%29 = tail call i32 @putchar(i8 signext %5)
br label %44
30: ; preds = %4
%31 = icmp eq i8 %5, 42
%32 = select i1 %31, i32 3, i32 4
br label %44
33: ; preds = %4
%34 = icmp eq i8 %5, 10
br i1 %34, label %35, label %44
35: ; preds = %33
%36 = tail call i32 @putchar(i8 signext 10)
br label %44
37: ; preds = %4
%38 = icmp eq i8 %5, 47
%39 = select i1 %38, i32 0, i32 4
br label %44
40: ; preds = %4
%41 = tail call i32 @putchar(i8 signext %5)
switch i8 %5, label %43 [
i8 92, label %44
i8 34, label %42
i8 10, label %42
]
42: ; preds = %40, %40
br label %44
43: ; preds = %40
br label %44
44: ; preds = %40, %43, %30, %37, %25, %19, %8, %42, %33, %35, %27, %26, %22, %21, %11, %15, %13, %9, %4, %23, %17
%45 = phi i32 [ %7, %4 ], [ 8, %42 ], [ %7, %35 ], [ %7, %33 ], [ %7, %26 ], [ %7, %27 ], [ %7, %23 ], [ 6, %21 ], [ 6, %22 ], [ %7, %17 ], [ 0, %9 ], [ 0, %11 ], [ 0, %13 ], [ 0, %15 ], [ 0, %8 ], [ 6, %19 ], [ %7, %25 ], [ %7, %30 ], [ %7, %37 ], [ 8, %40 ], [ 8, %43 ]
%46 = phi i32 [ %6, %4 ], [ 0, %42 ], [ 0, %35 ], [ 5, %33 ], [ 5, %26 ], [ 0, %27 ], [ 0, %23 ], [ 1, %21 ], [ 7, %22 ], [ %7, %17 ], [ 1, %9 ], [ 6, %11 ], [ 8, %13 ], [ 0, %15 ], [ 2, %8 ], [ 0, %19 ], [ 4, %25 ], [ %32, %30 ], [ %39, %37 ], [ 1, %40 ], [ 8, %43 ]
%47 = tail call signext i8 (...) @getchar()
%48 = load i8, i8* @EOF
%49 = icmp eq i8 %47, %48
br i1 %49, label %50, label %4
50: ; preds = %44, %0
ret i32 0
}