#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 atoi(char *);
int get_sid(char *);
scalar_t__ isdigit(char);
void *make_symbol(int, int);
int meta_levels(char *);
void *make_token(char *word) {
  if (isdigit(*word) || ((*word == '-' || *word == '+') && isdigit(word[1])))
    return (void *)(void *)((atoi(word)) << 1 | 1);
  else {
    int metalevel = meta_levels(word);
    int id = get_sid(&(word[metalevel]));
    return make_symbol(id, metalevel);
  }
}


x86 assembly (clang, -O0):
<make_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    11a9 <make_token+0x59>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1192 <make_token+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    11c3 <make_token+0x73>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11c3 <make_token+0x73>
mov    -0x10(%rbp),%rdi
call   1070 <atoi@plt>
shl    $0x1,%eax
or     $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    11f1 <make_token+0xa1>
mov    -0x10(%rbp),%rdi
call   1050 <meta_levels@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
call   1060 <get_sid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <make_symbol@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_token>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     117b <make_token+0x2b>
mov    %rbx,%rdi
call   1070 <atoi@plt>
add    %eax,%eax
add    $0x1,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    (%rbx),%al
cmp    $0x2d,%al
je     1185 <make_token+0x35>
cmp    $0x2b,%al
jne    1193 <make_token+0x43>
movsbl 0x1(%rbx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1164 <make_token+0x14>
mov    %rbx,%rdi
call   1050 <meta_levels@plt>
movslq %eax,%r14
add    %r14,%rbx
mov    %rbx,%rdi
call   1060 <get_sid@plt>
mov    %eax,%edi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <make_symbol@plt>

LLVM IR (-O0):
define i8* @make_token(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @isdigit(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %26, label %10
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %20, label %15
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 43
br i1 %19, label %20, label %33
20: ; preds = %15, %10
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = call i64 @isdigit(i8 signext %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %20, %1
%27 = load i8*, i8** %3
%28 = call i32 @atoi(i8* %27)
%29 = shl i32 %28, 1
%30 = or i32 %29, 1
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i8*
store i8* %32, i8** %2
br label %44
33: ; preds = %20, %15
%34 = load i8*, i8** %3
%35 = call i32 @meta_levels(i8* %34)
store i32 %35, i32* %4
%36 = load i8*, i8** %3
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = call i32 @get_sid(i8* %39)
store i32 %40, i32* %5
%41 = load i32, i32* %5
%42 = load i32, i32* %4
%43 = call i8* @make_symbol(i32 %41, i32 %42)
store i8* %43, i8** %2
br label %44
44: ; preds = %33, %26
%45 = load i8*, i8** %2
ret i8* %45
}

LLVM IR (-O2):
define i8* @make_token(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8, i8* %0
switch i8 %6, label %18 [
i8 45, label %7
i8 43, label %7
]
7: ; preds = %5, %5
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = tail call i64 @isdigit(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %7, %1
%13 = tail call i32 @atoi(i8* %0)
%14 = shl i32 %13, 1
%15 = or i32 %14, 1
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
br label %24
18: ; preds = %5, %7
%19 = tail call i32 @meta_levels(i8* %0)
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %0, i64 %20
%22 = tail call i32 @get_sid(i8* %21)
%23 = tail call i8* @make_symbol(i32 %22, i32 %19)
br label %24
24: ; preds = %18, %12
%25 = phi i8* [ %17, %12 ], [ %23, %18 ]
ret i8* %25
}