#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 */
char tolower(char);
int partword(char c) {
  c = tolower(c);
  if (c == 0x27 || c == 0x2d)
    return 0;
  if (c < 0x30)
    return 1;
  if (c < 0x3a)
    return 0;
  if (c < 0x61)
    return 1;
  if (c < 0x7b)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<partword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x27,%eax
je     1144 <partword+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1150 <partword+0x40>
movl   $0x0,-0x4(%rbp)
jmp    11bb <partword+0xab>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jge    1169 <partword+0x59>
movl   $0x1,-0x4(%rbp)
jmp    11bb <partword+0xab>
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
jge    1182 <partword+0x72>
movl   $0x0,-0x4(%rbp)
jmp    11bb <partword+0xab>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jge    119b <partword+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    11bb <partword+0xab>
movsbl -0x5(%rbp),%eax
cmp    $0x7b,%eax
jge    11b4 <partword+0xa4>
movl   $0x0,-0x4(%rbp)
jmp    11bb <partword+0xab>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partword>:
push   %rax
call   1030 <tolower@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x27,%cl
je     1124 <partword+0x14>
cmp    $0x2d,%cl
jne    1126 <partword+0x16>
pop    %rcx
ret
cmp    $0x30,%cl
jge    1132 <partword+0x22>
mov    $0x1,%eax
pop    %rcx
ret
cmp    $0x3a,%cl
jb     1124 <partword+0x14>
mov    $0x1,%eax
cmp    $0x61,%cl
jb     1124 <partword+0x14>
xor    %eax,%eax
cmp    $0x7b,%cl
setae  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @partword(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call signext i8 @tolower(i8 signext %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 39
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 45
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i32 0, i32* %2
br label %35
14: ; preds = %9
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 48
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %2
br label %35
19: ; preds = %14
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp slt i32 %21, 58
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 0, i32* %2
br label %35
24: ; preds = %19
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp slt i32 %26, 97
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 1, i32* %2
br label %35
29: ; preds = %24
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = icmp slt i32 %31, 123
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 0, i32* %2
br label %35
34: ; preds = %29
store i32 1, i32* %2
br label %35
35: ; preds = %34, %33, %28, %23, %18, %13
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @partword(i8 signext %0) {
%2 = tail call signext i8 @tolower(i8 signext %0)
switch i8 %2, label %3 [
i8 45, label %12
i8 39, label %12
]
3: ; preds = %1
%4 = icmp slt i8 %2, 48
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ult i8 %2, 58
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i8 %2, 97
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ugt i8 %2, 122
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %9, %7, %5, %3, %1, %1
%13 = phi i32 [ 0, %1 ], [ 0, %1 ], [ 1, %3 ], [ 0, %5 ], [ 1, %7 ], [ %11, %9 ]
ret i32 %13
}