#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 getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  int comment;
  char a, b, c;
  for (comment = 0, a = b = '\0'; b != EOF; a = b, b = c) {
    c = getchar();
    if (b == '/' && c == '*')
      comment = 1;
    else if (a == '*' && b == '/')
      comment = 0;
    else if (!comment)
      putchar(b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movb   $0x0,-0xa(%rbp)
movb   $0x0,-0x9(%rbp)
movsbl -0xa(%rbp),%eax
mov    0x2e9f(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11dd <main+0xbd>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xb(%rbp)
movsbl -0xa(%rbp),%eax
cmp    $0x2f,%eax
jne    1184 <main+0x64>
movsbl -0xb(%rbp),%eax
cmp    $0x2a,%eax
jne    1184 <main+0x64>
movl   $0x1,-0x8(%rbp)
jmp    11c7 <main+0xa7>
movsbl -0x9(%rbp),%eax
cmp    $0x2a,%eax
jne    11aa <main+0x8a>
movsbl -0xa(%rbp),%eax
cmp    $0x2f,%eax
jne    11aa <main+0x8a>
movl   $0x0,-0x8(%rbp)
jmp    11c2 <main+0xa2>
cmpl   $0x0,-0x8(%rbp)
jne    11bd <main+0x9d>
movsbl -0xa(%rbp),%edi
call   1030 <putchar@plt>
jmp    11c2 <main+0xa2>
jmp    11c7 <main+0xa7>
jmp    11cc <main+0xac>
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
jmp    113e <main+0x1e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x2eb9(%rip),%r14
cmpb   $0x0,(%r14)
je     1183 <main+0x63>
xor    %ebx,%ebx
xor    %r15d,%r15d
xor    %ebp,%ebp
jmp    1149 <main+0x29>
xchg   %ax,%ax
xor    %eax,%eax
mov    %eax,%ebp
cmp    (%r14),%bl
je     1183 <main+0x63>
mov    %r15d,%r12d
mov    %ebx,%r15d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    $0x1,%eax
cmp    $0x2f,%r15b
jne    1168 <main+0x48>
cmp    $0x2a,%bl
je     1142 <main+0x22>
cmp    $0x2a,%r12b
jne    1174 <main+0x54>
cmp    $0x2f,%r15b
je     1140 <main+0x20>
test   %ebp,%ebp
jne    1142 <main+0x22>
movsbl %r15b,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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