#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 */
int /*<<< orphan*/ isalnum(char);
int /*<<< orphan*/ *strchr(char *, char);
int Needs_Quote(char *str) {
  while (*str) {
    if (!isalnum(*str) && strchr("-_./", *str) == NULL)
      return 1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Needs_Quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1188 <Needs_Quote+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
jne    1177 <Needs_Quote+0x57>
mov    -0x10(%rbp),%rax
lea    0xea7(%rip),%rdi
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    1177 <Needs_Quote+0x57>
movl   $0x1,-0x4(%rbp)
jmp    118f <Needs_Quote+0x6f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <Needs_Quote+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Needs_Quote>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
xor    %r14d,%r14d
test   %al,%al
je     116e <Needs_Quote+0x4e>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xec5(%rip),%rbp
jmp    114b <Needs_Quote+0x2b>
nopl   (%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     116e <Needs_Quote+0x4e>
movsbl %al,%edi
call   1040 <isalnum@plt>
test   %eax,%eax
jne    1140 <Needs_Quote+0x20>
movsbl -0x1(%rbx),%esi
mov    %rbp,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1140 <Needs_Quote+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"-_./\00"
define i32 @Needs_Quote(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %19, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i32 @isalnum(i8 signext %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %15)
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %2
br label %23
19: ; preds = %13, %8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %4
22: ; preds = %4
store i32 0, i32* %2
br label %23
23: ; preds = %22, %18
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@.str = [5 x i8] c"-_./\00"
define i32 @Needs_Quote(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = tail call i32 @isalnum(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = icmp eq i32* %11, null
br i1 %12, label %17, label %13
13: ; preds = %9, %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %9, %13, %1
%18 = phi i32 [ 0, %1 ], [ 0, %13 ], [ 1, %9 ]
ret i32 %18
}