#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() {
  char prevc;
  char c;
  char nextc;
  while ((c = getchar()) != EOF) {
    if (c == '"') {
      putchar(prevc = c);
      while ((c = getchar()) != '"' || prevc == '\\') {
        putchar(prevc = c);
      }
      putchar(prevc = c);
    } else if (c == '/') {
      nextc = getchar();
      if (nextc == '/') {
        while ((c = getchar()) != '\n')
          ;
        putchar('\n');
      } else if (nextc == '*') {
        prevc = getchar();
        while ((c = getchar()) != '/' || prevc != '*') {
          prevc = c;
        }
      } else {
        putchar(c);
        putchar(prevc = nextc);
      }
    } else {
      putchar(prevc = c);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     12b2 <main+0x192>
movsbl -0x6(%rbp),%eax
cmp    $0x22,%eax
jne    11c7 <main+0xa7>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x22,%ecx
mov    %al,-0x8(%rbp)
jne    1191 <main+0x71>
movsbl -0x5(%rbp),%eax
cmp    $0x5c,%eax
sete   %al
mov    %al,-0x8(%rbp)
mov    -0x8(%rbp),%al
test   $0x1,%al
jne    11a1 <main+0x81>
jmp    11b4 <main+0x94>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1169 <main+0x49>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    12ad <main+0x18d>
movsbl -0x6(%rbp),%eax
cmp    $0x2f,%eax
jne    129a <main+0x17a>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x7(%rbp)
movsbl -0x7(%rbp),%eax
cmp    $0x2f,%eax
jne    121a <main+0xfa>
jmp    11f0 <main+0xd0>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     120b <main+0xeb>
jmp    11f0 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1295 <main+0x175>
movsbl -0x7(%rbp),%eax
cmp    $0x2a,%eax
jne    1279 <main+0x159>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x9(%rbp)
jne    1259 <main+0x139>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1269 <main+0x149>
jmp    1274 <main+0x154>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
jmp    1231 <main+0x111>
jmp    1290 <main+0x170>
movsbl -0x6(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x7(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1295 <main+0x175>
jmp    12a8 <main+0x188>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    12ad <main+0x18d>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
jne    113e <main+0x1e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebx
jmp    1166 <main+0x46>
mov    $0x2f,%edi
call   1030 <putchar@plt>
nopl   0x0(%rax)
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1137 <main+0x17>
cmp    $0x2f,%bl
je     11b0 <main+0x90>
cmp    $0x22,%bl
jne    1150 <main+0x30>
mov    $0x22,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0x22,%bl
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x22,%al
je     1150 <main+0x30>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x5c,%bpl
jne    1190 <main+0x70>
jmp    1194 <main+0x74>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x2a,%al
je     11e2 <main+0xc2>
mov    %eax,%ebx
cmp    $0x2f,%al
jne    1142 <main+0x22>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    11d0 <main+0xb0>
mov    $0xa,%bl
jmp    1150 <main+0x30>
xor    %eax,%eax
call   1040 <getchar@plt>
nopl   0x0(%rax)
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x2a,%bl
jne    11f0 <main+0xd0>
cmp    $0x2f,%al
jne    11f0 <main+0xd0>
jmp    1158 <main+0x38>

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

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 %39, label %4
4: ; preds = %0, %35
%5 = phi i8 [ %36, %35 ], [ %1, %0 ]
switch i8 %5, label %32 [
i8 34, label %6
i8 47, label %17
]
6: ; preds = %4
%7 = tail call i32 @putchar(i8 signext 34)
%8 = tail call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 34
br i1 %9, label %32, label %10
10: ; preds = %6, %10
%11 = phi i8 [ %13, %10 ], [ %8, %6 ]
%12 = tail call i32 @putchar(i8 signext %11)
%13 = tail call signext i8 (...) @getchar()
%14 = icmp ne i8 %13, 34
%15 = icmp eq i8 %11, 92
%16 = or i1 %15, %14
br i1 %16, label %10, label %32
17: ; preds = %4
%18 = tail call signext i8 (...) @getchar()
switch i8 %18, label %30 [
i8 47, label %19
i8 42, label %22
]
19: ; preds = %17, %19
%20 = tail call signext i8 (...) @getchar()
%21 = icmp eq i8 %20, 10
br i1 %21, label %32, label %19
22: ; preds = %17
%23 = tail call signext i8 (...) @getchar()
br label %24
24: ; preds = %24, %22
%25 = phi i8 [ %23, %22 ], [ %26, %24 ]
%26 = tail call signext i8 (...) @getchar()
%27 = icmp ne i8 %26, 47
%28 = icmp ne i8 %25, 42
%29 = or i1 %28, %27
br i1 %29, label %24, label %35
30: ; preds = %17
%31 = tail call i32 @putchar(i8 signext 47)
br label %32
32: ; preds = %19, %10, %4, %6, %30
%33 = phi i8 [ %18, %30 ], [ 34, %6 ], [ %5, %4 ], [ 34, %10 ], [ 10, %19 ]
%34 = tail call i32 @putchar(i8 signext %33)
br label %35
35: ; preds = %24, %32
%36 = tail call signext i8 (...) @getchar()
%37 = load i8, i8* @EOF
%38 = icmp eq i8 %36, %37
br i1 %38, label %39, label %4
39: ; preds = %35, %0
ret i32 0
}