#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 */
int /*<<< orphan*/ strcpy(char *, char *);
unsigned int strlen(char const *);
scalar_t__ strncmp(char const *, char *, int);
char *strpbrk(char const *, char *);
int is_token_number(const char *token) {
  char num_set[25] = "0123456789_";
  char *result;
  if (strncmp(token, "-", 1) == 0)
    token += 1;
  else if (strncmp(token, "+", 1) == 0)
    token += 1;
  if (strncmp(token, "0b", 2) == 0) {
    token += 2;
    strcpy(num_set, "01_");
  } else if (strncmp(token, "0o", 2) == 0) {
    token += 2;
    strcpy(num_set, "01234567_");
  } else if (strncmp(token, "0d", 2) == 0) {
    token += 2;
  } else if (strncmp(token, "0x", 2) == 0) {
    token += 2;
    strcpy(num_set, "0123456789AaBbCcDdEeFf_");
  }
  result = strpbrk(token, num_set);
  unsigned int i = 0;
  while (result != NULL) {
    i++;
    result = strpbrk(result + 1, num_set);
  }
  return i != 0 && i == strlen(token);
}


x86 assembly (clang, -O0):
<is_token_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea5(%rip),%al
mov    %al,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11a6 <is_token_number+0x66>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11d6 <is_token_number+0x96>
mov    -0x8(%rbp),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11d1 <is_token_number+0x91>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11d6 <is_token_number+0x96>
mov    -0x8(%rbp),%rdi
lea    0xe3c(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1216 <is_token_number+0xd6>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe14(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12d0 <is_token_number+0x190>
mov    -0x8(%rbp),%rdi
lea    0xe03(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1256 <is_token_number+0x116>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xddb(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12cb <is_token_number+0x18b>
mov    -0x8(%rbp),%rdi
lea    0xdd0(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1286 <is_token_number+0x146>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    12c6 <is_token_number+0x186>
mov    -0x8(%rbp),%rdi
lea    0xda3(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12c1 <is_token_number+0x181>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xd7b(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12c6 <is_token_number+0x186>
jmp    12cb <is_token_number+0x18b>
jmp    12d0 <is_token_number+0x190>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strpbrk@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1316 <is_token_number+0x1d6>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x1,%rdi
lea    -0x30(%rbp),%rsi
call   1060 <strpbrk@plt>
mov    %rax,-0x38(%rbp)
jmp    12e8 <is_token_number+0x1a8>
xor    %eax,%eax
cmpl   $0x0,-0x3c(%rbp)
mov    %al,-0x3d(%rbp)
je     1341 <is_token_number+0x201>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_token_number>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%r14
movups 0xeb7(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeb0(%rip),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1196 <is_token_number+0x56>
lea    0xe9c(%rip),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
jmp    119b <is_token_number+0x5b>
mov    $0x1,%ecx
add    %rcx,%r14
lea    0xe78(%rip),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1213 <is_token_number+0xd3>
lea    0xe66(%rip),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1220 <is_token_number+0xe0>
lea    0xe5a(%rip),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1289 <is_token_number+0x149>
lea    0xe40(%rip),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1233 <is_token_number+0xf3>
add    $0x2,%r14
lea    0xe26(%rip),%rsi
jmp    122b <is_token_number+0xeb>
add    $0x2,%r14
lea    0xe02(%rip),%rsi
jmp    122b <is_token_number+0xeb>
add    $0x2,%r14
lea    0xdfc(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcpy@plt>
mov    %rsp,%rsi
mov    %r14,%rdi
call   1060 <strpbrk@plt>
test   %rax,%rax
je     127e <is_token_number+0x13e>
xor    %ebp,%ebp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0x1,%rax
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <strpbrk@plt>
test   %rax,%rax
jne    1250 <is_token_number+0x110>
test   %ebp,%ebp
je     127e <is_token_number+0x13e>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
sete   %al
jmp    1280 <is_token_number+0x140>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
add    $0x2,%r14
jmp    1233 <is_token_number+0xf3>

LLVM IR (-O0):
@__const.is_token_number.num_set = [25 x i8] c"0123456789_\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [3 x i8] c"0b\00"
@.str.3 = [4 x i8] c"01_\00"
@.str.4 = [3 x i8] c"0o\00"
@.str.5 = [10 x i8] c"01234567_\00"
@.str.6 = [3 x i8] c"0d\00"
@.str.7 = [3 x i8] c"0x\00"
@.str.8 = [24 x i8] c"0123456789AaBbCcDdEeFf_\00"
define i32 @is_token_number(i8* %0) {
%2 = alloca i8*
%3 = alloca [25 x i8]
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = bitcast [25 x i8]* %3 to i8*
%7 = load i8*, i8** %2
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %2
br label %21
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i64 @strncmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8* %19, i8** %2
br label %20
20: ; preds = %17, %13
br label %21
21: ; preds = %20, %10
%22 = load i8*, i8** %2
%23 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8* %27, i8** %2
%28 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %58
30: ; preds = %21
%31 = load i8*, i8** %2
%32 = call i64 @strncmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %30
%35 = load i8*, i8** %2
%36 = getelementptr inbounds i8, i8* %35, i64 2
store i8* %36, i8** %2
%37 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%38 = call i32 @strcpy(i8* %37, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %57
39: ; preds = %30
%40 = load i8*, i8** %2
%41 = call i64 @strncmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %39
%44 = load i8*, i8** %2
%45 = getelementptr inbounds i8, i8* %44, i64 2
store i8* %45, i8** %2
br label %56
46: ; preds = %39
%47 = load i8*, i8** %2
%48 = call i64 @strncmp(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %46
%51 = load i8*, i8** %2
%52 = getelementptr inbounds i8, i8* %51, i64 2
store i8* %52, i8** %2
%53 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%54 = call i32 @strcpy(i8* %53, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
br label %55
55: ; preds = %50, %46
br label %56
56: ; preds = %55, %43
br label %57
57: ; preds = %56, %34
br label %58
58: ; preds = %57, %25
%59 = load i8*, i8** %2
%60 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%61 = call i8* @strpbrk(i8* %59, i8* %60)
store i8* %61, i8** %4
store i32 0, i32* %5
br label %62
62: ; preds = %65, %58
%63 = load i8*, i8** %4
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %72
65: ; preds = %62
%66 = load i32, i32* %5
%67 = add i32 %66, 1
store i32 %67, i32* %5
%68 = load i8*, i8** %4
%69 = getelementptr inbounds i8, i8* %68, i64 1
%70 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%71 = call i8* @strpbrk(i8* %69, i8* %70)
store i8* %71, i8** %4
br label %62
72: ; preds = %62
%73 = load i32, i32* %5
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %80
75: ; preds = %72
%76 = load i32, i32* %5
%77 = load i8*, i8** %2
%78 = call i32 @strlen(i8* %77)
%79 = icmp eq i32 %76, %78
br label %80
80: ; preds = %75, %72
%81 = phi i1 [ false, %72 ], [ %79, %75 ]
%82 = zext i1 %81 to i32
ret i32 %82
}

LLVM IR (-O2):
@__const.is_token_number.num_set = [25 x i8] c"0123456789_\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [3 x i8] c"0b\00"
@.str.3 = [4 x i8] c"01_\00"
@.str.4 = [3 x i8] c"0o\00"
@.str.5 = [10 x i8] c"01234567_\00"
@.str.6 = [3 x i8] c"0d\00"
@.str.7 = [3 x i8] c"0x\00"
@.str.8 = [24 x i8] c"0123456789AaBbCcDdEeFf_\00"
define i32 @is_token_number(i8* %0) {
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
br label %10
10: ; preds = %1, %6
%11 = phi i64 [ %9, %6 ], [ 1, %1 ]
%12 = getelementptr i8, i8* %0, i64 %11
%13 = tail call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = getelementptr inbounds i8, i8* %12, i64 2
%17 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %35
18: ; preds = %10
%19 = tail call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = getelementptr inbounds i8, i8* %12, i64 2
%23 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %35
24: ; preds = %18
%25 = tail call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = getelementptr inbounds i8, i8* %12, i64 2
br label %35
29: ; preds = %24
%30 = tail call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = getelementptr inbounds i8, i8* %12, i64 2
%34 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
br label %35
35: ; preds = %21, %29, %32, %27, %15
%36 = phi i8* [ %16, %15 ], [ %22, %21 ], [ %28, %27 ], [ %33, %32 ], [ %12, %29 ]
%37 = call i8* @strpbrk(i8* %36, i8* %3)
%38 = icmp eq i8* %37, null
br i1 %38, label %52, label %39
39: ; preds = %35, %39
%40 = phi i32 [ %42, %39 ], [ 0, %35 ]
%41 = phi i8* [ %44, %39 ], [ %37, %35 ]
%42 = add i32 %40, 1
%43 = getelementptr inbounds i8, i8* %41, i64 1
%44 = call i8* @strpbrk(i8* %43, i8* %3)
%45 = icmp eq i8* %44, null
br i1 %45, label %46, label %39
46: ; preds = %39
%47 = icmp eq i32 %42, 0
br i1 %47, label %52, label %48
48: ; preds = %46
%49 = call i32 @strlen(i8* %36)
%50 = icmp eq i32 %42, %49
%51 = zext i1 %50 to i32
br label %52
52: ; preds = %35, %48, %46
%53 = phi i32 [ 0, %46 ], [ %51, %48 ], [ 0, %35 ]
ret i32 %53
}