#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 main() {
  char c;
  printf("Enter a character: ");
  scanf("%c", &c);
  if (c >= 'A' && c <= 'Z') {
    printf("%c is an uppercase character.\n", c);
  } else if (c >= 'a' && c <= 'z') {
    printf("%c is a lowercase character.\n", c);
  } else if (c >= '0' && c <= '9') {
    printf("%c is a digit.\n", c);
  } else {
    printf("%c is a special character.\n", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     117e <main+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     117e <main+0x5e>
movsbl -0x5(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <main+0xdc>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     11af <main+0x8f>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     11af <main+0x8f>
movsbl -0x5(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     11e0 <main+0xc0>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     11e0 <main+0xc0>
movsbl -0x5(%rbp),%esi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <main+0xd2>
movsbl -0x5(%rbp),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
jmp    11fc <main+0xdc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    -0x41(%rsi),%eax
cmp    $0x1a,%al
jae    1155 <main+0x35>
lea    0xec4(%rip),%rdi
jmp    117c <main+0x5c>
lea    -0x61(%rsi),%eax
cmp    $0x1a,%al
jae    1165 <main+0x45>
lea    0xed3(%rip),%rdi
jmp    117c <main+0x5c>
lea    -0x30(%rsi),%eax
cmp    $0xa,%al
lea    0xee3(%rip),%rax
lea    0xeec(%rip),%rdi
cmovb  %rax,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"Enter a character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [31 x i8] c"%c is an uppercase character.\0A\00"
@.str.3 = [30 x i8] c"%c is a lowercase character.\0A\00"
@.str.4 = [16 x i8] c"%c is a digit.\0A\00"
@.str.5 = [28 x i8] c"%c is a special character.\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
br i1 %6, label %14, label %7
7: ; preds = %0
%8 = add i8 %4, -97
%9 = icmp ult i8 %8, 26
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = add i8 %4, -48
%12 = icmp ult i8 %11, 10
%13 = select i1 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0)
br label %14
14: ; preds = %10, %7, %0
%15 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), %7 ], [ %13, %10 ]
%16 = sext i8 %4 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %15, i32 %16)
ret i32 0
}