#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 */
typedef int /*<<< orphan*/ const wchar_t;

/* Variables and functions */
int /*<<< orphan*/ const *wcspcbrk(int /*<<< orphan*/ const *,
                                   int /*<<< orphan*/ const *);
wchar_t *(wcsprcbrk)(const wchar_t *string, const wchar_t *skipset) {
  wchar_t *r;
  int found = 0;
  while (string)
    if ((r = wcspcbrk(string + 1, skipset)))
      string = r, found = 1;
  return found ? string : NULL;
}


x86 assembly (clang, -O0):
<wcsprcbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <wcsprcbrk+0x55>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wcspcbrk@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1160 <wcsprcbrk+0x50>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    1127 <wcsprcbrk+0x17>
cmpl   $0x0,-0x1c(%rbp)
je     117c <wcsprcbrk+0x6c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1187 <wcsprcbrk+0x77>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1187 <wcsprcbrk+0x77>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsprcbrk>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1135 <wcsprcbrk+0x25>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
lea    0x4(%rbx),%rdi
mov    %r14,%rsi
call   1030 <wcspcbrk@plt>
test   %rax,%rax
cmovne %rax,%rbx
jmp    1120 <wcsprcbrk+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @wcsprcbrk(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32*, i32** %3
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32*, i32** %4
%14 = call i32* @wcspcbrk(i32* %12, i32* %13)
store i32* %14, i32** %5
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = load i32*, i32** %5
store i32* %17, i32** %3
store i32 1, i32* %6
br label %18
18: ; preds = %16, %10
br label %7
19: ; preds = %7
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i32*, i32** %3
br label %25
24: ; preds = %19
br label %25
25: ; preds = %24, %22
%26 = phi i32* [ %23, %22 ], [ null, %24 ]
ret i32* %26
}

LLVM IR (-O2):
define noalias i32* @wcsprcbrk(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32* [ %9, %4 ], [ %0, %2 ]
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = tail call i32* @wcspcbrk(i32* %6, i32* %1)
%8 = icmp eq i32* %7, null
%9 = select i1 %8, i32* %5, i32* %7
br label %4
10: ; preds = %2
ret i32* null
}