#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 getchar();
int /*<<< orphan*/ printf(char *);
main() {
  char ch;
  int r1, r2, r3;
  printf("Enter a character:\n");
  ch = getchar();
  (ch >= 'A') && (ch <= 'Z')   ? printf("upper")
  : (ch >= 'a') && (ch <= 'z') ? printf("lowercase")
  : (ch >= '0') && (ch <= '9') ? printf("numeric")
                               : printf("special character");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1170 <main+0x50>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1170 <main+0x50>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    11e4 <main+0xc4>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     119e <main+0x7e>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     119e <main+0x7e>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0x18(%rbp)
jmp    11e1 <main+0xc1>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     11cc <main+0xac>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     11cc <main+0xac>
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0x1c(%rbp)
jmp    11db <main+0xbb>
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    -0x41(%rax),%ecx
cmp    $0x1a,%cl
jae    1155 <main+0x25>
lea    0xead(%rip),%rdi
jmp    117c <main+0x4c>
lea    -0x61(%rax),%ecx
cmp    $0x1a,%cl
jae    1166 <main+0x36>
lea    0xea2(%rip),%rdi
jmp    117c <main+0x4c>
add    $0xd0,%al
cmp    $0xa,%al
lea    0xe9f(%rip),%rax
lea    0xea0(%rip),%rdi
cmovb  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter a character:\0A\00"
@.str.1 = [6 x i8] c"upper\00"
@.str.2 = [10 x i8] c"lowercase\00"
@.str.3 = [8 x i8] c"numeric\00"
@.str.4 = [18 x i8] c"special character\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %17
11: ; preds = %0
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 90
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %43
17: ; preds = %11, %0
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 97
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 122
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %41
27: ; preds = %21, %17
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp sge i32 %29, 48
br i1 %30, label %31, label %37
31: ; preds = %27
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp sle i32 %33, 57
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %39
37: ; preds = %31, %27
%38 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
%40 = phi i32 [ %36, %35 ], [ %38, %37 ]
br label %41
41: ; preds = %39, %25
%42 = phi i32 [ %26, %25 ], [ %40, %39 ]
br label %43
43: ; preds = %41, %15
%44 = phi i32 [ %16, %15 ], [ %42, %41 ]
%45 = load i32, i32* %1
ret i32 %45
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"upper\00"
@.str.2 = [10 x i8] c"lowercase\00"
@.str.3 = [8 x i8] c"numeric\00"
@.str.4 = [18 x i8] c"special character\00"
@str = [19 x i8] c"Enter a character:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %12, label %5
5: ; preds = %0
%6 = add i8 %2, -97
%7 = icmp ult i8 %6, 26
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = add i8 %2, -48
%10 = icmp ult i8 %9, 10
%11 = select i1 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0)
br label %12
12: ; preds = %8, %5, %0
%13 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %0 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %5 ], [ %11, %8 ]
%14 = tail call i32 @printf(i8* dereferenceable(1) %13)
ret i32 0
}