#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__ inExceptions(char);
int /*<<< orphan*/ isalnum(char);
int strlen(char *);
int validCode(char *code) {
  if (strlen(code) != 6)
    return 0;
  unsigned int i;
  for (i = 0; i < 6; i++) {
    if (inExceptions(code[i]))
      return 0;
    if (!isalnum(code[i]))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<validCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
je     115a <validCode+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    11d0 <validCode+0xa0>
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jae    11c9 <validCode+0x99>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1050 <inExceptions@plt>
cmp    $0x0,%rax
je     1191 <validCode+0x61>
movl   $0x0,-0x4(%rbp)
jmp    11d0 <validCode+0xa0>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
jne    11b6 <validCode+0x86>
movl   $0x0,-0x4(%rbp)
jmp    11d0 <validCode+0xa0>
jmp    11bb <validCode+0x8b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1161 <validCode+0x31>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validCode>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x6,%eax
jne    114f <validCode+0x1f>
movsbl (%rbx),%edi
call   1050 <inExceptions@plt>
test   %rax,%rax
je     1158 <validCode+0x28>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
movsbl (%rbx),%edi
call   1040 <isalnum@plt>
test   %eax,%eax
je     114f <validCode+0x1f>
movsbl 0x1(%rbx),%edi
call   1050 <inExceptions@plt>
test   %rax,%rax
jne    114f <validCode+0x1f>
movsbl 0x1(%rbx),%edi
call   1040 <isalnum@plt>
test   %eax,%eax
je     114f <validCode+0x1f>
movsbl 0x2(%rbx),%edi
call   1050 <inExceptions@plt>
test   %rax,%rax
jne    114f <validCode+0x1f>
movsbl 0x2(%rbx),%edi
call   1040 <isalnum@plt>
test   %eax,%eax
je     114f <validCode+0x1f>
movsbl 0x3(%rbx),%edi
call   1050 <inExceptions@plt>
test   %rax,%rax
jne    114f <validCode+0x1f>
movsbl 0x3(%rbx),%edi
call   1040 <isalnum@plt>
test   %eax,%eax
je     114f <validCode+0x1f>
movsbl 0x4(%rbx),%edi
call   1050 <inExceptions@plt>
test   %rax,%rax
jne    114f <validCode+0x1f>
movsbl 0x4(%rbx),%edi
call   1040 <isalnum@plt>
test   %eax,%eax
je     114f <validCode+0x1f>
movsbl 0x5(%rbx),%edi
call   1050 <inExceptions@plt>
test   %rax,%rax
jne    114f <validCode+0x1f>
movsbl 0x5(%rbx),%edi
call   1040 <isalnum@plt>
xor    %ebp,%ebp
test   %eax,%eax
setne  %bpl
jmp    114f <validCode+0x1f>

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

LLVM IR (-O2):
define i32 @validCode(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %58
4: ; preds = %1
%5 = load i8, i8* %0
%6 = tail call i64 @inExceptions(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %54, label %58
8: ; preds = %54
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = tail call i64 @inExceptions(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %58
13: ; preds = %8
%14 = load i8, i8* %9
%15 = tail call i32 @isalnum(i8 signext %14)
%16 = icmp eq i32 %15, 0
br i1 %16, label %58, label %17
17: ; preds = %13
%18 = getelementptr inbounds i8, i8* %0, i64 2
%19 = load i8, i8* %18
%20 = tail call i64 @inExceptions(i8 signext %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %58
22: ; preds = %17
%23 = load i8, i8* %18
%24 = tail call i32 @isalnum(i8 signext %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %58, label %26
26: ; preds = %22
%27 = getelementptr inbounds i8, i8* %0, i64 3
%28 = load i8, i8* %27
%29 = tail call i64 @inExceptions(i8 signext %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %58
31: ; preds = %26
%32 = load i8, i8* %27
%33 = tail call i32 @isalnum(i8 signext %32)
%34 = icmp eq i32 %33, 0
br i1 %34, label %58, label %35
35: ; preds = %31
%36 = getelementptr inbounds i8, i8* %0, i64 4
%37 = load i8, i8* %36
%38 = tail call i64 @inExceptions(i8 signext %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %58
40: ; preds = %35
%41 = load i8, i8* %36
%42 = tail call i32 @isalnum(i8 signext %41)
%43 = icmp eq i32 %42, 0
br i1 %43, label %58, label %44
44: ; preds = %40
%45 = getelementptr inbounds i8, i8* %0, i64 5
%46 = load i8, i8* %45
%47 = tail call i64 @inExceptions(i8 signext %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %58
49: ; preds = %44
%50 = load i8, i8* %45
%51 = tail call i32 @isalnum(i8 signext %50)
%52 = icmp ne i32 %51, 0
%53 = zext i1 %52 to i32
br label %58
54: ; preds = %4
%55 = load i8, i8* %0
%56 = tail call i32 @isalnum(i8 signext %55)
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %8
58: ; preds = %49, %4, %54, %8, %13, %17, %22, %26, %31, %35, %40, %44, %1
%59 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 0, %54 ], [ 0, %8 ], [ 0, %13 ], [ 0, %17 ], [ 0, %22 ], [ 0, %26 ], [ 0, %31 ], [ 0, %35 ], [ 0, %40 ], [ 0, %44 ], [ %53, %49 ]
ret i32 %59
}