#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__ isalnum(char);
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
scalar_t__ islower(char);
scalar_t__ ispunct(char);
scalar_t__ isspace(char);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
char tolower(char);
char toupper(char);
void main() {
  char a, b;
  printf("Please enter a character: ");
  scanf("%c", &a);
  if (isdigit(a) != 0)
    printf("\nThe character entered is a digit.");
  else
    printf("\nThe character entered is not a digit.");
  if (isalpha(a) != 0)
    printf("\nThe character entered is a letter.");
  else
    printf("\nThe character entered is not a letter.");
  if (isalnum(a) != 0)
    printf("\nThe character entered is an alphanumeric character.");
  else
    printf("\nThe character entered is not an alphanumeric character.");
  if (islower(a) != 0)
    printf("\nThe character entered is a lowercase letter.");
  else
    printf("\nThe character entered is not a lowercase letter.");
  if (isupper(a) != 0)
    printf("\nThe character entered is a uppercase letter.");
  else
    printf("\nThe character entered is not a uppercase letter.");
  if (isspace(a) != 0)
    printf("\nThe character entered is a space.");
  else
    printf("\nThe character entered is not a space.");
  if (ispunct(a) != 0)
    printf("\nThe character entered is a punctuation mark.");
  else
    printf("\nThe character entered is not a punctuation mark.");
  if (islower(a))
    b = toupper(a);
  else
    b = tolower(a);
  printf("\nThe character entered is: %c", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x10d7(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   10d0 <scanf@plt>
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11fc <main+0x4c>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    120a <main+0x5a>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x1(%rbp),%edi
call   10b0 <isalpha@plt>
cmp    $0x0,%rax
je     1230 <main+0x80>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    123e <main+0x8e>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1070 <isalnum@plt>
cmp    $0x0,%rax
je     1264 <main+0xb4>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1272 <main+0xc2>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     1298 <main+0xe8>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12a6 <main+0xf6>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x1(%rbp),%edi
call   10c0 <isupper@plt>
cmp    $0x0,%rax
je     12cc <main+0x11c>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12da <main+0x12a>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
je     1300 <main+0x150>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    130e <main+0x15e>
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1080 <ispunct@plt>
cmp    $0x0,%rax
je     1334 <main+0x184>
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1342 <main+0x192>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     1366 <main+0x1b6>
movsbl -0x1(%rbp),%edi
call   1050 <toupper@plt>
mov    %al,-0x2(%rbp)
jmp    1372 <main+0x1c2>
movsbl -0x1(%rbp),%edi
call   10a0 <tolower@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%esi
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x10de(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10d0 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
lea    0xe5a(%rip),%rax
lea    0xe30(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%edi
call   10b0 <isalpha@plt>
test   %rax,%rax
lea    0xe7f(%rip),%rax
lea    0xe54(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%edi
call   1070 <isalnum@plt>
test   %rax,%rax
lea    0xeb6(%rip),%rax
lea    0xe7a(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%edi
call   1040 <islower@plt>
test   %rax,%rax
lea    0xef7(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%edi
call   10c0 <isupper@plt>
test   %rax,%rax
lea    0xf31(%rip),%rax
lea    0xefc(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%edi
call   1090 <isspace@plt>
test   %rax,%rax
lea    0xf60(%rip),%rax
lea    0xf36(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%edi
call   1080 <ispunct@plt>
test   %rax,%rax
lea    0xf8f(%rip),%rax
lea    0xf5a(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%edi
call   1040 <islower@plt>
mov    0x7(%rsp),%cl
movsbl %cl,%edi
test   %rax,%rax
je     12f7 <main+0x147>
call   1050 <toupper@plt>
jmp    12fc <main+0x14c>
call   10a0 <tolower@plt>
movsbl %al,%esi
lea    0xf83(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter a character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [35 x i8] c"\0AThe character entered is a digit.\00"
@.str.3 = [39 x i8] c"\0AThe character entered is not a digit.\00"
@.str.4 = [36 x i8] c"\0AThe character entered is a letter.\00"
@.str.5 = [40 x i8] c"\0AThe character entered is not a letter.\00"
@.str.6 = [53 x i8] c"\0AThe character entered is an alphanumeric character.\00"
@.str.7 = [57 x i8] c"\0AThe character entered is not an alphanumeric character.\00"
@.str.8 = [46 x i8] c"\0AThe character entered is a lowercase letter.\00"
@.str.9 = [50 x i8] c"\0AThe character entered is not a lowercase letter.\00"
@.str.10 = [46 x i8] c"\0AThe character entered is a uppercase letter.\00"
@.str.11 = [50 x i8] c"\0AThe character entered is not a uppercase letter.\00"
@.str.12 = [35 x i8] c"\0AThe character entered is a space.\00"
@.str.13 = [39 x i8] c"\0AThe character entered is not a space.\00"
@.str.14 = [46 x i8] c"\0AThe character entered is a punctuation mark.\00"
@.str.15 = [50 x i8] c"\0AThe character entered is not a punctuation mark.\00"
@.str.16 = [30 x i8] c"\0AThe character entered is: %c\00"
define void @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = call i64 @isdigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i8, i8* %1
%14 = call i64 @isalpha(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %20
18: ; preds = %12
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
%21 = load i8, i8* %1
%22 = call i64 @isalnum(i8 signext %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
br label %28
26: ; preds = %20
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
%29 = load i8, i8* %1
%30 = call i64 @islower(i8 signext %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
br label %36
34: ; preds = %28
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
%37 = load i8, i8* %1
%38 = call i64 @isupper(i8 signext %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
br label %44
42: ; preds = %36
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
%45 = load i8, i8* %1
%46 = call i64 @isspace(i8 signext %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0))
br label %52
50: ; preds = %44
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0))
br label %52
52: ; preds = %50, %48
%53 = load i8, i8* %1
%54 = call i64 @ispunct(i8 signext %53)
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.14, i64 0, i64 0))
br label %60
58: ; preds = %52
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.15, i64 0, i64 0))
br label %60
60: ; preds = %58, %56
%61 = load i8, i8* %1
%62 = call i64 @islower(i8 signext %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = load i8, i8* %1
%66 = call signext i8 @toupper(i8 signext %65)
store i8 %66, i8* %2
br label %70
67: ; preds = %60
%68 = load i8, i8* %1
%69 = call signext i8 @tolower(i8 signext %68)
store i8 %69, i8* %2
br label %70
70: ; preds = %67, %64
%71 = load i8, i8* %2
%72 = sext i8 %71 to i32
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %72)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter a character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [35 x i8] c"\0AThe character entered is a digit.\00"
@.str.3 = [39 x i8] c"\0AThe character entered is not a digit.\00"
@.str.4 = [36 x i8] c"\0AThe character entered is a letter.\00"
@.str.5 = [40 x i8] c"\0AThe character entered is not a letter.\00"
@.str.6 = [53 x i8] c"\0AThe character entered is an alphanumeric character.\00"
@.str.7 = [57 x i8] c"\0AThe character entered is not an alphanumeric character.\00"
@.str.8 = [46 x i8] c"\0AThe character entered is a lowercase letter.\00"
@.str.9 = [50 x i8] c"\0AThe character entered is not a lowercase letter.\00"
@.str.10 = [46 x i8] c"\0AThe character entered is a uppercase letter.\00"
@.str.11 = [50 x i8] c"\0AThe character entered is not a uppercase letter.\00"
@.str.12 = [35 x i8] c"\0AThe character entered is a space.\00"
@.str.13 = [39 x i8] c"\0AThe character entered is not a space.\00"
@.str.14 = [46 x i8] c"\0AThe character entered is a punctuation mark.\00"
@.str.15 = [50 x i8] c"\0AThe character entered is not a punctuation mark.\00"
@.str.16 = [30 x i8] c"\0AThe character entered is: %c\00"
define void @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %7)
%9 = load i8, i8* %1
%10 = call i64 @isalpha(i8 signext %9)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %12)
%14 = load i8, i8* %1
%15 = call i64 @isalnum(i8 signext %14)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %17)
%19 = load i8, i8* %1
%20 = call i64 @islower(i8 signext %19)
%21 = icmp eq i64 %20, 0
%22 = select i1 %21, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %22)
%24 = load i8, i8* %1
%25 = call i64 @isupper(i8 signext %24)
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %27)
%29 = load i8, i8* %1
%30 = call i64 @isspace(i8 signext %29)
%31 = icmp eq i64 %30, 0
%32 = select i1 %31, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %32)
%34 = load i8, i8* %1
%35 = call i64 @ispunct(i8 signext %34)
%36 = icmp eq i64 %35, 0
%37 = select i1 %36, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.14, i64 0, i64 0)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %37)
%39 = load i8, i8* %1
%40 = call i64 @islower(i8 signext %39)
%41 = icmp eq i64 %40, 0
%42 = load i8, i8* %1
br i1 %41, label %45, label %43
43: ; preds = %0
%44 = call signext i8 @toupper(i8 signext %42)
br label %47
45: ; preds = %0
%46 = call signext i8 @tolower(i8 signext %42)
br label %47
47: ; preds = %45, %43
%48 = phi i8 [ %44, %43 ], [ %46, %45 ]
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %49)
ret void
}