#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 getchar();
int /*<<< orphan*/ inComment();
int /*<<< orphan*/ putchar(char);
void rcomment(char c) {
  int d;
  if (c == '/') {
    if ((d = getchar()) == '*') {
      inComment();
    } else if (d == '/') {
      putchar(c);
      rcomment(d);
    } else {
      putchar(c);
      putchar(d);
    }
  } else {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<rcomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
jne    11bb <rcomment+0x7b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x2a,%eax
jne    117a <rcomment+0x3a>
mov    $0x0,%al
call   1050 <inComment@plt>
jmp    11b6 <rcomment+0x76>
cmpl   $0x2f,-0x8(%rbp)
jne    119d <rcomment+0x5d>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1060 <rcomment@plt>
jmp    11b1 <rcomment+0x71>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11b6 <rcomment+0x76>
jmp    11c4 <rcomment+0x84>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcomment>:
push   %rbx
cmp    $0x2f,%dil
jne    1158 <rcomment+0x28>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x2f,%eax
jne    1162 <rcomment+0x32>
mov    $0x2f,%edi
call   1030 <putchar@plt>
jmp    1140 <rcomment+0x10>
movsbl %dil,%edi
pop    %rbx
jmp    1030 <putchar@plt>
mov    %eax,%ebx
cmp    $0x2a,%eax
jne    1171 <rcomment+0x41>
xor    %eax,%eax
pop    %rbx
jmp    1050 <inComment@plt>
mov    $0x2f,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @rcomment(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 47
br i1 %6, label %7, label %28
7: ; preds = %1
%8 = call i32 (...) @getchar()
store i32 %8, i32* %3
%9 = icmp eq i32 %8, 42
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @inComment()
br label %27
12: ; preds = %7
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 47
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i8, i8* %2
%17 = call i32 @putchar(i8 signext %16)
%18 = load i32, i32* %3
%19 = trunc i32 %18 to i8
br label %26
20: ; preds = %12
%21 = load i8, i8* %2
%22 = call i32 @putchar(i8 signext %21)
%23 = load i32, i32* %3
%24 = trunc i32 %23 to i8
%25 = call i32 @putchar(i8 signext %24)
br label %26
26: ; preds = %20, %15
br label %27
27: ; preds = %26, %10
br label %31
28: ; preds = %1
%29 = load i8, i8* %2
%30 = call i32 @putchar(i8 signext %29)
br label %31
31: ; preds = %28, %27
ret void
}

LLVM IR (-O2):
define void @rcomment(i8 signext %0) {
%2 = icmp eq i8 %0, 47
br i1 %2, label %3, label %13
3: ; preds = %1, %7
%4 = tail call i32 (...) @getchar()
switch i32 %4, label %9 [
i32 42, label %5
i32 47, label %7
]
5: ; preds = %3
%6 = tail call i32 (...) @inComment()
br label %15
7: ; preds = %3
%8 = tail call i32 @putchar(i8 signext 47)
br label %3
9: ; preds = %3
%10 = tail call i32 @putchar(i8 signext 47)
%11 = trunc i32 %4 to i8
%12 = tail call i32 @putchar(i8 signext %11)
br label %15
13: ; preds = %1
%14 = tail call i32 @putchar(i8 signext %0)
br label %15
15: ; preds = %5, %9, %13
ret void
}