#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*/ isspace(char);
int /*<<< orphan*/ skip_whitespace(char *);
char *get_next_token(char **cptr) {
  static char rtoken[32];
  int i;
  i = 0;
  skip_whitespace(*cptr);
  if (**cptr == ',' || **cptr == '-') {
    rtoken[0] = **cptr;
    rtoken[1] = '\0';
    (*cptr)++;
  } else {
    while (!isspace(**cptr) && **cptr != '-' && **cptr != ',' &&
           **cptr != '\0') {
      rtoken[i] = **cptr;
      (*cptr)++;
      i++;
    }
    rtoken[i] = '\0';
  }
  return rtoken;
}


x86 assembly (clang, -O0):
<get_next_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <skip_whitespace@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     1165 <get_next_token+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    118e <get_next_token+0x6e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,0x2ecc(%rip)
movb   $0x0,0x2ec6(%rip)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1247 <get_next_token+0x127>
jmp    1193 <get_next_token+0x73>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    11f5 <get_next_token+0xd5>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0xd(%rbp)
je     11f5 <get_next_token+0xd5>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0xd(%rbp)
je     11f5 <get_next_token+0xd5>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1205 <get_next_token+0xe5>
jmp    1238 <get_next_token+0x118>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%dl
movslq -0xc(%rbp),%rcx
lea    0x2e27(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1193 <get_next_token+0x73>
movslq -0xc(%rbp),%rcx
lea    0x2dfd(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2df2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_token>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1040 <skip_whitespace@plt>
mov    (%r14),%rax
mov    (%rax),%al
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x2c,%cl
jne    1155 <get_next_token+0x35>
mov    %al,0x2ef8(%rip)
movb   $0x0,0x2ef2(%rip)
addq   $0x1,(%r14)
jmp    11be <get_next_token+0x9e>
movsbl %al,%edi
call   1030 <isspace@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    11b1 <get_next_token+0x91>
lea    0x2ed6(%rip),%r15
movabs $0x300000000001,%r12
jmp    119f <get_next_token+0x7f>
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%rbx,%r15,1)
mov    (%r14),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%r14)
add    $0x1,%rbx
movsbl 0x1(%rax),%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    11b1 <get_next_token+0x91>
mov    (%r14),%rax
movzbl (%rax),%eax
cmp    $0x2d,%rax
ja     1180 <get_next_token+0x60>
bt     %rax,%r12
jae    1180 <get_next_token+0x60>
mov    %ebx,%eax
lea    0x2e86(%rip),%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0x2e7b(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@get_next_token.rtoken = internal global [32 x i8] zeroinitializer
define i8* @get_next_token(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32 @skip_whitespace(i8* %5)
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 44
br i1 %11, label %18, label %12
12: ; preds = %1
%13 = load i8**, i8*** %2
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 45
br i1 %17, label %18, label %25
18: ; preds = %12, %1
%19 = load i8**, i8*** %2
%20 = load i8*, i8** %19
%21 = load i8, i8* %20
store i8 %21, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 1)
%22 = load i8**, i8*** %2
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %22
br label %68
25: ; preds = %12
br label %26
26: ; preds = %52, %25
%27 = load i8**, i8*** %2
%28 = load i8*, i8** %27
%29 = load i8, i8* %28
%30 = call i32 @isspace(i8 signext %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %50, label %32
32: ; preds = %26
%33 = load i8**, i8*** %2
%34 = load i8*, i8** %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 45
br i1 %37, label %38, label %50
38: ; preds = %32
%39 = load i8**, i8*** %2
%40 = load i8*, i8** %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 44
br i1 %43, label %44, label %50
44: ; preds = %38
%45 = load i8**, i8*** %2
%46 = load i8*, i8** %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 0
br label %50
50: ; preds = %44, %38, %32, %26
%51 = phi i1 [ false, %38 ], [ false, %32 ], [ false, %26 ], [ %49, %44 ]
br i1 %51, label %52, label %64
52: ; preds = %50
%53 = load i8**, i8*** %2
%54 = load i8*, i8** %53
%55 = load i8, i8* %54
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %57
store i8 %55, i8* %58
%59 = load i8**, i8*** %2
%60 = load i8*, i8** %59
%61 = getelementptr inbounds i8, i8* %60, i32 1
store i8* %61, i8** %59
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 1
store i32 %63, i32* %3
br label %26
64: ; preds = %50
%65 = load i32, i32* %3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %66
store i8 0, i8* %67
br label %68
68: ; preds = %64, %18
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 0)
}

LLVM IR (-O2):
@get_next_token.rtoken = internal global [32 x i8] zeroinitializer
define i8* @get_next_token(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @skip_whitespace(i8* %2)
%4 = load i8*, i8** %0
%5 = load i8, i8* %4
%6 = and i8 %5, -2
%7 = icmp eq i8 %6, 44
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = tail call i32 @isspace(i8 signext %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %26
11: ; preds = %1
store i8 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 1)
%12 = load i8*, i8** %0
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %0
br label %30
14: ; preds = %8, %18
%15 = phi i64 [ %22, %18 ], [ 0, %8 ]
%16 = load i8*, i8** %0
%17 = load i8, i8* %16
switch i8 %17, label %18 [
i8 45, label %26
i8 44, label %26
i8 0, label %26
]
18: ; preds = %14
%19 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %15
store i8 %17, i8* %19
%20 = load i8*, i8** %0
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8* %21, i8** %0
%22 = add nuw i64 %15, 1
%23 = load i8, i8* %21
%24 = tail call i32 @isspace(i8 signext %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %14, label %26
26: ; preds = %18, %14, %14, %14, %8
%27 = phi i64 [ 0, %8 ], [ %15, %14 ], [ %15, %14 ], [ %15, %14 ], [ %22, %18 ]
%28 = and i64 %27, 4294967295
%29 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %28
store i8 0, i8* %29
br label %30
30: ; preds = %26, %11
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 0)
}