#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();
char peek();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  int incomment = 0;
  while ((c = getchar()) != EOF) {
    if (!incomment) {
      if ((c == '/') && (peek() == '*')) {
        incomment = 1;
      }
    } else {
      if ((c == '*') && (peek() == '/')) {
        c = getchar();
        c = getchar();
        incomment = 0;
      }
    }
    if ((c != EOF) && !incomment) {
      putchar(c);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
je     11f8 <main+0xc8>
cmpl   $0x0,-0xc(%rbp)
jne    1192 <main+0x62>
cmpl   $0x2f,-0x8(%rbp)
jne    118d <main+0x5d>
mov    $0x0,%al
call   1030 <peek@plt>
movsbl %al,%eax
cmp    $0x2a,%eax
jne    118d <main+0x5d>
movl   $0x1,-0xc(%rbp)
jmp    11cf <main+0x9f>
cmpl   $0x2a,-0x8(%rbp)
jne    11ca <main+0x9a>
mov    $0x0,%al
call   1030 <peek@plt>
movsbl %al,%eax
cmp    $0x2f,%eax
jne    11ca <main+0x9a>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    11cf <main+0x9f>
mov    -0x8(%rbp),%eax
mov    0x2e0f(%rip),%rcx
cmp    (%rcx),%eax
je     11f3 <main+0xc3>
cmpl   $0x0,-0xc(%rbp)
jne    11f3 <main+0xc3>
mov    -0x8(%rbp),%edi
call   1040 <putchar@plt>
jmp    1146 <main+0x16>
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   1050 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
jne    114e <main+0x1e>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %ebx,%ebx
jmp    116c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r14),%eax
je     1147 <main+0x17>
test   %ebx,%ebx
je     11a0 <main+0x70>
mov    $0x1,%ebx
cmp    $0x2a,%eax
jne    1160 <main+0x30>
xor    %eax,%eax
call   1030 <peek@plt>
cmp    $0x2f,%al
jne    1160 <main+0x30>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %ebx,%ebx
jmp    11c2 <main+0x92>
nopl   0x0(%rax)
xor    %ebp,%ebp
mov    $0x0,%ebx
cmp    $0x2f,%eax
jne    11c2 <main+0x92>
xor    %eax,%eax
call   1030 <peek@plt>
xor    %ebp,%ebp
cmp    $0x2a,%al
sete   %bpl
mov    $0x2f,%eax
mov    %ebp,%ebx
test   %bpl,%bpl
jne    1160 <main+0x30>
cmp    (%r14),%eax
je     1160 <main+0x30>
mov    %eax,%edi
call   1040 <putchar@plt>
jmp    1160 <main+0x30>

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

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