#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 eatBlockComment();
char eatLineComment();
char getchar();
int /*<<< orphan*/ putchar(char);
char repeatCharConst();
char repeatString();
int main(int argc, char *argv[]) {
  char c, d, r = 0;
  while ((c = getchar()) != EOF) {
    switch (c) {
    case '\'':
      r = repeatCharConst();
      break;
    case '\"':
      r = repeatString();
      break;
    case '/':
      d = getchar();
      if (d == '/') {
        r = eatLineComment();
        break;
      } else if (d == '*') {
        r = eatBlockComment();
        break;
      } else if (d == EOF) {
        return 0;
      } else {
        putchar(c);
        putchar(d);
        continue;
      }
    default:
      putchar(c);
      continue;
    }
    if (r == EOF)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x13(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2e5a(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1297 <main+0x137>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x22,%eax
je     11df <main+0x7f>
jmp    11ae <main+0x4e>
mov    -0x18(%rbp),%eax
sub    $0x27,%eax
je     11d0 <main+0x70>
jmp    11bf <main+0x5f>
mov    -0x18(%rbp),%eax
sub    $0x2f,%eax
je     11ee <main+0x8e>
jmp    1269 <main+0x109>
mov    $0x0,%al
call   1070 <repeatCharConst@plt>
mov    %al,-0x13(%rbp)
jmp    1277 <main+0x117>
mov    $0x0,%al
call   1080 <repeatString@plt>
mov    %al,-0x13(%rbp)
jmp    1277 <main+0x117>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%eax
cmp    $0x2f,%eax
jne    1214 <main+0xb4>
mov    $0x0,%al
call   1040 <eatLineComment@plt>
mov    %al,-0x13(%rbp)
jmp    1277 <main+0x117>
movsbl -0x12(%rbp),%eax
cmp    $0x2a,%eax
jne    1230 <main+0xd0>
mov    $0x0,%al
call   1060 <eatBlockComment@plt>
mov    %al,-0x13(%rbp)
jmp    1277 <main+0x117>
movsbl -0x12(%rbp),%eax
mov    0x2dad(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1252 <main+0xf2>
movl   $0x0,-0x4(%rbp)
jmp    129e <main+0x13e>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x12(%rbp),%edi
call   1030 <putchar@plt>
jmp    117a <main+0x1a>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
jmp    117a <main+0x1a>
movsbl -0x13(%rbp),%eax
mov    0x2d66(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1292 <main+0x132>
jmp    1297 <main+0x137>
jmp    117a <main+0x1a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e76(%rip),%r14
cmp    (%r14),%al
jne    117e <main+0x1e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebx
jmp    11aa <main+0x4a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <repeatString@plt>
cmp    (%r14),%al
je     1177 <main+0x17>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1177 <main+0x17>
movsbl %bl,%ebp
cmp    $0x22,%ebp
je     1190 <main+0x30>
cmp    $0x2f,%ebp
je     11d0 <main+0x70>
cmp    $0x27,%ebp
jne    1203 <main+0xa3>
xor    %eax,%eax
call   1070 <repeatCharConst@plt>
jmp    1197 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x2a,%al
je     11ea <main+0x8a>
mov    %eax,%ebx
cmp    $0x2f,%al
jne    11f3 <main+0x93>
xor    %eax,%eax
call   1040 <eatLineComment@plt>
jmp    1197 <main+0x37>
xor    %eax,%eax
call   1060 <eatBlockComment@plt>
jmp    1197 <main+0x37>
cmp    (%r14),%bl
je     1177 <main+0x17>
mov    %ebp,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
jmp    119c <main+0x3c>

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %35, label %6
6: ; preds = %2, %27
%7 = phi i8 [ %28, %27 ], [ %3, %2 ]
%8 = sext i8 %7 to i32
switch i32 %8, label %24 [
i32 39, label %9
i32 34, label %11
i32 47, label %13
]
9: ; preds = %6
%10 = tail call signext i8 (...) @repeatCharConst()
br label %31
11: ; preds = %6
%12 = tail call signext i8 (...) @repeatString()
br label %31
13: ; preds = %6
%14 = tail call signext i8 (...) @getchar()
switch i8 %14, label %19 [
i8 47, label %15
i8 42, label %17
]
15: ; preds = %13
%16 = tail call signext i8 (...) @eatLineComment()
br label %31
17: ; preds = %13
%18 = tail call signext i8 (...) @eatBlockComment()
br label %31
19: ; preds = %13
%20 = load i8, i8* @EOF
%21 = icmp eq i8 %14, %20
br i1 %21, label %35, label %22
22: ; preds = %19
%23 = tail call i32 @putchar(i8 signext %7)
br label %24
24: ; preds = %6, %22
%25 = phi i8 [ %14, %22 ], [ %7, %6 ]
%26 = tail call i32 @putchar(i8 signext %25)
br label %27
27: ; preds = %24, %31
%28 = tail call signext i8 (...) @getchar()
%29 = load i8, i8* @EOF
%30 = icmp eq i8 %28, %29
br i1 %30, label %35, label %6
31: ; preds = %17, %15, %11, %9
%32 = phi i8 [ %16, %15 ], [ %18, %17 ], [ %12, %11 ], [ %10, %9 ]
%33 = load i8, i8* @EOF
%34 = icmp eq i8 %32, %33
br i1 %34, label %35, label %27
35: ; preds = %19, %31, %27, %2
ret i32 0
}