#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 _RepCheckType(char *S) {
  int i;
  if (S == NULL)
    return (0);
  for (i = 0; S[i] != '\0'; i++) {
    if (!isalnum(S[i]) && !strchr("@%_=+-", S[i]))
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<_RepCheckType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <_RepCheckType+0x23>
movl   $0x0,-0x4(%rbp)
jmp    11c0 <_RepCheckType+0xa0>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11b9 <_RepCheckType+0x99>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
jne    11a6 <_RepCheckType+0x86>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xe78(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
jne    11a6 <_RepCheckType+0x86>
movl   $0x0,-0x4(%rbp)
jmp    11c0 <_RepCheckType+0xa0>
jmp    11ab <_RepCheckType+0x8b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <_RepCheckType+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_RepCheckType>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %rdi,%rdi
je     117f <_RepCheckType+0x5f>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1179 <_RepCheckType+0x59>
add    $0x1,%rbx
lea    0xec0(%rip),%rbp
jmp    115b <_RepCheckType+0x3b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1179 <_RepCheckType+0x59>
movsbl %al,%edi
call   1040 <isalnum@plt>
test   %eax,%eax
jne    1150 <_RepCheckType+0x30>
movsbl -0x1(%rbx),%esi
mov    %rbp,%rdi
call   1030 <strchr@plt>
test   %eax,%eax
jne    1150 <_RepCheckType+0x30>
jmp    117f <_RepCheckType+0x5f>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"@%_=+-\00"
define i32 @_RepCheckType(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %39
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %35, %8
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %38
17: ; preds = %9
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = call i32 @isalnum(i8 signext %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %34, label %25
25: ; preds = %17
%26 = load i8*, i8** %3
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = call i32 @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %25
store i32 0, i32* %2
br label %39
34: ; preds = %25, %17
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %9
38: ; preds = %9
store i32 1, i32* %2
br label %39
39: ; preds = %38, %33, %7
%40 = load i32, i32* %2
ret i32 %40
}

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