#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*/ ispunct(char);
int /*<<< orphan*/ isspace(char);
int ignorestr(char *str) {
  char *s;
  for (s = str; *s != '\0'; s++) {
    if (!isalnum(*s) && !ispunct(*s) && !isspace(*s))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ignorestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b5 <ignorestr+0x85>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    119f <ignorestr+0x6f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <ispunct@plt>
cmp    $0x0,%eax
jne    119f <ignorestr+0x6f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
jne    119f <ignorestr+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    11bc <ignorestr+0x8c>
jmp    11a4 <ignorestr+0x74>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1144 <ignorestr+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignorestr>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     1175 <ignorestr+0x45>
mov    %rdi,%rbx
jmp    114c <ignorestr+0x1c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1175 <ignorestr+0x45>
movsbl %al,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
jne    1140 <ignorestr+0x10>
movsbl (%rbx),%edi
call   1040 <ispunct@plt>
test   %eax,%eax
jne    1140 <ignorestr+0x10>
movsbl (%rbx),%edi
call   1050 <isspace@plt>
test   %eax,%eax
jne    1140 <ignorestr+0x10>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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