#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 const *);
int looks_like_name(const char *word) {
  int i;
  if (strlen(word) <= 1) {
    return 0;
  } else if (*word < 65 || *word > 90) {
    return 0;
  }
  for (i = 1; i < strlen(word); i++) {
    if (*(word + i) < 97 || *(word + i) > 122) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<looks_like_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jg     113a <looks_like_name+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    11de <looks_like_name+0xce>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     115a <looks_like_name+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jle    1166 <looks_like_name+0x56>
movl   $0x0,-0x4(%rbp)
jmp    11de <looks_like_name+0xce>
jmp    116b <looks_like_name+0x5b>
movl   $0x1,-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    11d7 <looks_like_name+0xc7>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     11b8 <looks_like_name+0xa8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jle    11c4 <looks_like_name+0xb4>
movl   $0x0,-0x4(%rbp)
jmp    11de <looks_like_name+0xce>
jmp    11c9 <looks_like_name+0xb9>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1172 <looks_like_name+0x62>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<looks_like_name>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %r14d,%r14d
cmp    $0x2,%eax
jl     1163 <looks_like_name+0x53>
mov    (%rbx),%al
add    $0xa5,%al
cmp    $0xe6,%al
jb     1163 <looks_like_name+0x53>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     115d <looks_like_name+0x4d>
mov    $0x1,%ebp
xchg   %ax,%ax
movzbl (%rbx,%rbp,1),%eax
add    $0x85,%al
cmp    $0xe5,%al
jbe    1163 <looks_like_name+0x53>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1140 <looks_like_name+0x30>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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