#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 */
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
scalar_t__ ispunct(char);
scalar_t__ isspace(char);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *, char);
void chartype(char passedValue) {
  if (isalpha(passedValue) != 0) {
    if (isupper(passedValue) != 0) {
      printf("\nThe ASCII character is an uppercase letter, %c", passedValue);
    } else {
      printf("\nThe ASCII character is a lowercase letter, %c", passedValue);
    }
  } else if (isdigit(passedValue) != 0) {
    printf("\nThe ASCII character is a digit, %c", passedValue);
  } else if (ispunct(passedValue) != 0) {
    printf("\nThe ASCII character is a punctuation mark, %c", passedValue);
  } else if (isspace(passedValue) != 0) {
    printf("\nThe ASCII character is a space, %c", passedValue);
  } else
    printf("\nThe ASCII character is a nonprintable character, %c",
           passedValue);
}


x86 assembly (clang, -O0):
<chartype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
je     11be <chartype+0x5e>
movsbl -0x1(%rbp),%edi
call   1080 <isupper@plt>
cmp    $0x0,%rax
je     11a9 <chartype+0x49>
lea    0xe65(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
jmp    11b9 <chartype+0x59>
lea    0xe80(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
jmp    1255 <chartype+0xf5>
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11e6 <chartype+0x86>
lea    0xe87(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
jmp    1250 <chartype+0xf0>
movsbl -0x1(%rbp),%edi
call   1050 <ispunct@plt>
cmp    $0x0,%rax
je     120e <chartype+0xae>
lea    0xe83(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
jmp    124b <chartype+0xeb>
movsbl -0x1(%rbp),%edi
call   1060 <isspace@plt>
cmp    $0x0,%rax
je     1236 <chartype+0xd6>
lea    0xe8a(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
jmp    1246 <chartype+0xe6>
lea    0xe99(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
jmp    124b <chartype+0xeb>
jmp    1250 <chartype+0xf0>
jmp    1255 <chartype+0xf5>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chartype>:
push   %rbx
mov    %edi,%ebx
call   1070 <isalpha@plt>
movsbl %bl,%ebx
mov    %ebx,%edi
test   %rax,%rax
je     118e <chartype+0x2e>
call   1080 <isupper@plt>
test   %rax,%rax
lea    0xeaf(%rip),%rax
lea    0xe78(%rip),%rdi
cmove  %rax,%rdi
jmp    11b4 <chartype+0x54>
call   1030 <isdigit@plt>
test   %rax,%rax
je     11a1 <chartype+0x41>
lea    0xec0(%rip),%rdi
jmp    11b4 <chartype+0x54>
mov    %ebx,%edi
call   1050 <ispunct@plt>
test   %rax,%rax
je     11bc <chartype+0x5c>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>
mov    %ebx,%edi
call   1060 <isspace@plt>
test   %rax,%rax
lea    0xf09(%rip),%rax
lea    0xede(%rip),%rdi
jmp    1188 <chartype+0x28>

LLVM IR (-O0):
@.str = [48 x i8] c"\0AThe ASCII character is an uppercase letter, %c\00"
@.str.1 = [47 x i8] c"\0AThe ASCII character is a lowercase letter, %c\00"
@.str.2 = [36 x i8] c"\0AThe ASCII character is a digit, %c\00"
@.str.3 = [47 x i8] c"\0AThe ASCII character is a punctuation mark, %c\00"
@.str.4 = [36 x i8] c"\0AThe ASCII character is a space, %c\00"
@.str.5 = [53 x i8] c"\0AThe ASCII character is a nonprintable character, %c\00"
define void @chartype(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @isupper(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8 signext %11)
br label %16
13: ; preds = %6
%14 = load i8, i8* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
br label %16
16: ; preds = %13, %10
br label %44
17: ; preds = %1
%18 = load i8, i8* %2
%19 = call i64 @isdigit(i8 signext %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i8, i8* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8 signext %22)
br label %43
24: ; preds = %17
%25 = load i8, i8* %2
%26 = call i64 @ispunct(i8 signext %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i8, i8* %2
%30 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), i8 signext %29)
br label %42
31: ; preds = %24
%32 = load i8, i8* %2
%33 = call i64 @isspace(i8 signext %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = load i8, i8* %2
%37 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8 signext %36)
br label %41
38: ; preds = %31
%39 = load i8, i8* %2
%40 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i8 signext %39)
br label %41
41: ; preds = %38, %35
br label %42
42: ; preds = %41, %28
br label %43
43: ; preds = %42, %21
br label %44
44: ; preds = %43, %16
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"\0AThe ASCII character is an uppercase letter, %c\00"
@.str.1 = [47 x i8] c"\0AThe ASCII character is a lowercase letter, %c\00"
@.str.2 = [36 x i8] c"\0AThe ASCII character is a digit, %c\00"
@.str.3 = [47 x i8] c"\0AThe ASCII character is a punctuation mark, %c\00"
@.str.4 = [36 x i8] c"\0AThe ASCII character is a space, %c\00"
@.str.5 = [53 x i8] c"\0AThe ASCII character is a nonprintable character, %c\00"
define void @chartype(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isupper(i8 signext %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
br label %18
8: ; preds = %1
%9 = tail call i64 @isdigit(i8 signext %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = tail call i64 @ispunct(i8 signext %0)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = tail call i64 @isspace(i8 signext %0)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0)
br label %18
18: ; preds = %14, %11, %8, %4
%19 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), %8 ], [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), %11 ], [ %17, %14 ]
%20 = tail call i32 @printf(i8* %19, i8 signext %0)
ret void
}