#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__ strchr(char *, char const);
int contains_unsafe(const char *s) {
  for (; *s; s++)
    if (strchr(" <>\"#%{}|\\^~[]`@:\033", *s))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<contains_unsafe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <contains_unsafe+0x58>
mov    -0x10(%rbp),%rax
lea    0xecc(%rip),%rdi
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1152 <contains_unsafe+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116f <contains_unsafe+0x5f>
jmp    1157 <contains_unsafe+0x47>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <contains_unsafe+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains_unsafe>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
xor    %r14d,%r14d
test   %al,%al
je     1153 <contains_unsafe+0x43>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed5(%rip),%rbp
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %rbp,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    114d <contains_unsafe+0x3d>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <contains_unsafe+0x20>
jmp    1153 <contains_unsafe+0x43>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c" <>\22#%{}|\\^~[]`@:\1B\00"
define i32 @contains_unsafe(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @strchr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %19
14: ; preds = %8
br label %15
15: ; preds = %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %4
18: ; preds = %4
store i32 0, i32* %2
br label %19
19: ; preds = %18, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [19 x i8] c" <>\22#%{}|\\^~[]`@:\1B\00"
define i32 @contains_unsafe(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i64 @strchr(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%11 = icmp eq i64 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %4, label %13
13: ; preds = %7, %4, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %7 ]
ret i32 %14
}