#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 */
struct pdb_node_types_t {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
struct pdb_node_types_t *pdb_get_type_info_ctok(char *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
struct pdb_node_types_t *is_closing_tok(FILE *fptr, char byte) {
  char stok[3];
  char *tok = stok;
  *tok = '\0';
  if (!((byte == ' ') || (byte == '\t'))) {
    *tok = byte;
    ++tok;
  }
  {
    *tok = fgetc(fptr);
    ungetc(*tok, fptr);
  };
  if (!((*tok == ' ') || (*tok == '\t')) && (*tok != '\n'))
    ++tok;
  *tok = '\0';
  return pdb_get_type_info_ctok(stok);
}


x86 assembly (clang, -O0):
<is_closing_tok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     1180 <is_closing_tok+0x50>
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
je     1180 <is_closing_tok+0x50>
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     11df <is_closing_tok+0xaf>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     11df <is_closing_tok+0xaf>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11df <is_closing_tok+0xaf>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
lea    -0xc(%rbp),%rdi
call   1050 <pdb_get_type_info_ctok@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_closing_tok>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x5(%rsp),%rbx
movb   $0x0,0x5(%rsp)
cmp    $0x9,%sil
je     1157 <is_closing_tok+0x27>
cmp    $0x20,%sil
je     1157 <is_closing_tok+0x27>
mov    %sil,0x5(%rsp)
lea    0x6(%rsp),%rbx
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %al,(%rbx)
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <ungetc@plt>
movzbl (%rbx),%eax
cmp    $0x20,%rax
ja     1185 <is_closing_tok+0x55>
movabs $0x100000600,%rcx
bt     %rax,%rcx
jb     1189 <is_closing_tok+0x59>
add    $0x1,%rbx
movb   $0x0,(%rbx)
lea    0x5(%rsp),%rdi
call   1050 <pdb_get_type_info_ctok@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.pdb_node_types_t = type { i32 }
define %struct.pdb_node_types_t* @is_closing_tok(i32* nocapture %0, i8 signext %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
switch i8 %1, label %5 [
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
store i8 %1, i8* %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
br label %7
7: ; preds = %2, %2, %5
%8 = phi i8* [ %4, %2 ], [ %6, %5 ], [ %4, %2 ]
%9 = tail call signext i8 @fgetc(i32* %0)
store i8 %9, i8* %8
%10 = tail call i32 @ungetc(i8 signext %9, i32* %0)
%11 = load i8, i8* %8
switch i8 %11, label %12 [
i8 32, label %14
i8 9, label %14
i8 10, label %14
]
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
br label %14
14: ; preds = %7, %7, %7, %12
%15 = phi i8* [ %8, %7 ], [ %13, %12 ], [ %8, %7 ], [ %8, %7 ]
store i8 0, i8* %15
%16 = call %struct.pdb_node_types_t* @pdb_get_type_info_ctok(i8* %4)
ret %struct.pdb_node_types_t* %16
}