#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;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ loge(char *);
char nextChar();
int /*<<< orphan*/ pushBackChar(char);
void skipComment() {
  char c;
  while ((c = nextChar()) != EOF) {
    if (c == '*') {
      c = nextChar();
      if (c == '/')
        return;
      else
        pushBackChar(c);
    }
  }
  loge("Cannot find end of comment until EOF");
  exit(1);
}


x86 assembly (clang, -O0):
<skipComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <nextChar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
mov    0x2e8c(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11a4 <skipComment+0x64>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
jne    119f <skipComment+0x5f>
mov    $0x0,%al
call   1040 <nextChar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
jne    1191 <skipComment+0x51>
add    $0x10,%rsp
pop    %rbp
ret
movsbl -0x1(%rbp),%edi
call   1030 <pushBackChar@plt>
jmp    119f <skipComment+0x5f>
jmp    1148 <skipComment+0x8>
lea    0xe55(%rip),%rdi
call   1050 <loge@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<skipComment>:
push   %rbx
xor    %eax,%eax
call   1040 <nextChar@plt>
mov    0x2e99(%rip),%rbx
jmp    1167 <skipComment+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <nextChar@plt>
cmp    (%rbx),%al
je     1186 <skipComment+0x46>
cmp    $0x2a,%al
jne    1160 <skipComment+0x20>
xor    %eax,%eax
call   1040 <nextChar@plt>
cmp    $0x2f,%al
je     1184 <skipComment+0x44>
movsbl %al,%edi
call   1030 <pushBackChar@plt>
jmp    1160 <skipComment+0x20>
pop    %rbx
ret
lea    0xe73(%rip),%rdi
call   1050 <loge@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EOF = global i8 0
@.str = [37 x i8] c"Cannot find end of comment until EOF\00"
define void @skipComment() {
%1 = alloca i8
br label %2
2: ; preds = %22, %0
%3 = call signext i8 (...) @nextChar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = load i8, i8* @EOF
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %23
8: ; preds = %2
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = call signext i8 (...) @nextChar()
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 47
br i1 %16, label %17, label %18
17: ; preds = %12
ret void
18: ; preds = %12
%19 = load i8, i8* %1
%20 = call i32 @pushBackChar(i8 signext %19)
br label %21
21: ; preds = %18
br label %22
22: ; preds = %21, %8
br label %2
23: ; preds = %2
%24 = call i32 @loge(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%25 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [37 x i8] c"Cannot find end of comment until EOF\00"
define void @skipComment() {
%1 = tail call signext i8 (...) @nextChar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %17, label %4
4: ; preds = %0, %13
%5 = phi i8 [ %14, %13 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 42
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = tail call signext i8 (...) @nextChar()
%9 = icmp eq i8 %8, 47
br i1 %9, label %10, label %11
10: ; preds = %7
ret void
11: ; preds = %7
%12 = tail call i32 @pushBackChar(i8 signext %8)
br label %13
13: ; preds = %11, %4
%14 = tail call signext i8 (...) @nextChar()
%15 = load i8, i8* @EOF
%16 = icmp eq i8 %14, %15
br i1 %16, label %17, label %4
17: ; preds = %13, %0
%18 = tail call i32 @loge(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
}