#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 */
char *strpbrk(char const *, char const *);
char *argsep_next_interesting(const char *src, const char *delim) {
  char *special = strpbrk(src, "\"'\\");
  char *next_delim = strpbrk(src, delim);
  if (!special) {
    return next_delim;
  }
  if (!next_delim) {
    return special;
  }
  return (next_delim < special) ? next_delim : special;
}


x86 assembly (clang, -O0):
<argsep_next_interesting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115d <argsep_next_interesting+0x4d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11a0 <argsep_next_interesting+0x90>
cmpq   $0x0,-0x28(%rbp)
jne    1175 <argsep_next_interesting+0x65>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11a0 <argsep_next_interesting+0x90>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1190 <argsep_next_interesting+0x80>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1198 <argsep_next_interesting+0x88>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argsep_next_interesting>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xede(%rip),%rsi
call   1030 <strpbrk@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strpbrk@plt>
test   %r15,%r15
je     114b <argsep_next_interesting+0x3b>
test   %rax,%rax
je     1148 <argsep_next_interesting+0x38>
cmp    %r15,%rax
cmovae %r15,%rax
jmp    114b <argsep_next_interesting+0x3b>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\22'\\\00"
define i8* @argsep_next_interesting(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @strpbrk(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i8* @strpbrk(i8* %10, i8* %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = load i8*, i8** %7
store i8* %16, i8** %3
br label %32
17: ; preds = %2
%18 = load i8*, i8** %7
%19 = icmp ne i8* %18, null
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %32
22: ; preds = %17
%23 = load i8*, i8** %7
%24 = load i8*, i8** %6
%25 = icmp ult i8* %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i8*, i8** %7
br label %30
28: ; preds = %22
%29 = load i8*, i8** %6
br label %30
30: ; preds = %28, %26
%31 = phi i8* [ %27, %26 ], [ %29, %28 ]
store i8* %31, i8** %3
br label %32
32: ; preds = %30, %20, %15
%33 = load i8*, i8** %3
ret i8* %33
}

LLVM IR (-O2):
@.str = [4 x i8] c"\22'\\\00"
define i8* @argsep_next_interesting(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @strpbrk(i8* %0, i8* %1)
%5 = icmp eq i8* %3, null
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = icmp eq i8* %4, null
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = icmp ult i8* %4, %3
%10 = select i1 %9, i8* %4, i8* %3
br label %11
11: ; preds = %6, %2, %8
%12 = phi i8* [ %10, %8 ], [ %4, %2 ], [ %3, %6 ]
ret i8* %12
}