#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 */
#define EOF 128
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int get();
char peek();
int /*<<< orphan*/ stderr;
int next() {
  int c = get();
  if (c == '/') {
    switch (peek()) {
    case '/':
      for (;;) {
        c = get();
        if (c <= '\n') {
          return c;
        }
      }
    case '*':
      get();
      for (;;) {
        switch (get()) {
        case '*':
          if (peek() == '/') {
            get();
            return ' ';
          }
          break;
        case EOF:
          fprintf(stderr, "Error: JSMIN Unterminated comment.\n");
          exit(1);
        }
      }
    default:
      return c;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2f,-0x8(%rbp)
jne    123f <next+0xff>
xor    %eax,%eax
call   1030 <peek@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     11b1 <next+0x71>
jmp    1177 <next+0x37>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
jne    1234 <next+0xf4>
jmp    1188 <next+0x48>
jmp    118d <next+0x4d>
mov    $0x0,%al
call   1050 <get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     11ac <next+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1245 <next+0x105>
jmp    118d <next+0x4d>
mov    $0x0,%al
call   1050 <get@plt>
xor    %eax,%eax
call   1050 <get@plt>
mov    %eax,%ecx
mov    %ecx,-0x10(%rbp)
sub    $0x2a,%eax
je     11e5 <next+0xa5>
jmp    11d2 <next+0x92>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     1210 <next+0xd0>
jmp    122f <next+0xef>
mov    $0x0,%al
call   1030 <peek@plt>
movsbl %al,%eax
cmp    $0x2f,%eax
jne    120b <next+0xcb>
mov    $0x0,%al
call   1050 <get@plt>
movl   $0x20,-0x4(%rbp)
jmp    1245 <next+0x105>
jmp    122f <next+0xef>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
lea    0xde0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
jmp    11b8 <next+0x78>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1245 <next+0x105>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
push   %rax
xor    %eax,%eax
call   1050 <get@plt>
cmp    $0x2f,%eax
jne    117c <next+0x3c>
xor    %eax,%eax
call   1030 <peek@plt>
movsbl %al,%ecx
cmp    $0x2a,%ecx
je     117e <next+0x3e>
mov    $0x2f,%eax
cmp    $0x2f,%ecx
jne    117c <next+0x3c>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <get@plt>
cmp    $0xb,%eax
jge    1170 <next+0x30>
pop    %rcx
ret
xor    %eax,%eax
call   1050 <get@plt>
jmp    1197 <next+0x57>
nopw   0x0(%rax,%rax,1)
cmp    $0x80,%eax
je     11bc <next+0x7c>
xor    %eax,%eax
call   1050 <get@plt>
cmp    $0x2a,%eax
jne    1190 <next+0x50>
xor    %eax,%eax
call   1030 <peek@plt>
cmp    $0x2f,%al
jne    1197 <next+0x57>
xor    %eax,%eax
call   1050 <get@plt>
mov    $0x20,%eax
pop    %rcx
ret
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Error: JSMIN Unterminated comment.\0A\00"
define i32 @next() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @get()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 47
br i1 %5, label %6, label %35
6: ; preds = %0
%7 = call signext i8 (...) @peek()
%8 = sext i8 %7 to i32
switch i32 %8, label %33 [
i32 47, label %9
i32 42, label %17
]
9: ; preds = %6
br label %10
10: ; preds = %16, %9
%11 = call i32 (...) @get()
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 10
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %2
store i32 %15, i32* %1
br label %37
16: ; preds = %10
br label %10
17: ; preds = %6
%18 = call i32 (...) @get()
br label %19
19: ; preds = %32, %17
%20 = call i32 (...) @get()
switch i32 %20, label %32 [
i32 42, label %21
i32 128, label %28
]
21: ; preds = %19
%22 = call signext i8 (...) @peek()
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 47
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (...) @get()
store i32 32, i32* %1
br label %37
27: ; preds = %21
br label %32
28: ; preds = %19
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %19, %27
br label %19
33: ; preds = %6
%34 = load i32, i32* %2
store i32 %34, i32* %1
br label %37
35: ; preds = %0
%36 = load i32, i32* %2
store i32 %36, i32* %1
br label %37
37: ; preds = %35, %33, %25, %14
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Error: JSMIN Unterminated comment.\0A\00"
define i32 @next() {
%1 = tail call i32 (...) @get()
%2 = icmp eq i32 %1, 47
br i1 %2, label %3, label %23
3: ; preds = %0
%4 = tail call signext i8 (...) @peek()
%5 = sext i8 %4 to i32
switch i32 %5, label %23 [
i32 47, label %6
i32 42, label %9
]
6: ; preds = %3, %6
%7 = tail call i32 (...) @get()
%8 = icmp slt i32 %7, 11
br i1 %8, label %23, label %6
9: ; preds = %3
%10 = tail call i32 (...) @get()
br label %11
11: ; preds = %16, %9
%12 = tail call i32 (...) @get()
switch i32 %12, label %16 [
i32 42, label %13
i32 128, label %19
]
13: ; preds = %11
%14 = tail call signext i8 (...) @peek()
%15 = icmp eq i8 %14, 47
br i1 %15, label %17, label %16
16: ; preds = %13, %11
br label %11
17: ; preds = %13
%18 = tail call i32 (...) @get()
br label %23
19: ; preds = %11
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %6, %0, %3, %17
%24 = phi i32 [ 32, %17 ], [ 47, %3 ], [ %1, %0 ], [ %7, %6 ]
ret i32 %24
}