#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 const *, char const);
int contains_illegals(const char *string, const char *illegals) {
  for (; *string; string++)
    if ((*string < ' ' && *string != '\005' && !(*string & 0x80)) ||
        strchr(illegals, *string))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<contains_illegals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     119e <contains_illegals+0x8e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jge    1162 <contains_illegals+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5,%eax
je     1162 <contains_illegals+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     117c <contains_illegals+0x6c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1188 <contains_illegals+0x78>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <contains_illegals+0x95>
jmp    118d <contains_illegals+0x7d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <contains_illegals+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains_illegals>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1153 <contains_illegals+0x43>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0x1,%ebp
nopl   0x0(%rax)
cmp    $0x1f,%al
ja     1138 <contains_illegals+0x28>
cmp    $0x5,%al
jne    1155 <contains_illegals+0x45>
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1155 <contains_illegals+0x45>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <contains_illegals+0x20>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @contains_illegals(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %8
5: ; preds = %14
%6 = load i8, i8* %17
%7 = icmp eq i8 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %17, %5 ], [ %0, %2 ]
%11 = icmp ne i8 %9, 5
%12 = icmp ult i8 %9, 32
%13 = and i1 %12, %11
br i1 %13, label %18, label %14
14: ; preds = %8
%15 = tail call i64 @strchr(i8* %1, i8 signext %9)
%16 = icmp eq i64 %15, 0
%17 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %16, label %5, label %18
18: ; preds = %8, %14, %5, %2
%19 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %14 ], [ 1, %8 ]
ret i32 %19
}