#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__ islower(char);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *,
                          char *, char *, char *, ...);
int /*<<< orphan*/ tolower(char);
char *toupper(char);
int main(void) {
  printf("%s\n%s%s\n%s%s\n%s%s\n%s%s\n\n",
         "According to islower:", islower('p') ? "p is a " : "p is not a ",
         "lowercase letter", islower('P') ? "P is a " : "P is not a ",
         "lowercase letter", islower('5') ? "5 is a " : "5 is not a ",
         "lowercase letter", islower('!') ? "! is a " : "! is not a ",
         "lowercase letter");
  printf("%s\n%s%s\n%s%s\n%s%s\n%s%s\n\n",
         "According to isupper:", isupper('D') ? "D is an " : "D is not an ",
         "uppercase letter", isupper('d') ? "d is an " : "d is not an ",
         "uppercase letter", isupper('8') ? "8 is an " : "8 is not an ",
         "uppercase letter", isupper('$') ? "$ is an " : "$ is not an ",
         "uppercase letter");
  printf("%s%c\n%s%c\n%s%c\n%s%c\n", "u converted to uppercase is ",
         toupper('u'), "7 converted to uppercase is ", toupper('7'),
         "$ converted to uppercase is ", toupper('$'),
         "L converted to lowercase is ", tolower('L'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x70,%edi
call   1030 <islower@plt>
mov    %rax,%rdx
lea    0xec4(%rip),%rax
lea    0xeb5(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    $0x50,%edi
call   1030 <islower@plt>
mov    %rax,%rdx
lea    0xec2(%rip),%rax
lea    0xeb3(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    $0x35,%edi
call   1030 <islower@plt>
mov    %rax,%rdx
lea    0xeaf(%rip),%rax
lea    0xea0(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    $0x21,%edi
call   1030 <islower@plt>
mov    -0x50(%rbp),%rdx
mov    -0x48(%rbp),%r8
mov    -0x40(%rbp),%r11
mov    %rax,%rcx
lea    0xe90(%rip),%r10
lea    0xe81(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%r10
lea    0xdf6(%rip),%rdi
lea    0xe08(%rip),%rsi
lea    0xe2b(%rip),%rax
mov    %rax,%rcx
mov    %rax,%r9
mov    %r11,(%rsp)
mov    %rax,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x44,%edi
call   1070 <isupper@plt>
mov    %rax,%rdx
lea    0xe63(%rip),%rax
lea    0xe53(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    $0x64,%edi
call   1070 <isupper@plt>
mov    %rax,%rdx
lea    0xe63(%rip),%rax
lea    0xe53(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    $0x38,%edi
call   1070 <isupper@plt>
mov    %rax,%rdx
lea    0xe52(%rip),%rax
lea    0xe42(%rip),%rcx
cmp    $0x0,%rdx
cmovne %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    $0x24,%edi
call   1070 <isupper@plt>
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%r8
mov    -0x28(%rbp),%r11
mov    %rax,%rcx
lea    0xe35(%rip),%r10
lea    0xe25(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%r10
lea    0xd1d(%rip),%rdi
lea    0xda6(%rip),%rsi
lea    0xdcb(%rip),%rax
mov    %rax,%rcx
mov    %rax,%r9
mov    %r11,(%rsp)
mov    %rax,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x75,%edi
call   1040 <toupper@plt>
mov    %rax,-0x20(%rbp)
mov    $0x37,%edi
call   1040 <toupper@plt>
mov    %rax,-0x18(%rbp)
mov    $0x24,%edi
call   1040 <toupper@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4c,%edi
call   1060 <tolower@plt>
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%r8
mov    -0x10(%rbp),%r11
cltq
lea    0xdb5(%rip),%rdi
lea    0xdc3(%rip),%rsi
lea    0xdd9(%rip),%rcx
lea    0xdef(%rip),%r9
lea    0xe05(%rip),%r10
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x70,%edi
call   1030 <islower@plt>
test   %rax,%rax
lea    0xeca(%rip),%rax
lea    0xebb(%rip),%r15
cmove  %rax,%r15
mov    $0x50,%edi
call   1030 <islower@plt>
test   %rax,%rax
lea    0xed0(%rip),%rax
lea    0xec1(%rip),%r12
cmove  %rax,%r12
mov    $0x35,%edi
call   1030 <islower@plt>
test   %rax,%rax
lea    0xec5(%rip),%rax
lea    0xeb6(%rip),%r13
cmove  %rax,%r13
mov    $0x21,%edi
call   1030 <islower@plt>
test   %rax,%rax
lea    0xeba(%rip),%rax
lea    0xeab(%rip),%rbx
cmove  %rax,%rbx
lea    0xe67(%rip),%rcx
lea    0xe1d(%rip),%r14
lea    0xe2f(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
mov    %r12,%r8
mov    %rcx,%r9
xor    %eax,%eax
push   %rcx
push   %rbx
push   %rcx
push   %r13
call   1050 <printf@plt>
add    $0x20,%rsp
mov    $0x44,%edi
call   1070 <isupper@plt>
test   %rax,%rax
lea    0xe95(%rip),%rax
lea    0xe85(%rip),%r15
cmove  %rax,%r15
mov    $0x64,%edi
call   1070 <isupper@plt>
test   %rax,%rax
lea    0xe9d(%rip),%rax
lea    0xe8d(%rip),%r12
cmove  %rax,%r12
mov    $0x38,%edi
call   1070 <isupper@plt>
test   %rax,%rax
lea    0xe94(%rip),%rax
lea    0xe84(%rip),%r13
cmove  %rax,%r13
mov    $0x24,%edi
call   1070 <isupper@plt>
test   %rax,%rax
lea    0xe8b(%rip),%rax
lea    0xe7b(%rip),%rbx
cmove  %rax,%rbx
lea    0xe33(%rip),%rcx
lea    0xe00(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
mov    %r12,%r8
mov    %rcx,%r9
xor    %eax,%eax
push   %rcx
push   %rbx
push   %rcx
push   %r13
call   1050 <printf@plt>
add    $0x20,%rsp
mov    $0x75,%edi
call   1040 <toupper@plt>
mov    %rax,%r14
mov    $0x37,%edi
call   1040 <toupper@plt>
mov    %rax,%r12
mov    $0x24,%edi
call   1040 <toupper@plt>
mov    %rax,%r15
mov    $0x4c,%edi
call   1060 <tolower@plt>
movslq %eax,%rbx
sub    $0x8,%rsp
lea    0xe90(%rip),%r10
lea    0xe1d(%rip),%rdi
lea    0xe2b(%rip),%rsi
lea    0xe41(%rip),%rcx
lea    0xe57(%rip),%r9
mov    %r14,%rdx
mov    %r12,%r8
xor    %eax,%eax
push   %rbx
push   %r10
push   %r15
call   1050 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%s\0A%s%s\0A%s%s\0A%s%s\0A%s%s\0A\0A\00"
@.str.1 = [22 x i8] c"According to islower:\00"
@.str.2 = [8 x i8] c"p is a \00"
@.str.3 = [12 x i8] c"p is not a \00"
@.str.4 = [17 x i8] c"lowercase letter\00"
@.str.5 = [8 x i8] c"P is a \00"
@.str.6 = [12 x i8] c"P is not a \00"
@.str.7 = [8 x i8] c"5 is a \00"
@.str.8 = [12 x i8] c"5 is not a \00"
@.str.9 = [8 x i8] c"! is a \00"
@.str.10 = [12 x i8] c"! is not a \00"
@.str.11 = [22 x i8] c"According to isupper:\00"
@.str.12 = [9 x i8] c"D is an \00"
@.str.13 = [13 x i8] c"D is not an \00"
@.str.14 = [17 x i8] c"uppercase letter\00"
@.str.15 = [9 x i8] c"d is an \00"
@.str.16 = [13 x i8] c"d is not an \00"
@.str.17 = [9 x i8] c"8 is an \00"
@.str.18 = [13 x i8] c"8 is not an \00"
@.str.19 = [9 x i8] c"$ is an \00"
@.str.20 = [13 x i8] c"$ is not an \00"
@.str.21 = [21 x i8] c"%s%c\0A%s%c\0A%s%c\0A%s%c\0A\00"
@.str.22 = [29 x i8] c"u converted to uppercase is \00"
@.str.23 = [29 x i8] c"7 converted to uppercase is \00"
@.str.24 = [29 x i8] c"$ converted to uppercase is \00"
@.str.25 = [29 x i8] c"L converted to lowercase is \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @islower(i8 signext 112)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0)
%6 = call i64 @islower(i8 signext 80)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0)
%10 = call i64 @islower(i8 signext 53)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0)
%14 = call i64 @islower(i8 signext 33)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0)
%18 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %17, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%19 = call i64 @isupper(i8 signext 68)
%20 = icmp ne i64 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0)
%23 = call i64 @isupper(i8 signext 100)
%24 = icmp ne i64 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0)
%27 = call i64 @isupper(i8 signext 56)
%28 = icmp ne i64 %27, 0
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0)
%31 = call i64 @isupper(i8 signext 36)
%32 = icmp ne i64 %31, 0
%33 = zext i1 %32 to i64
%34 = select i1 %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0)
%35 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* %22, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %26, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %30, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %34, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
%36 = call i8* @toupper(i8 signext 117)
%37 = call i8* @toupper(i8 signext 55)
%38 = call i8* @toupper(i8 signext 36)
%39 = call i32 @tolower(i8 signext 76)
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i8*
%42 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.22, i64 0, i64 0), i8* %36, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0), i8* %37, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.24, i64 0, i64 0), i8* %38, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.25, i64 0, i64 0), i8* %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s\0A%s%s\0A%s%s\0A%s%s\0A%s%s\0A\0A\00"
@.str.1 = [22 x i8] c"According to islower:\00"
@.str.2 = [8 x i8] c"p is a \00"
@.str.3 = [12 x i8] c"p is not a \00"
@.str.4 = [17 x i8] c"lowercase letter\00"
@.str.5 = [8 x i8] c"P is a \00"
@.str.6 = [12 x i8] c"P is not a \00"
@.str.7 = [8 x i8] c"5 is a \00"
@.str.8 = [12 x i8] c"5 is not a \00"
@.str.9 = [8 x i8] c"! is a \00"
@.str.10 = [12 x i8] c"! is not a \00"
@.str.11 = [22 x i8] c"According to isupper:\00"
@.str.12 = [9 x i8] c"D is an \00"
@.str.13 = [13 x i8] c"D is not an \00"
@.str.14 = [17 x i8] c"uppercase letter\00"
@.str.15 = [9 x i8] c"d is an \00"
@.str.16 = [13 x i8] c"d is not an \00"
@.str.17 = [9 x i8] c"8 is an \00"
@.str.18 = [13 x i8] c"8 is not an \00"
@.str.19 = [9 x i8] c"$ is an \00"
@.str.20 = [13 x i8] c"$ is not an \00"
@.str.21 = [21 x i8] c"%s%c\0A%s%c\0A%s%c\0A%s%c\0A\00"
@.str.22 = [29 x i8] c"u converted to uppercase is \00"
@.str.23 = [29 x i8] c"7 converted to uppercase is \00"
@.str.24 = [29 x i8] c"$ converted to uppercase is \00"
@.str.25 = [29 x i8] c"L converted to lowercase is \00"
define i32 @main() {
%1 = tail call i64 @islower(i8 signext 112)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i64 @islower(i8 signext 80)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0)
%7 = tail call i64 @islower(i8 signext 53)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0)
%10 = tail call i64 @islower(i8 signext 33)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0)
%13 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i64 @isupper(i8 signext 68)
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0)
%17 = tail call i64 @isupper(i8 signext 100)
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0)
%20 = tail call i64 @isupper(i8 signext 56)
%21 = icmp eq i64 %20, 0
%22 = select i1 %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0)
%23 = tail call i64 @isupper(i8 signext 36)
%24 = icmp eq i64 %23, 0
%25 = select i1 %24, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0)
%26 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8* %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %22, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i8* %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
%27 = tail call i8* @toupper(i8 signext 117)
%28 = tail call i8* @toupper(i8 signext 55)
%29 = tail call i8* @toupper(i8 signext 36)
%30 = tail call i32 @tolower(i8 signext 76)
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i8*
%33 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.22, i64 0, i64 0), i8* %27, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0), i8* %28, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.24, i64 0, i64 0), i8* %29, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.25, i64 0, i64 0), i8* %32)
ret i32 0
}