#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*/ *strchr(char *, char);
int strlen(char *);
int skipWordForwards(char *string, int position) {
  char separators[] = " .,?";
  int i;
  for (i = position;
       i <= strlen(string) && strchr(separators, string[i]) == NULL; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<skipWordForwards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
jg     1187 <skipWordForwards+0x67>
lea    -0x11(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1197 <skipWordForwards+0x77>
jmp    11aa <skipWordForwards+0x8a>
jmp    119c <skipWordForwards+0x7c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1147 <skipWordForwards+0x27>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipWordForwards>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
mov    %rdi,%r14
movb   $0x0,0x4(%rsp)
movl   $0x3f2c2e20,(%rsp)
call   1030 <strlen@plt>
cmp    %r12d,%eax
jl     117d <skipWordForwards+0x5d>
movslq %r12d,%rbx
mov    %rsp,%r15
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1040 <strchr@plt>
test   %rax,%rax
jne    117a <skipWordForwards+0x5a>
lea    0x1(%rbx),%r12
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
mov    %r12,%rbx
jl     1150 <skipWordForwards+0x30>
jmp    117d <skipWordForwards+0x5d>
mov    %rbx,%r12
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.skipWordForwards.separators = [5 x i8] c" .,?\00"
define i32 @skipWordForwards(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [5 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast [5 x i8]* %5 to i8*
%8 = load i32, i32* %4
store i32 %8, i32* %6
br label %9
9: ; preds = %26, %2
%10 = load i32, i32* %6
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %23
14: ; preds = %9
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%16 = load i8*, i8** %3
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = call i32* @strchr(i8* %15, i8 signext %20)
%22 = icmp eq i32* %21, null
br label %23
23: ; preds = %14, %9
%24 = phi i1 [ false, %9 ], [ %22, %14 ]
br i1 %24, label %25, label %29
25: ; preds = %23
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %9
29: ; preds = %23
%30 = load i32, i32* %6
ret i32 %30
}

LLVM IR (-O2):
@__const.skipWordForwards.separators = [5 x i8] c" .,?\00"
define i32 @skipWordForwards(i8* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %0)
%6 = icmp slt i32 %5, %1
br i1 %6, label %23, label %7
7: ; preds = %2
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %7, %15
%10 = phi i64 [ %8, %7 ], [ %16, %15 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = call i32* @strchr(i8* %4, i8 signext %12)
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = add nsw i64 %10, 1
%17 = call i32 @strlen(i8* %0)
%18 = sext i32 %17 to i64
%19 = icmp slt i64 %10, %18
br i1 %19, label %9, label %20
20: ; preds = %15, %9
%21 = phi i64 [ %10, %9 ], [ %16, %15 ]
%22 = trunc i64 %21 to i32
br label %23
23: ; preds = %20, %2
%24 = phi i32 [ %1, %2 ], [ %22, %20 ]
ret i32 %24
}