#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;
int /*<<< orphan*/ consume_char_const();
int /*<<< orphan*/ consume_comment();
int /*<<< orphan*/ consume_quoted_string();
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char c, n;
  while ((c = getchar()) != EOF) {
    if (c == '"') {
      putchar(c);
      consume_quoted_string();
    } else if (c == '\'') {
      putchar(c);
      consume_char_const();
    } else {
      if (c == '/') {
        n = getchar();
        if (n == '*') {
          consume_comment();
        } else {
          putchar(c);
          putchar(n);
        }
      } else {
        putchar(c);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e75(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1221 <main+0xd1>
movsbl -0x5(%rbp),%eax
cmp    $0x22,%eax
jne    11a0 <main+0x50>
movsbl -0x5(%rbp),%edi
call   1050 <putchar@plt>
mov    $0x0,%al
call   1040 <consume_quoted_string@plt>
jmp    121c <main+0xcc>
movsbl -0x5(%rbp),%eax
cmp    $0x27,%eax
jne    11c2 <main+0x72>
movsbl -0x5(%rbp),%edi
call   1050 <putchar@plt>
mov    $0x0,%al
call   1060 <consume_char_const@plt>
jmp    1217 <main+0xc7>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    1209 <main+0xb9>
mov    $0x0,%al
call   1070 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x2a,%eax
jne    11f2 <main+0xa2>
mov    $0x0,%al
call   1030 <consume_comment@plt>
jmp    1204 <main+0xb4>
movsbl -0x5(%rbp),%edi
call   1050 <putchar@plt>
movsbl -0x6(%rbp),%edi
call   1050 <putchar@plt>
jmp    1212 <main+0xc2>
movsbl -0x5(%rbp),%edi
call   1050 <putchar@plt>
jmp    1217 <main+0xc7>
jmp    121c <main+0xcc>
jmp    115f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <getchar@plt>
mov    0x2e86(%rip),%r14
jmp    1188 <main+0x38>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x27,%edi
call   1050 <putchar@plt>
xor    %eax,%eax
call   1060 <consume_char_const@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    (%r14),%al
je     11eb <main+0x9b>
cmp    $0x2f,%al
je     11b0 <main+0x60>
cmp    $0x27,%al
je     1170 <main+0x20>
cmp    $0x22,%al
jne    11d0 <main+0x80>
mov    $0x22,%edi
call   1050 <putchar@plt>
xor    %eax,%eax
call   1040 <consume_quoted_string@plt>
jmp    1181 <main+0x31>
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0x2a,%al
jne    11d5 <main+0x85>
xor    %eax,%eax
call   1030 <consume_comment@plt>
jmp    1181 <main+0x31>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
jmp    11e4 <main+0x94>
mov    %eax,%ebx
mov    $0x2f,%edi
call   1050 <putchar@plt>
movsbl %bl,%edi
call   1050 <putchar@plt>
jmp    1181 <main+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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 %26, label %4
4: ; preds = %0, %22
%5 = phi i8 [ %23, %22 ], [ %1, %0 ]
switch i8 %5, label %20 [
i8 34, label %6
i8 39, label %9
i8 47, label %12
]
6: ; preds = %4
%7 = tail call i32 @putchar(i8 signext 34)
%8 = tail call i32 (...) @consume_quoted_string()
br label %22
9: ; preds = %4
%10 = tail call i32 @putchar(i8 signext 39)
%11 = tail call i32 (...) @consume_char_const()
br label %22
12: ; preds = %4
%13 = tail call signext i8 (...) @getchar()
%14 = icmp eq i8 %13, 42
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 (...) @consume_comment()
br label %22
17: ; preds = %12
%18 = tail call i32 @putchar(i8 signext 47)
%19 = tail call i32 @putchar(i8 signext %13)
br label %22
20: ; preds = %4
%21 = tail call i32 @putchar(i8 signext %5)
br label %22
22: ; preds = %9, %15, %17, %20, %6
%23 = tail call signext i8 (...) @getchar()
%24 = load i8, i8* @EOF
%25 = icmp eq i8 %23, %24
br i1 %25, label %26, label %4
26: ; preds = %22, %0
ret i32 0
}