#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 next();
int comment(void) {
  int c;
  int s;
  s = 0;
  c = next();
  while (s != 1) {
    while (c != EOF && c != '*')
      c = next();
    if (c == EOF)
      s = 1;
    else {
      c = next();
      if (c == EOF || c == '/')
        s = 1;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <next@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11cd <comment+0xbd>
jmp    1138 <comment+0x28>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2ea4(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x9(%rbp)
je     1159 <comment+0x49>
cmpl   $0x2a,-0x4(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1169 <comment+0x59>
jmp    1178 <comment+0x68>
mov    $0x0,%al
call   1030 <next@plt>
mov    %eax,-0x4(%rbp)
jmp    1138 <comment+0x28>
mov    -0x4(%rbp),%eax
mov    0x2e66(%rip),%rcx
cmp    (%rcx),%eax
jne    1196 <comment+0x86>
movl   $0x1,-0x8(%rbp)
jmp    11c8 <comment+0xb8>
mov    $0x0,%al
call   1030 <next@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e3e(%rip),%rcx
cmp    (%rcx),%eax
je     11bc <comment+0xac>
cmpl   $0x2f,-0x4(%rbp)
jne    11c3 <comment+0xb3>
movl   $0x1,-0x8(%rbp)
jmp    11c8 <comment+0xb8>
jmp    1129 <comment+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment>:
push   %rbx
xor    %eax,%eax
call   1030 <next@plt>
mov    0x2ec9(%rip),%rbx
jmp    1167 <comment+0x57>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x2a,%eax
je     1139 <comment+0x29>
cmp    %ecx,%eax
jne    1160 <comment+0x50>
cmp    %ecx,%eax
mov    %ecx,%eax
je     116b <comment+0x5b>
xor    %eax,%eax
call   1030 <next@plt>
cmp    $0x2f,%eax
je     116b <comment+0x5b>
mov    (%rbx),%ecx
cmp    %ecx,%eax
jne    1130 <comment+0x20>
jmp    116b <comment+0x5b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <next@plt>
mov    (%rbx),%ecx
jmp    1130 <comment+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @comment() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 (...) @next()
store i32 %3, i32* %1
br label %4
4: ; preds = %34, %0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %35
7: ; preds = %4
br label %8
8: ; preds = %17, %7
%9 = load i32, i32* %1
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %1
%14 = icmp ne i32 %13, 42
br label %15
15: ; preds = %12, %8
%16 = phi i1 [ false, %8 ], [ %14, %12 ]
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = call i32 (...) @next()
store i32 %18, i32* %1
br label %8
19: ; preds = %15
%20 = load i32, i32* %1
%21 = load i32, i32* @EOF
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %2
br label %34
24: ; preds = %19
%25 = call i32 (...) @next()
store i32 %25, i32* %1
%26 = load i32, i32* %1
%27 = load i32, i32* @EOF
%28 = icmp eq i32 %26, %27
br i1 %28, label %32, label %29
29: ; preds = %24
%30 = load i32, i32* %1
%31 = icmp eq i32 %30, 47
br i1 %31, label %32, label %33
32: ; preds = %29, %24
store i32 1, i32* %2
br label %33
33: ; preds = %32, %29
br label %34
34: ; preds = %33, %23
br label %4
35: ; preds = %4
%36 = load i32, i32* %1
ret i32 %36
}

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