#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 *findQuote(char *);
char *strpbrk(char *, char *);
char *findEnd(char *s, char *delim) {
  while (*s) {
    if (('\'' == *s) || ('\"' == *s)) {
      s = findQuote(s) + 1;
      continue;
    }
    if (s == strpbrk(s, delim)) {
      return s;
    }
    s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<findEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11be <findEnd+0x9e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x27,%eax
cmp    %ecx,%eax
je     1165 <findEnd+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x22,%eax
cmp    %ecx,%eax
jne    117b <findEnd+0x5b>
mov    -0x10(%rbp),%rdi
call   1030 <findQuote@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <findEnd+0x10>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strpbrk@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    11ad <findEnd+0x8d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11c6 <findEnd+0xa6>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <findEnd+0x10>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findEnd>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
jmp    113f <findEnd+0x1f>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <findQuote@plt>
mov    %rax,%rbx
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x22,%al
je     1130 <findEnd+0x10>
cmp    $0x27,%al
je     1130 <findEnd+0x10>
test   %al,%al
je     115e <findEnd+0x3e>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strpbrk@plt>
cmp    %rax,%rbx
jne    113b <findEnd+0x1b>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @findEnd(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %11 [
i8 0, label %14
i8 39, label %6
i8 34, label %6
]
6: ; preds = %3, %3
%7 = tail call i8* @findQuote(i8* %4)
br label %8
8: ; preds = %11, %6
%9 = phi i8* [ %7, %6 ], [ %4, %11 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %3
11: ; preds = %3
%12 = tail call i8* @strpbrk(i8* %4, i8* %1)
%13 = icmp eq i8* %4, %12
br i1 %13, label %14, label %8
14: ; preds = %3, %11
ret i8* %4
}