#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 checkName(char *str) {
  if (str == NULL || *str == '\0')
    return 0;
  for (; *str; str++)
    if (!isalnum(*str) && *str != '.')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<checkName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1137 <checkName+0x27>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1143 <checkName+0x33>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <checkName+0x93>
jmp    1148 <checkName+0x38>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     119c <checkName+0x8c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    1186 <checkName+0x76>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1186 <checkName+0x76>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <checkName+0x93>
jmp    118b <checkName+0x7b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1148 <checkName+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkName>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1154 <checkName+0x44>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1154 <checkName+0x44>
add    $0x1,%rbx
jmp    113b <checkName+0x2b>
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     114f <checkName+0x3f>
movsbl %al,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
jne    1130 <checkName+0x20>
cmpb   $0x2e,-0x1(%rbx)
je     1130 <checkName+0x20>
jmp    1154 <checkName+0x44>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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