#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 *begin_word, *end_word;
  begin_word = *buf;
  end_word = begin_word + strcspn(begin_word, delimiters);
  if (*end_word == '\0') {
    *buf = end_word;
  } else {
    *end_word++ = 0;
    *buf = end_word + strspn(end_word, delimiters);
  }
  return begin_word;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcspn@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1180 <skip+0x60>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    11b7 <skip+0x97>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strspn@plt>
mov    -0x30(%rbp),%rcx
cltq
add    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    (%rdi),%r12
mov    %r12,%rdi
call   1040 <strcspn@plt>
cltq
lea    (%r12,%rax,1),%rbx
cmpb   $0x0,(%r12,%rax,1)
je     115e <skip+0x3e>
lea    0x1(%rbx),%rdi
movb   $0x0,(%rbx)
mov    %r15,%rsi
call   1030 <strspn@plt>
cltq
add    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,(%r14)
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
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*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = call i32 @strcspn(i8* %10, i8* %11)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = load i8*, i8** %6
%21 = load i8**, i8*** %3
store i8* %20, i8** %21
br label %32
22: ; preds = %2
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %6
store i8 0, i8* %23
%25 = load i8*, i8** %6
%26 = load i8*, i8** %6
%27 = load i8*, i8** %4
%28 = call i32 @strspn(i8* %26, i8* %27)
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %25, i64 %29
%31 = load i8**, i8*** %3
store i8* %30, i8** %31
br label %32
32: ; preds = %22, %19
%33 = load i8*, i8** %5
ret i8* %33
}

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