#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 */
int EOF;
int comment();
int getchar();
int /*<<< orphan*/ putchar(int);
int quote(int);
int main() {
  int b;
  int c;
  b = 0;
  c = getchar();
  while (c != EOF) {
    if (c == '\'' || c == '"')
      c = quote(c);
    else if (c == '/') {
      if ((c = getchar()) != EOF) {
        if (c == '*')
          c = comment();
        else {
          b = c;
          putchar('/');
        }
      }
    } else
      putchar(c);
    if (b != 0) {
      c = b;
      b = 0;
    } else if (c != EOF)
      c = getchar();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%eax
je     123b <main+0xfb>
cmpl   $0x27,-0xc(%rbp)
je     1186 <main+0x46>
cmpl   $0x22,-0xc(%rbp)
jne    1196 <main+0x56>
mov    -0xc(%rbp),%edi
call   1060 <quote@plt>
mov    %eax,-0xc(%rbp)
jmp    11f9 <main+0xb9>
cmpl   $0x2f,-0xc(%rbp)
jne    11ec <main+0xac>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e37(%rip),%rcx
cmp    (%rcx),%eax
je     11e7 <main+0xa7>
cmpl   $0x2a,-0xc(%rbp)
jne    11d2 <main+0x92>
mov    $0x0,%al
call   1040 <comment@plt>
mov    %eax,-0xc(%rbp)
jmp    11e2 <main+0xa2>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x2f,%edi
call   1030 <putchar@plt>
jmp    11e7 <main+0xa7>
jmp    11f4 <main+0xb4>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    11f9 <main+0xb9>
cmpl   $0x0,-0x8(%rbp)
je     1215 <main+0xd5>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    1236 <main+0xf6>
mov    -0xc(%rbp),%eax
mov    0x2dc9(%rip),%rcx
cmp    (%rcx),%eax
je     1231 <main+0xf1>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0xc(%rbp)
jmp    1236 <main+0xf6>
jmp    1160 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e96(%rip),%r14
cmp    (%r14),%eax
jne    1161 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1185 <main+0x45>
mov    $0x2f,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
je     11e7 <main+0xa7>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    (%r14),%ebx
je     1157 <main+0x17>
cmp    $0x22,%ebx
je     1194 <main+0x54>
cmp    $0x2f,%ebx
je     11b0 <main+0x70>
cmp    $0x27,%ebx
jne    11d0 <main+0x90>
mov    %ebx,%edi
call   1060 <quote@plt>
mov    %eax,%ebx
cmp    (%r14),%ebx
je     1180 <main+0x40>
jmp    11dc <main+0x9c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     11d7 <main+0x97>
cmp    $0x2a,%ebx
jne    1165 <main+0x25>
xor    %eax,%eax
call   1040 <comment@plt>
jmp    119b <main+0x5b>
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
cmp    (%r14),%ebx
je     1180 <main+0x40>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
jmp    1180 <main+0x40>
xor    %ebx,%ebx
cmp    (%r14),%ebx
je     1180 <main+0x40>
jmp    11dc <main+0x9c>

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

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