#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 strcspn(char *, char const *);
int strspn(char *, char const *);
char *skip(char **buf, const char *delimiters) {
  char *p, *begin_word, *end_word, *end_delimiters;
  begin_word = *buf;
  end_word = begin_word + strcspn(begin_word, delimiters);
  end_delimiters = end_word + strspn(end_word, delimiters);
  for (p = end_word; p < end_delimiters; p++)
    *p = '\0';
  *buf = end_delimiters;
  return (begin_word);
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcspn@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strspn@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    11b3 <skip+0x93>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    118d <skip+0x6d>
mov    -0x30(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r12
mov    %rdi,%r14
mov    (%rdi),%r15
mov    %r15,%rdi
call   1050 <strcspn@plt>
movslq %eax,%r13
lea    (%r15,%r13,1),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strspn@plt>
movslq %eax,%r12
test   %r12d,%r12d
jle    1184 <skip+0x54>
lea    (%rbx,%r12,1),%rax
lea    (%r15,%r13,1),%rdx
add    $0x1,%rdx
cmp    %rdx,%rax
cmova  %rax,%rdx
sub    %rbx,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    %r12,%rbx
mov    %rbx,(%r14)
mov    %r15,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @skip(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %4
%14 = call i32 @strcspn(i8* %12, i8* %13)
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = load i8*, i8** %7
%19 = load i8*, i8** %4
%20 = call i32 @strspn(i8* %18, i8* %19)
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %17, i64 %21
store i8* %22, i8** %8
%23 = load i8*, i8** %7
store i8* %23, i8** %5
br label %24
24: ; preds = %30, %2
%25 = load i8*, i8** %5
%26 = load i8*, i8** %8
%27 = icmp ult i8* %25, %26
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i8*, i8** %5
store i8 0, i8* %29
br label %30
30: ; preds = %28
%31 = load i8*, i8** %5
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %5
br label %24
33: ; preds = %24
%34 = load i8*, i8** %8
%35 = load i8**, i8*** %3
store i8* %34, i8** %35
%36 = load i8*, i8** %6
ret i8* %36
}

LLVM IR (-O2):
define i8* @skip(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = ptrtoint i8* %3 to i64
%5 = tail call i32 @strcspn(i8* %3, i8* %1)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = tail call i32 @strspn(i8* %7, i8* %1)
%9 = sext i32 %8 to i64
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = add i64 %4, %6
%13 = add i64 %12, %9
%14 = add i64 %12, 1
%15 = call i64 @llvm.umax.i64(i64 %13, i64 %14)
%16 = add i64 %4, %6
%17 = sub i64 %15, %16
br label %18
18: ; preds = %11, %2
%19 = getelementptr inbounds i8, i8* %7, i64 %9
store i8* %19, i8** %0
ret i8* %3
}