#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 const);
const char *find_word_break(const char *string) {
  while (string && *string && !isspace(*string))
    string++;
  return string;
}


x86 assembly (clang, -O0):
<find_word_break>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1158 <find_word_break+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1158 <find_word_break+0x48>
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    1168 <find_word_break+0x58>
jmp    1179 <find_word_break+0x69>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <find_word_break+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_word_break>:
push   %rbx
test   %rdi,%rdi
je     113a <find_word_break+0x2a>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113c <find_word_break+0x2c>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    113c <find_word_break+0x2c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <find_word_break+0x10>
jmp    113c <find_word_break+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

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