#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 */
scalar_t__ isspace(char);
char *get_next_token(char *buf, char **cptr) {
  static char rtoken[32];
  int i;
  i = 0;
  while (isspace(**cptr))
    (*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    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1153 <get_next_token+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1127 <get_next_token+0x17>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     1179 <get_next_token+0x69>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11a2 <get_next_token+0x92>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,0x2eb8(%rip)
movb   $0x0,0x2eb2(%rip)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    125d <get_next_token+0x14d>
jmp    11a7 <get_next_token+0x97>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x15(%rbp)
jne    120b <get_next_token+0xfb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x15(%rbp)
je     120b <get_next_token+0xfb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0x15(%rbp)
je     120b <get_next_token+0xfb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    121b <get_next_token+0x10b>
jmp    124e <get_next_token+0x13e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%dl
movslq -0x14(%rbp),%rcx
lea    0x2e11(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <get_next_token+0x97>
movslq -0x14(%rbp),%rcx
lea    0x2de7(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ddc(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_token>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rax
movsbl (%rax),%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     114a <get_next_token+0x3a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1130 <get_next_token+0x20>
mov    (%rbx),%rax
mov    (%rax),%al
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x2c,%cl
jne    116c <get_next_token+0x5c>
mov    %al,0x2ee1(%rip)
movb   $0x0,0x2edb(%rip)
addq   $0x1,(%rbx)
jmp    11d0 <get_next_token+0xc0>
movsbl %al,%edi
call   1030 <isspace@plt>
xor    %r14d,%r14d
test   %rax,%rax
jne    11c2 <get_next_token+0xb2>
lea    0x2ebd(%rip),%r15
movabs $0x300000000001,%r12
jmp    11b0 <get_next_token+0xa0>
nop
mov    %al,(%r14,%r15,1)
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
add    $0x1,%r14
movsbl 0x1(%rax),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    11c2 <get_next_token+0xb2>
mov    (%rbx),%rax
movzbl (%rax),%eax
cmp    $0x2d,%rax
ja     1190 <get_next_token+0x80>
bt     %rax,%r12
jae    1190 <get_next_token+0x80>
mov    %r14d,%eax
lea    0x2e74(%rip),%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0x2e69(%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, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %12, %2
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = call i64 @isspace(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %13
br label %6
16: ; preds = %6
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 44
br i1 %21, label %28, label %22
22: ; preds = %16
%23 = load i8**, i8*** %4
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
br i1 %27, label %28, label %35
28: ; preds = %22, %16
%29 = load i8**, i8*** %4
%30 = load i8*, i8** %29
%31 = load i8, i8* %30
store i8 %31, 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)
%32 = load i8**, i8*** %4
%33 = load i8*, i8** %32
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %32
br label %78
35: ; preds = %22
br label %36
36: ; preds = %62, %35
%37 = load i8**, i8*** %4
%38 = load i8*, i8** %37
%39 = load i8, i8* %38
%40 = call i64 @isspace(i8 signext %39)
%41 = icmp ne i64 %40, 0
br i1 %41, label %60, label %42
42: ; preds = %36
%43 = load i8**, i8*** %4
%44 = load i8*, i8** %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 45
br i1 %47, label %48, label %60
48: ; preds = %42
%49 = load i8**, i8*** %4
%50 = load i8*, i8** %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 44
br i1 %53, label %54, label %60
54: ; preds = %48
%55 = load i8**, i8*** %4
%56 = load i8*, i8** %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = icmp ne i32 %58, 0
br label %60
60: ; preds = %54, %48, %42, %36
%61 = phi i1 [ false, %48 ], [ false, %42 ], [ false, %36 ], [ %59, %54 ]
br i1 %61, label %62, label %74
62: ; preds = %60
%63 = load i8**, i8*** %4
%64 = load i8*, i8** %63
%65 = load i8, i8* %64
%66 = load i32, i32* %5
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %67
store i8 %65, i8* %68
%69 = load i8**, i8*** %4
%70 = load i8*, i8** %69
%71 = getelementptr inbounds i8, i8* %70, i32 1
store i8* %71, i8** %69
%72 = load i32, i32* %5
%73 = add nsw i32 %72, 1
store i32 %73, i32* %5
br label %36
74: ; preds = %60
%75 = load i32, i32* %5
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %76
store i8 0, i8* %77
br label %78
78: ; preds = %74, %28
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 readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2, %7
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %1
%10 = load i8, i8* %9
%11 = tail call i64 @isspace(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %2
%14 = load i8*, i8** %1
%15 = load i8, i8* %14
%16 = and i8 %15, -2
%17 = icmp eq i8 %16, 44
br i1 %17, label %21, label %18
18: ; preds = %13
%19 = tail call i64 @isspace(i8 signext %15)
%20 = icmp eq i64 %19, 0
br i1 %20, label %24, label %36
21: ; preds = %13
store i8 %15, 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** %1
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8* %23, i8** %1
br label %40
24: ; preds = %18, %28
%25 = phi i64 [ %32, %28 ], [ 0, %18 ]
%26 = load i8*, i8** %1
%27 = load i8, i8* %26
switch i8 %27, label %28 [
i8 45, label %36
i8 44, label %36
i8 0, label %36
]
28: ; preds = %24
%29 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %25
store i8 %27, i8* %29
%30 = load i8*, i8** %1
%31 = getelementptr inbounds i8, i8* %30, i64 1
store i8* %31, i8** %1
%32 = add nuw i64 %25, 1
%33 = load i8, i8* %31
%34 = tail call i64 @isspace(i8 signext %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %24, label %36
36: ; preds = %28, %24, %24, %24, %18
%37 = phi i64 [ 0, %18 ], [ %25, %24 ], [ %25, %24 ], [ %25, %24 ], [ %32, %28 ]
%38 = and i64 %37, 4294967295
%39 = getelementptr inbounds [32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 %38
store i8 0, i8* %39
br label %40
40: ; preds = %36, %21
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_next_token.rtoken, i64 0, i64 0)
}