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


x86 assembly (clang, -O0):
<rcomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2f,-0x4(%rbp)
jne    11bd <rcomment+0x6d>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x2a,%eax
jne    1184 <rcomment+0x34>
mov    $0x0,%al
call   1040 <in_comment@plt>
jmp    11b8 <rcomment+0x68>
cmpl   $0x2f,-0x8(%rbp)
jne    11a3 <rcomment+0x53>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1060 <rcomment@plt>
jmp    11b3 <rcomment+0x63>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    11b8 <rcomment+0x68>
jmp    11eb <rcomment+0x9b>
cmpl   $0x27,-0x4(%rbp)
je     11d1 <rcomment+0x81>
cmpl   $0x22,-0x4(%rbp)
jne    11de <rcomment+0x8e>
mov    -0x4(%rbp),%edi
call   1070 <echo_quote@plt>
jmp    11e6 <rcomment+0x96>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    11eb <rcomment+0x9b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcomment>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2f,%ebx
jne    1170 <rcomment+0x30>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x2f,%eax
jne    1182 <rcomment+0x42>
mov    $0x2f,%ebx
mov    $0x2f,%edi
call   1030 <putchar@plt>
cmp    $0x2f,%ebx
je     1150 <rcomment+0x10>
cmp    $0x22,%ebx
je     117a <rcomment+0x3a>
cmp    $0x27,%ebx
jne    119b <rcomment+0x5b>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <echo_quote@plt>
mov    %eax,%ebx
cmp    $0x2a,%eax
jne    1191 <rcomment+0x51>
xor    %eax,%eax
pop    %rbx
jmp    1040 <in_comment@plt>
mov    $0x2f,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @rcomment(i32 %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i32 [ %0, %1 ], [ 47, %8 ]
switch i32 %3, label %15 [
i32 47, label %4
i32 39, label %13
i32 34, label %13
]
4: ; preds = %2
%5 = tail call i32 (...) @getchar()
switch i32 %5, label %10 [
i32 42, label %6
i32 47, label %8
]
6: ; preds = %4
%7 = tail call i32 (...) @in_comment()
br label %17
8: ; preds = %4
%9 = tail call i32 @putchar(i32 47)
br label %2
10: ; preds = %4
%11 = tail call i32 @putchar(i32 47)
%12 = tail call i32 @putchar(i32 %5)
br label %17
13: ; preds = %2, %2
%14 = tail call i32 @echo_quote(i32 %3)
br label %17
15: ; preds = %2
%16 = tail call i32 @putchar(i32 %3)
br label %17
17: ; preds = %13, %15, %6, %10
ret void
}