#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 strlen(char *);
int valid_project_name(char *project_name) {
  int i;
  for (i = 0; i < strlen(project_name); i++) {
    if (((project_name[i] < 'a') || (project_name[i] > 'z')) &&
        ((project_name[i] < '0') || (project_name[i] > '9'))) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<valid_project_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    11b2 <valid_project_name+0xa2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     1169 <valid_project_name+0x59>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jle    119f <valid_project_name+0x8f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     1193 <valid_project_name+0x83>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    119f <valid_project_name+0x8f>
movl   $0x0,-0x4(%rbp)
jmp    11b9 <valid_project_name+0xa9>
jmp    11a4 <valid_project_name+0x94>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <valid_project_name+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_project_name>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x1,%r14d
test   %eax,%eax
jle    1158 <valid_project_name+0x48>
xor    %ebp,%ebp
jmp    1143 <valid_project_name+0x33>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    1158 <valid_project_name+0x48>
movzbl (%rbx,%rbp,1),%eax
lea    -0x7b(%rax),%ecx
cmp    $0xe5,%cl
ja     1130 <valid_project_name+0x20>
add    $0xc6,%al
cmp    $0xf5,%al
ja     1130 <valid_project_name+0x20>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @valid_project_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %44, %1
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %47
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 97
br i1 %17, label %26, label %18
18: ; preds = %10
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp sgt i32 %24, 122
br i1 %25, label %26, label %43
26: ; preds = %18, %10
%27 = load i8*, i8** %3
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp slt i32 %32, 48
br i1 %33, label %42, label %34
34: ; preds = %26
%35 = load i8*, i8** %3
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp sgt i32 %40, 57
br i1 %41, label %42, label %43
42: ; preds = %34, %26
store i32 0, i32* %2
br label %48
43: ; preds = %34, %18
br label %44
44: ; preds = %43
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
store i32 %46, i32* %4
br label %5
47: ; preds = %5
store i32 1, i32* %2
br label %48
48: ; preds = %47, %42
%49 = load i32, i32* %2
ret i32 %49
}

LLVM IR (-O2):
define i32 @valid_project_name(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %8, label %18
4: ; preds = %8
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = icmp slt i64 %17, %6
br i1 %7, label %8, label %18
8: ; preds = %1, %4
%9 = phi i64 [ %17, %4 ], [ 0, %1 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = add i8 %11, -123
%13 = icmp ult i8 %12, -26
%14 = add i8 %11, -58
%15 = icmp ult i8 %14, -10
%16 = and i1 %13, %15
%17 = add nuw nsw i64 %9, 1
br i1 %16, label %18, label %4
18: ; preds = %4, %8, %1
%19 = phi i32 [ 1, %1 ], [ 0, %8 ], [ 1, %4 ]
ret i32 %19
}