#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 ch;
  printf("please input an character:");
  scanf("%c", &ch);
  ch >= 65 && ch <= 90    ? printf("upper")
  : ch >= 97 && ch <= 122 ? printf("lower")
                          : printf("others");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1176 <main+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1176 <main+0x56>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x96>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     11a4 <main+0x84>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     11a4 <main+0x84>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0xc(%rbp)
jmp    11b3 <main+0x93>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
lea    -0x41(%rax),%ecx
add    $0x9f,%al
cmp    $0x1a,%al
lea    0xed4(%rip),%rax
lea    0xed3(%rip),%rdx
cmovb  %rax,%rdx
cmp    $0x1a,%cl
lea    0xeb9(%rip),%rdi
cmovae %rdx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"please input an character:\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [6 x i8] c"upper\00"
@.str.3 = [6 x i8] c"lower\00"
@.str.4 = [7 x i8] c"others\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @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* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %14
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 %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %28
14: ; preds = %8, %0
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 97
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 122
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %26
24: ; preds = %18, %14
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
br label %28
28: ; preds = %26, %12
%29 = phi i32 [ %13, %12 ], [ %27, %26 ]
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"please input an character:\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [6 x i8] c"upper\00"
@.str.3 = [6 x i8] c"lower\00"
@.str.4 = [7 x i8] c"others\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @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 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = add i8 %4, -97
%8 = icmp ult i8 %7, 26
%9 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%10 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %9
%11 = call i32 @printf(i8* dereferenceable(1) %10)
ret i32 0
}