#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 */
scalar_t__ strlen(char const *);
scalar_t__ strpbrk(char const *, char *);
int nospecials(const char *p, const char *ep) {
  while (p < ep) {
    if (strpbrk(p, "^$*+?.([%-"))
      return 0;
    p += strlen(p) + 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<nospecials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    117e <nospecials+0x5e>
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strpbrk@plt>
cmp    $0x0,%rax
je     1164 <nospecials+0x44>
movl   $0x0,-0x4(%rbp)
jmp    1185 <nospecials+0x65>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <nospecials+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nospecials>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    %rsi,%rdi
jae    1169 <nospecials+0x49>
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xec1(%rip),%r15
nop
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <strpbrk@plt>
test   %rax,%rax
jne    1166 <nospecials+0x46>
mov    %rbp,%rdi
call   1030 <strlen@plt>
add    %rax,%rbp
add    $0x1,%rbp
cmp    %rbx,%rbp
jb     1140 <nospecials+0x20>
jmp    1169 <nospecials+0x49>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"^$*+?.([%-\00"
define i32 @nospecials(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %15, %2
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ult i8* %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = call i64 @strpbrk(i8* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 0, i32* %3
br label %22
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = call i64 @strlen(i8* %16)
%18 = add nsw i64 %17, 1
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 %18
store i8* %20, i8** %4
br label %6
21: ; preds = %6
store i32 1, i32* %3
br label %22
22: ; preds = %21, %14
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [11 x i8] c"^$*+?.([%-\00"
define i32 @nospecials(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %13
4: ; preds = %2, %8
%5 = phi i8* [ %11, %8 ], [ %0, %2 ]
%6 = tail call i64 @strpbrk(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%10 = add nsw i64 %9, 1
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = icmp ult i8* %11, %1
br i1 %12, label %4, label %13
13: ; preds = %4, %8, %2
%14 = phi i32 [ 1, %2 ], [ 1, %8 ], [ 0, %4 ]
ret i32 %14
}