#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 getchar();
int /*<<< orphan*/ inside_comment(int *);
int /*<<< orphan*/ inside_string(int *);
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  while (c = getchar(), c != EOF) {
    if (c != '/')
      putchar(c);
    if (c == '/')
      inside_comment(&c);
    if (c == '"')
      inside_string(&c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     11a8 <main+0x68>
cmpl   $0x2f,-0x8(%rbp)
je     117d <main+0x3d>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x2f,-0x8(%rbp)
jne    1190 <main+0x50>
lea    -0x8(%rbp),%rdi
call   1040 <inside_comment@plt>
cmpl   $0x22,-0x8(%rbp)
jne    11a3 <main+0x63>
lea    -0x8(%rbp),%rdi
call   1060 <inside_string@plt>
jmp    114f <main+0xf>
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    %eax,0x4(%rsp)
mov    0x2e92(%rip),%r14
cmp    (%r14),%eax
jne    1165 <main+0x25>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0x4(%rsp),%rbx
jmp    1180 <main+0x40>
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,0x4(%rsp)
cmp    (%r14),%eax
je     115b <main+0x1b>
cmp    $0x2f,%eax
je     1195 <main+0x55>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    0x4(%rsp),%eax
cmp    $0x2f,%eax
jne    11a1 <main+0x61>
mov    %rbx,%rdi
call   1040 <inside_comment@plt>
mov    0x4(%rsp),%eax
cmp    $0x22,%eax
jne    1170 <main+0x30>
mov    %rbx,%rdi
call   1060 <inside_string@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %24, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %25
8: ; preds = %3
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 47
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = call i32 @putchar(i32 %12)
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 47
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @inside_comment(i32* %2)
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 34
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @inside_string(i32* %2)
br label %24
24: ; preds = %22, %19
br label %3
25: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %25, label %6
6: ; preds = %0, %21
%7 = phi i32 [ %22, %21 ], [ %3, %0 ]
%8 = icmp eq i32 %7, 47
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = call i32 @putchar(i32 %7)
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 47
br i1 %12, label %13, label %16
13: ; preds = %6, %9
%14 = call i32 @inside_comment(i32* %1)
%15 = load i32, i32* %1
br label %16
16: ; preds = %13, %9
%17 = phi i32 [ %15, %13 ], [ %11, %9 ]
%18 = icmp eq i32 %17, 34
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @inside_string(i32* %1)
br label %21
21: ; preds = %19, %16
%22 = call i32 (...) @getchar()
store i32 %22, i32* %1
%23 = load i32, i32* @EOF
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %6
25: ; preds = %21, %0
ret i32 0
}