#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ strchr(char *, char);
char next_token_char(FILE *f) {
  char c;
  for (c = fgetc(f); c != EOF; c = fgetc(f)) {
    if (c == ';') {
      for (c = fgetc(f); c != EOF && c != '\n'; c = fgetc(f)) {
        ;
      }
    } else if (!strchr(" \t\n", c)) {
      break;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<next_token_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11f3 <next_token_char+0xd3>
movsbl -0x9(%rbp),%eax
cmp    $0x3b,%eax
jne    11ba <next_token_char+0x9a>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    0x2e76(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
je     118f <next_token_char+0x6f>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    119f <next_token_char+0x7f>
jmp    11b5 <next_token_char+0x95>
jmp    11a4 <next_token_char+0x84>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x9(%rbp)
jmp    1167 <next_token_char+0x47>
jmp    11dd <next_token_char+0xbd>
lea    0xe3f(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    11d8 <next_token_char+0xb8>
jmp    11f3 <next_token_char+0xd3>
jmp    11dd <next_token_char+0xbd>
jmp    11e2 <next_token_char+0xc2>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x9(%rbp)
jmp    1138 <next_token_char+0x18>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_token_char>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <fgetc@plt>
mov    %eax,%ebp
mov    0x2eb0(%rip),%r15
cmp    (%r15),%al
jne    114a <next_token_char+0x2a>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xeaf(%rip),%r14
jmp    117f <next_token_char+0x5f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bpl,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %eax,%eax
je     113d <next_token_char+0x1d>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    %eax,%ebp
cmp    (%r15),%al
je     113d <next_token_char+0x1d>
cmp    $0x3b,%bpl
jne    1160 <next_token_char+0x40>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    $0xa,%al
je     1170 <next_token_char+0x50>
cmp    (%r15),%al
jne    1190 <next_token_char+0x70>
jmp    1170 <next_token_char+0x50>

LLVM IR (-O0):
@EOF = global i8 0
@.str = [4 x i8] c" \09\0A\00"
define signext i8 @next_token_char(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
store i8 %5, i8* %3
br label %6
6: ; preds = %43, %1
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %46
12: ; preds = %6
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 59
br i1 %15, label %16, label %36
16: ; preds = %12
%17 = load i32*, i32** %2
%18 = call signext i8 @fgetc(i32* %17)
store i8 %18, i8* %3
br label %19
19: ; preds = %32, %16
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = load i8, i8* @EOF
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %21, %23
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 10
br label %29
29: ; preds = %25, %19
%30 = phi i1 [ false, %19 ], [ %28, %25 ]
br i1 %30, label %31, label %35
31: ; preds = %29
br label %32
32: ; preds = %31
%33 = load i32*, i32** %2
%34 = call signext i8 @fgetc(i32* %33)
store i8 %34, i8* %3
br label %19
35: ; preds = %29
br label %42
36: ; preds = %12
%37 = load i8, i8* %3
%38 = call i32 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %37)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %36
br label %46
41: ; preds = %36
br label %42
42: ; preds = %41, %35
br label %43
43: ; preds = %42
%44 = load i32*, i32** %2
%45 = call signext i8 @fgetc(i32* %44)
store i8 %45, i8* %3
br label %6
46: ; preds = %40, %6
%47 = load i8, i8* %3
ret i8 %47
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [4 x i8] c" \09\0A\00"
define signext i8 @next_token_char(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = load i8, i8* @EOF
%4 = icmp eq i8 %2, %3
br i1 %4, label %27, label %5
5: ; preds = %1, %23
%6 = phi i8 [ %24, %23 ], [ %2, %1 ]
%7 = icmp eq i8 %6, 59
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = tail call signext i8 @fgetc(i32* %0)
%10 = load i8, i8* @EOF
%11 = icmp ne i8 %9, %10
%12 = icmp ne i8 %9, 10
%13 = and i1 %12, %11
br i1 %13, label %14, label %23
14: ; preds = %8, %14
%15 = tail call signext i8 @fgetc(i32* %0)
%16 = load i8, i8* @EOF
%17 = icmp ne i8 %15, %16
%18 = icmp ne i8 %15, 10
%19 = and i1 %18, %17
br i1 %19, label %14, label %23
20: ; preds = %5
%21 = tail call i32 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%22 = icmp eq i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %14, %8, %20
%24 = tail call signext i8 @fgetc(i32* %0)
%25 = load i8, i8* @EOF
%26 = icmp eq i8 %24, %25
br i1 %26, label %27, label %5
27: ; preds = %23, %20, %1
%28 = phi i8 [ %2, %1 ], [ %6, %20 ], [ %24, %23 ]
ret i8 %28
}