#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*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int strlen(char const *);
int check_legal_property_name(const char *name) {
  int namelen = strlen(name);
  if (namelen < 1)
    goto illegal;
  if (name[0] == '.')
    goto illegal;
  if (name[namelen - 1] == '.')
    goto illegal;
  for (size_t i = 0; i < namelen; i++) {
    if (name[i] == '.') {
      if (name[i - 1] == '.')
        goto illegal;
      continue;
    }
    if (name[i] == '_' || name[i] == '-' || name[i] == '@' || name[i] == ':')
      continue;
    if (name[i] >= 'a' && name[i] <= 'z')
      continue;
    if (name[i] >= 'A' && name[i] <= 'Z')
      continue;
    if (name[i] >= '0' && name[i] <= '9')
      continue;
    goto illegal;
  }
  return 0;
illegal : {
  ;
  fprintf(stderr, "Illegal property name: [%s]\n", name);
};
  return 1;
}


x86 assembly (clang, -O0):
<check_legal_property_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    1147 <check_legal_property_name+0x27>
jmp    12d4 <check_legal_property_name+0x1b4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    115c <check_legal_property_name+0x3c>
jmp    12d4 <check_legal_property_name+0x1b4>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    117b <check_legal_property_name+0x5b>
jmp    12d4 <check_legal_property_name+0x1b4>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jae    12c8 <check_legal_property_name+0x1a8>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    11cc <check_legal_property_name+0xac>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    11c7 <check_legal_property_name+0xa7>
jmp    12d4 <check_legal_property_name+0x1b4>
jmp    12b7 <check_legal_property_name+0x197>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
je     1220 <check_legal_property_name+0x100>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
je     1220 <check_legal_property_name+0x100>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
je     1220 <check_legal_property_name+0x100>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1225 <check_legal_property_name+0x105>
jmp    12b7 <check_legal_property_name+0x197>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     1254 <check_legal_property_name+0x134>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jg     1254 <check_legal_property_name+0x134>
jmp    12b7 <check_legal_property_name+0x197>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     1283 <check_legal_property_name+0x163>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jg     1283 <check_legal_property_name+0x163>
jmp    12b7 <check_legal_property_name+0x197>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     12b2 <check_legal_property_name+0x192>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     12b2 <check_legal_property_name+0x192>
jmp    12b7 <check_legal_property_name+0x197>
jmp    12d4 <check_legal_property_name+0x1b4>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1183 <check_legal_property_name+0x63>
movl   $0x0,-0x4(%rbp)
jmp    12f4 <check_legal_property_name+0x1d4>
mov    0x2d05(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xd18(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_legal_property_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    113d <check_legal_property_name+0x1d>
mov    (%rbx),%cl
cmp    $0x2e,%cl
je     113d <check_legal_property_name+0x1d>
lea    -0x1(%rax),%edx
cmpb   $0x2e,(%rbx,%rdx,1)
jne    115c <check_legal_property_name+0x3c>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xf03(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret
mov    %eax,%esi
mov    $0x1,%edx
lea    0xe96(%rip),%r8
nopw   0x0(%rax,%rax,1)
lea    -0x2d(%rcx),%edi
cmp    $0x13,%dil
ja     1190 <check_legal_property_name+0x70>
movzbl %dil,%edi
movslq (%r8,%rdi,4),%rdi
add    %r8,%rdi
jmp    *%rdi
cmpb   $0x2e,-0x2(%rbx,%rdx,1)
jne    11b0 <check_legal_property_name+0x90>
jmp    113d <check_legal_property_name+0x1d>
nop
cmp    $0x5f,%cl
je     11b0 <check_legal_property_name+0x90>
mov    %ecx,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
jb     11b0 <check_legal_property_name+0x90>
add    $0xd0,%cl
cmp    $0x9,%cl
ja     113d <check_legal_property_name+0x1d>
nopw   0x0(%rax,%rax,1)
cmp    %rdx,%rsi
je     11bf <check_legal_property_name+0x9f>
movzbl (%rbx,%rdx,1),%ecx
add    $0x1,%rdx
jmp    1170 <check_legal_property_name+0x50>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Illegal property name: [%s]\0A\00"
define i32 @check_legal_property_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %1
br label %130
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 46
br i1 %16, label %17, label %18
17: ; preds = %11
br label %130
18: ; preds = %11
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 46
br i1 %26, label %27, label %28
27: ; preds = %18
br label %130
28: ; preds = %18
store i64 0, i64* %5
br label %29
29: ; preds = %126, %28
%30 = load i64, i64* %5
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = icmp ult i64 %30, %32
br i1 %33, label %34, label %129
34: ; preds = %29
%35 = load i8*, i8** %3
%36 = load i64, i64* %5
%37 = getelementptr inbounds i8, i8* %35, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 46
br i1 %40, label %41, label %51
41: ; preds = %34
%42 = load i8*, i8** %3
%43 = load i64, i64* %5
%44 = sub i64 %43, 1
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 46
br i1 %48, label %49, label %50
49: ; preds = %41
br label %130
50: ; preds = %41
br label %126
51: ; preds = %34
%52 = load i8*, i8** %3
%53 = load i64, i64* %5
%54 = getelementptr inbounds i8, i8* %52, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 95
br i1 %57, label %79, label %58
58: ; preds = %51
%59 = load i8*, i8** %3
%60 = load i64, i64* %5
%61 = getelementptr inbounds i8, i8* %59, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 45
br i1 %64, label %79, label %65
65: ; preds = %58
%66 = load i8*, i8** %3
%67 = load i64, i64* %5
%68 = getelementptr inbounds i8, i8* %66, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 64
br i1 %71, label %79, label %72
72: ; preds = %65
%73 = load i8*, i8** %3
%74 = load i64, i64* %5
%75 = getelementptr inbounds i8, i8* %73, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 58
br i1 %78, label %79, label %80
79: ; preds = %72, %65, %58, %51
br label %126
80: ; preds = %72
%81 = load i8*, i8** %3
%82 = load i64, i64* %5
%83 = getelementptr inbounds i8, i8* %81, i64 %82
%84 = load i8, i8* %83
%85 = sext i8 %84 to i32
%86 = icmp sge i32 %85, 97
br i1 %86, label %87, label %95
87: ; preds = %80
%88 = load i8*, i8** %3
%89 = load i64, i64* %5
%90 = getelementptr inbounds i8, i8* %88, i64 %89
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp sle i32 %92, 122
br i1 %93, label %94, label %95
94: ; preds = %87
br label %126
95: ; preds = %87, %80
%96 = load i8*, i8** %3
%97 = load i64, i64* %5
%98 = getelementptr inbounds i8, i8* %96, i64 %97
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp sge i32 %100, 65
br i1 %101, label %102, label %110
102: ; preds = %95
%103 = load i8*, i8** %3
%104 = load i64, i64* %5
%105 = getelementptr inbounds i8, i8* %103, i64 %104
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = icmp sle i32 %107, 90
br i1 %108, label %109, label %110
109: ; preds = %102
br label %126
110: ; preds = %102, %95
%111 = load i8*, i8** %3
%112 = load i64, i64* %5
%113 = getelementptr inbounds i8, i8* %111, i64 %112
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp sge i32 %115, 48
br i1 %116, label %117, label %125
117: ; preds = %110
%118 = load i8*, i8** %3
%119 = load i64, i64* %5
%120 = getelementptr inbounds i8, i8* %118, i64 %119
%121 = load i8, i8* %120
%122 = sext i8 %121 to i32
%123 = icmp sle i32 %122, 57
br i1 %123, label %124, label %125
124: ; preds = %117
br label %126
125: ; preds = %117, %110
br label %130
126: ; preds = %124, %109, %94, %79, %50
%127 = load i64, i64* %5
%128 = add i64 %127, 1
store i64 %128, i64* %5
br label %29
129: ; preds = %29
store i32 0, i32* %2
br label %134
130: ; preds = %125, %49, %27, %17, %10
%131 = load i32, i32* @stderr
%132 = load i8*, i8** %3
%133 = call i32 @fprintf(i32 %131, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %132)
store i32 1, i32* %2
br label %134
134: ; preds = %130, %129
%135 = load i32, i32* %2
ret i32 %135
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Illegal property name: [%s]\0A\00"
define i32 @check_legal_property_name(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %36, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 46
br i1 %6, label %36, label %7
7: ; preds = %4
%8 = add nsw i32 %2, -1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 46
br i1 %12, label %36, label %13
13: ; preds = %7
%14 = zext i32 %2 to i64
br label %15
15: ; preds = %33, %13
%16 = phi i8 [ %5, %13 ], [ %35, %33 ]
%17 = phi i64 [ 0, %13 ], [ %31, %33 ]
switch i8 %16, label %23 [
i8 46, label %18
i8 95, label %30
i8 45, label %30
i8 64, label %30
i8 58, label %30
]
18: ; preds = %15
%19 = add i64 %17, -1
%20 = getelementptr inbounds i8, i8* %0, i64 %19
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 46
br i1 %22, label %36, label %30
23: ; preds = %15
%24 = and i8 %16, -33
%25 = add i8 %24, -65
%26 = icmp ult i8 %25, 26
%27 = add i8 %16, -48
%28 = icmp ult i8 %27, 10
%29 = select i1 %26, i1 true, i1 %28
br i1 %29, label %30, label %36
30: ; preds = %23, %15, %15, %15, %15, %18
%31 = add nuw i64 %17, 1
%32 = icmp eq i64 %31, %14
br i1 %32, label %39, label %33
33: ; preds = %30
%34 = getelementptr inbounds i8, i8* %0, i64 %31
%35 = load i8, i8* %34
br label %15
36: ; preds = %23, %18, %7, %4, %1
%37 = load i32, i32* @stderr
%38 = tail call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %39
39: ; preds = %30, %36
%40 = phi i32 [ 1, %36 ], [ 0, %30 ]
ret i32 %40
}