#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 */
int fgetc(int /*<<< orphan*/ *);
int consume_token(FILE *source_file, char *s) {
  int i = 0;
  int c = fgetc(source_file);
  do {
    if (NULL != s)
      s[i] = c;
    i = i + 1;
    c = fgetc(source_file);
  } while ((' ' != c) && ('\t' != c) && ('\n' != c) && '>' != c);
  return c;
}


x86 assembly (clang, -O0):
<consume_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     114f <consume_token+0x3f>
mov    -0x18(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
mov    $0x20,%ecx
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
je     11ab <consume_token+0x9b>
xor    %eax,%eax
mov    $0x9,%ecx
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
je     11ab <consume_token+0x9b>
xor    %eax,%eax
mov    $0xa,%ecx
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
je     11ab <consume_token+0x9b>
mov    $0x3e,%eax
cmp    -0x18(%rbp),%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1133 <consume_token+0x23>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_token>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <fgetc@plt>
movabs $0x4000000100000600,%r15
mov    %r14,%rbx
test   %r14,%r14
je     1137 <consume_token+0x27>
mov    %al,(%rbx)
mov    %r12,%rdi
call   1030 <fgetc@plt>
add    $0x1,%rbx
cmp    $0x3e,%eax
ja     1130 <consume_token+0x20>
mov    %eax,%ecx
bt     %rcx,%r15
jae    1130 <consume_token+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @consume_token(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%7 = load i32*, i32** %3
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %6
br label %9
9: ; preds = %36, %2
%10 = load i8*, i8** %4
%11 = icmp ne i8* null, %10
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %6
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 %14, i8* %18
br label %19
19: ; preds = %12, %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
%22 = load i32*, i32** %3
%23 = call i32 @fgetc(i32* %22)
store i32 %23, i32* %6
br label %24
24: ; preds = %19
%25 = load i32, i32* %6
%26 = icmp ne i32 32, %25
br i1 %26, label %27, label %36
27: ; preds = %24
%28 = load i32, i32* %6
%29 = icmp ne i32 9, %28
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i32, i32* %6
%32 = icmp ne i32 10, %31
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32, i32* %6
%35 = icmp ne i32 62, %34
br label %36
36: ; preds = %33, %30, %27, %24
%37 = phi i1 [ false, %30 ], [ false, %27 ], [ false, %24 ], [ %35, %33 ]
br i1 %37, label %9, label %38
38: ; preds = %36
%39 = load i32, i32* %6
ret i32 %39
}

LLVM IR (-O2):
define i32 @consume_token(i32* nocapture %0, i8* writeonly %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = icmp eq i8* %1, null
br label %5
5: ; preds = %11, %2
%6 = phi i64 [ %12, %11 ], [ 0, %2 ]
%7 = phi i32 [ %13, %11 ], [ %3, %2 ]
br i1 %4, label %11, label %8
8: ; preds = %5
%9 = trunc i32 %7 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %9, i8* %10
br label %11
11: ; preds = %8, %5
%12 = add nuw i64 %6, 1
%13 = tail call i32 @fgetc(i32* %0)
switch i32 %13, label %5 [
i32 62, label %14
i32 32, label %14
i32 10, label %14
i32 9, label %14
]
14: ; preds = %11, %11, %11, %11
ret i32 %13
}