#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int toascii(char);
void main() {
  char ch;
  int a;
  printf("Enter any character: ");
  scanf("%c", &ch);
  a = toascii(ch);
  if (a >= 33 && a <= 64) {
    printf("You've entered a special character");
  }
  if (a >= 65 && a <= 90) {
    printf("You've entered an uppercase letter");
  }
  if (a >= 97 && a <= 122) {
    printf("You've entered a lowercase letter");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%edi
call   1050 <toascii@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x21,-0x8(%rbp)
jl     1180 <main+0x50>
cmpl   $0x40,-0x8(%rbp)
jg     1180 <main+0x50>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x41,-0x8(%rbp)
jl     11a0 <main+0x70>
cmpl   $0x5a,-0x8(%rbp)
jg     11a0 <main+0x70>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x61,-0x8(%rbp)
jl     11c0 <main+0x90>
cmpl   $0x7a,-0x8(%rbp)
jg     11c0 <main+0x90>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1050 <toascii@plt>
lea    -0x21(%rax),%ecx
cmp    $0x20,%ecx
jae    1169 <main+0x39>
lea    0xeb2(%rip),%rdi
jmp    1189 <main+0x59>
lea    -0x41(%rax),%ecx
cmp    $0x1a,%ecx
jae    117a <main+0x4a>
lea    0xec4(%rip),%rdi
jmp    1189 <main+0x59>
add    $0xffffff9f,%eax
cmp    $0x19,%eax
ja     118e <main+0x5e>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter any character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [35 x i8] c"You've entered a special character\00"
@.str.3 = [35 x i8] c"You've entered an uppercase letter\00"
@.str.4 = [34 x i8] c"You've entered a lowercase letter\00"
define void @main() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 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 i32 @toascii(i8 signext %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 33
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 64
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %9, %0
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %17, %14
%23 = load i32, i32* %2
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = load i32, i32* %2
%27 = icmp sle i32 %26, 122
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %30
30: ; preds = %28, %25, %22
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter any character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [35 x i8] c"You've entered a special character\00"
@.str.3 = [35 x i8] c"You've entered an uppercase letter\00"
@.str.4 = [34 x i8] c"You've entered a lowercase letter\00"
define void @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 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 i32 @toascii(i8 signext %4)
%6 = add i32 %5, -33
%7 = icmp ult i32 %6, 32
br i1 %7, label %14, label %8
8: ; preds = %0
%9 = add i32 %5, -65
%10 = icmp ult i32 %9, 26
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = add i32 %5, -97
%13 = icmp ult i32 %12, 26
br i1 %13, label %14, label %17
14: ; preds = %11, %8, %0
%15 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), %11 ]
%16 = call i32 @printf(i8* dereferenceable(1) %15)
br label %17
17: ; preds = %14, %11
ret void
}