#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 */
char *skip_initial_spaces(char *);
char *next_token(char *sptr) {
  if (!sptr) {
    return NULL;
  }
  while ((*sptr != ' ') && (*sptr != '\t')) {
    if (!(*sptr)) {
      return NULL;
    }
    sptr++;
  }
  return skip_initial_spaces(sptr);
}


x86 assembly (clang, -O0):
<next_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <next_token+0x24>
movq   $0x0,-0x8(%rbp)
jmp    11a6 <next_token+0x96>
jmp    1139 <next_token+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     115e <next_token+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116e <next_token+0x5e>
jmp    1199 <next_token+0x89>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1188 <next_token+0x78>
movq   $0x0,-0x8(%rbp)
jmp    11a6 <next_token+0x96>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <next_token+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <skip_initial_spaces@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_token>:
test   %rdi,%rdi
je     1135 <next_token+0x25>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%eax
test   %al,%al
je     1135 <next_token+0x25>
cmp    $0x9,%al
je     1138 <next_token+0x28>
cmp    $0x20,%al
je     1138 <next_token+0x28>
add    $0x1,%rdi
jmp    1120 <next_token+0x10>
xor    %eax,%eax
ret
jmp    1030 <skip_initial_spaces@plt>

LLVM IR (-O0):
define i8* @next_token(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %31
7: ; preds = %1
br label %8
8: ; preds = %25, %7
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 32
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 9
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ false, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %28
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = icmp ne i8 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20
store i8* null, i8** %2
br label %31
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %8
28: ; preds = %18
%29 = load i8*, i8** %3
%30 = call i8* @skip_initial_spaces(i8* %29)
store i8* %30, i8** %2
br label %31
31: ; preds = %28, %24, %6
%32 = load i8*, i8** %2
ret i8* %32
}

LLVM IR (-O2):
define i8* @next_token(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 32, label %8
i8 9, label %8
i8 0, label %10
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3
%9 = tail call i8* @skip_initial_spaces(i8* %4)
br label %10
10: ; preds = %3, %1, %8
%11 = phi i8* [ %9, %8 ], [ null, %1 ], [ null, %3 ]
ret i8* %11
}