#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*/ *);
void consume_token(FILE *source_file, char *s) {
  int i = 0;
  int c = fgetc(source_file);
  do {
    s[i] = c;
    i = i + 1;
    c = fgetc(source_file);
  } while ((' ' != c) && ('\t' != c) && ('\n' != c) && '>' != 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)
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     119f <consume_token+0x8f>
xor    %eax,%eax
mov    $0x9,%ecx
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
je     119f <consume_token+0x8f>
xor    %eax,%eax
mov    $0xa,%ecx
cmp    -0x18(%rbp),%ecx
mov    %al,-0x19(%rbp)
je     119f <consume_token+0x8f>
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>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_token>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <fgetc@plt>
movabs $0x4000000100000600,%r15
nopw   0x0(%rax,%rax,1)
mov    %al,(%rbx)
mov    %r14,%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>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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