#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__ strchr(char const *, char const);
const char *str_find_word_start(const char *string, const char *pos,
                                const char *delimiters) {
  if (string == NULL || pos < string || delimiters == NULL) {
    return NULL;
  }
  while (--pos && pos > string) {
    if (strchr(delimiters, pos[0]) != 0 && pos[-1] != '\\') {
      return pos + 1;
    }
  }
  return string;
}


x86 assembly (clang, -O0):
<str_find_word_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <str_find_word_start+0x38>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1148 <str_find_word_start+0x38>
cmpq   $0x0,-0x20(%rbp)
jne    1155 <str_find_word_start+0x45>
movq   $0x0,-0x8(%rbp)
jmp    11dc <str_find_word_start+0xcc>
jmp    115a <str_find_word_start+0x4a>
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x21(%rbp)
je     1183 <str_find_word_start+0x73>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1193 <str_find_word_start+0x83>
jmp    11d4 <str_find_word_start+0xc4>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11cf <str_find_word_start+0xbf>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x5c,%eax
je     11cf <str_find_word_start+0xbf>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11dc <str_find_word_start+0xcc>
jmp    115a <str_find_word_start+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_find_word_start>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1168 <str_find_word_start+0x58>
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
cmp    %rdi,%rsi
jb     116a <str_find_word_start+0x5a>
mov    %rdx,%r15
test   %rdx,%rdx
je     116a <str_find_word_start+0x5a>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
ja     1149 <str_find_word_start+0x39>
mov    %r14,%rax
jmp    116a <str_find_word_start+0x5a>
nopl   (%rax)
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jbe    1138 <str_find_word_start+0x28>
movsbl (%rbx),%esi
mov    %r15,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     1140 <str_find_word_start+0x30>
cmpb   $0x5c,-0x1(%rbx)
je     1140 <str_find_word_start+0x30>
add    $0x1,%rbx
mov    %rbx,%rax
jmp    116a <str_find_word_start+0x5a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @str_find_word_start(i8* readnone %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %25, label %5
5: ; preds = %3
%6 = icmp ult i8* %1, %0
%7 = icmp eq i8* %2, null
%8 = or i1 %6, %7
br i1 %8, label %25, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %1, i64 -1
%11 = icmp ugt i8* %10, %0
br i1 %11, label %12, label %25
12: ; preds = %9, %22
%13 = phi i8* [ %23, %22 ], [ %10, %9 ]
%14 = phi i8* [ %13, %22 ], [ %1, %9 ]
%15 = load i8, i8* %13
%16 = tail call i64 @strchr(i8* %2, i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %12
%19 = getelementptr inbounds i8, i8* %14, i64 -2
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 92
br i1 %21, label %22, label %25
22: ; preds = %18, %12
%23 = getelementptr inbounds i8, i8* %13, i64 -1
%24 = icmp ugt i8* %23, %0
br i1 %24, label %12, label %25
25: ; preds = %18, %22, %9, %3, %5
%26 = phi i8* [ null, %5 ], [ null, %3 ], [ %0, %9 ], [ %14, %18 ], [ %0, %22 ]
ret i8* %26
}