#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 */
extern __attribute__((gnu_)) char *carmen_next_word(char *str) {
  char *mark = str;
  if (str == NULL)
    return NULL;
  while (*mark != '\0' && !(*mark == ' ' || *mark == '\t'))
    mark++;
  while (*mark != '\0' && (*mark == ' ' || *mark == '\t'))
    mark++;
  return mark;
}


x86 assembly (clang, -O0):
<carmen_next_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <carmen_next_word+0x28>
movq   $0x0,-0x8(%rbp)
jmp    11fe <carmen_next_word+0xfe>
jmp    112d <carmen_next_word+0x2d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     116f <carmen_next_word+0x6f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x1a(%rbp)
je     1167 <carmen_next_word+0x67>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    117f <carmen_next_word+0x7f>
jmp    1190 <carmen_next_word+0x90>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112d <carmen_next_word+0x2d>
jmp    1195 <carmen_next_word+0x95>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1b(%rbp)
je     11d5 <carmen_next_word+0xd5>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x1c(%rbp)
je     11cf <carmen_next_word+0xcf>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x1c(%rbp)
mov    -0x1c(%rbp),%al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
test   $0x1,%al
jne    11e5 <carmen_next_word+0xe5>
jmp    11f6 <carmen_next_word+0xf6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1195 <carmen_next_word+0x95>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_next_word>:
test   %rdi,%rdi
je     1153 <carmen_next_word+0x53>
mov    %rdi,%rax
movabs $0x100000201,%rdx
jmp    1124 <carmen_next_word+0x24>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%rcx
ja     1120 <carmen_next_word+0x20>
bt     %rcx,%rdx
jae    1120 <carmen_next_word+0x20>
jmp    1148 <carmen_next_word+0x48>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x20,%cl
je     1140 <carmen_next_word+0x40>
cmp    $0x9,%cl
je     1140 <carmen_next_word+0x40>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @carmen_next_word(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %58
9: ; preds = %1
br label %10
10: ; preds = %30, %9
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 32
br i1 %19, label %25, label %20
20: ; preds = %15
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 9
br label %25
25: ; preds = %20, %15
%26 = phi i1 [ true, %15 ], [ %24, %20 ]
%27 = xor i1 %26, true
br label %28
28: ; preds = %25, %10
%29 = phi i1 [ false, %10 ], [ %27, %25 ]
br i1 %29, label %30, label %33
30: ; preds = %28
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %4
br label %10
33: ; preds = %28
br label %34
34: ; preds = %53, %33
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %51
39: ; preds = %34
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 32
br i1 %43, label %49, label %44
44: ; preds = %39
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 9
br label %49
49: ; preds = %44, %39
%50 = phi i1 [ true, %39 ], [ %48, %44 ]
br label %51
51: ; preds = %49, %34
%52 = phi i1 [ false, %34 ], [ %50, %49 ]
br i1 %52, label %53, label %56
53: ; preds = %51
%54 = load i8*, i8** %4
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %4
br label %34
56: ; preds = %51
%57 = load i8*, i8** %4
store i8* %57, i8** %2
br label %58
58: ; preds = %56, %8
%59 = load i8*, i8** %2
ret i8* %59
}

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