#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*/ isalpha(char);
int strlen(char *);
int checkAlpha(char *object) {
  int length = strlen(object);
  int spaces = 0;
  for (int i = 0; i < length; i++) {
    if (!isalpha(object[i]) && object[i] != '\'') {
      if (object[i] == ' ') {
        spaces++;
      }
    }
    if (spaces > 2) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkAlpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11cd <checkAlpha+0xad>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%eax
jne    11a4 <checkAlpha+0x84>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
je     11a4 <checkAlpha+0x84>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    119f <checkAlpha+0x7f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a4 <checkAlpha+0x84>
cmpl   $0x2,-0x18(%rbp)
jle    11ba <checkAlpha+0x9a>
movl   $0x1,-0x4(%rbp)
jmp    11d4 <checkAlpha+0xb4>
jmp    11bf <checkAlpha+0x9f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <checkAlpha+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkAlpha>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
call   1030 <strlen@plt>
xor    %r14d,%r14d
test   %eax,%eax
jle    1187 <checkAlpha+0x67>
mov    %eax,%r15d
mov    %r15,%r12
neg    %r12
mov    $0x1,%bl
mov    $0x1,%ebp
jmp    1168 <checkAlpha+0x48>
add    $0x1,%r14d
cmp    %r15,%rbp
setb   %bl
lea    (%r12,%rbp,1),%rax
add    $0x1,%rax
add    $0x1,%rbp
cmp    $0x1,%rax
je     1189 <checkAlpha+0x69>
movsbl -0x1(%r13,%rbp,1),%edi
call   1040 <isalpha@plt>
test   %eax,%eax
jne    1150 <checkAlpha+0x30>
cmpb   $0x20,-0x1(%r13,%rbp,1)
jne    1150 <checkAlpha+0x30>
cmp    $0x1,%r14d
jle    114c <checkAlpha+0x2c>
jmp    1189 <checkAlpha+0x69>
xor    %ebx,%ebx
movzbl %bl,%eax
and    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @checkAlpha(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %26
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %4, %21
%8 = phi i64 [ 0, %4 ], [ %23, %21 ]
%9 = phi i1 [ true, %4 ], [ %24, %21 ]
%10 = phi i32 [ 0, %4 ], [ %22, %21 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %8
%12 = load i8, i8* %11
%13 = tail call i32 @isalpha(i8 signext %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %7
%16 = load i8, i8* %11
%17 = icmp eq i8 %16, 32
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = add nsw i32 %10, 1
%20 = icmp sgt i32 %10, 1
br i1 %20, label %26, label %21
21: ; preds = %15, %7, %18
%22 = phi i32 [ %19, %18 ], [ %10, %7 ], [ %10, %15 ]
%23 = add nuw nsw i64 %8, 1
%24 = icmp ult i64 %23, %5
%25 = icmp eq i64 %23, %6
br i1 %25, label %26, label %7
26: ; preds = %21, %18, %1
%27 = phi i1 [ false, %1 ], [ %9, %18 ], [ %24, %21 ]
%28 = zext i1 %27 to i32
ret i32 %28
}