#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);
void _pico_first_token(char *str) {
  if (!str || !*str)
    return;
  while (*str && !isspace(*str))
    str++;
  *str = '\0';
}


x86 assembly (clang, -O0):
<_pico_first_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <_pico_first_token+0x24>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1139 <_pico_first_token+0x29>
jmp    1192 <_pico_first_token+0x82>
jmp    113e <_pico_first_token+0x2e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     116a <_pico_first_token+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    117a <_pico_first_token+0x6a>
jmp    118b <_pico_first_token+0x7b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113e <_pico_first_token+0x2e>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pico_first_token>:
push   %rbx
test   %rdi,%rdi
je     113b <_pico_first_token+0x2b>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113b <_pico_first_token+0x2b>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <_pico_first_token+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_pico_first_token+0x10>
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @_pico_first_token(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %11
%7 = phi i8* [ %12, %11 ], [ %0, %3 ]
%8 = phi i8 [ %13, %11 ], [ %4, %3 ]
%9 = tail call i32 @isspace(i8 signext %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %11
%16 = phi i8* [ %12, %11 ], [ %7, %6 ]
store i8 0, i8* %16
br label %17
17: ; preds = %1, %3, %15
ret void
}