#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*/ makeLowerCase(char *);
char makeUpperCase(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char stephenCharacter = '\0';
  printf("\nEnter Single Character: ");
  scanf("%c", &stephenCharacter);
  printf("\nYou entered character: %c", stephenCharacter);
  printf("\nCharacter + 1 = %c", stephenCharacter + 1);
  printf("\n\nGenerating upper or lower case version....\n");
  if (stephenCharacter >= 65 && stephenCharacter <= 90)
    makeLowerCase(&stephenCharacter);
  else if (stephenCharacter >= 97 && stephenCharacter <= 122)
    stephenCharacter = makeUpperCase(stephenCharacter);
  else
    printf("\nUnable to make character  Please try again.");
  printf("\nUpper-to-Lower Case Conversation used a pointer.");
  printf("\nLower-to-Upper Case Conversation used a returned value.");
  printf("\nReturned character value of function (should the altered version): "
         "%c\n",
         stephenCharacter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsbl -0x5(%rbp),%esi
add    $0x1,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     11ce <main+0x8e>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11ce <main+0x8e>
lea    -0x5(%rbp),%rdi
call   1040 <makeLowerCase@plt>
jmp    120c <main+0xcc>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     11f9 <main+0xb9>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     11f9 <main+0xb9>
movsbl -0x5(%rbp),%edi
call   1030 <makeUpperCase@plt>
mov    %al,-0x5(%rbp)
jmp    1207 <main+0xc7>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    120c <main+0xcc>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsbl -0x5(%rbp),%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1070 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%esi
add    $0x1,%esi
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf84(%rip),%rdi
call   1040 <puts@plt>
mov    0x7(%rsp),%al
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     11c2 <main+0x72>
lea    0x7(%rsp),%rdi
call   1050 <makeLowerCase@plt>
jmp    11e6 <main+0x96>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     11d8 <main+0x88>
movsbl %al,%edi
call   1030 <makeUpperCase@plt>
mov    %al,0x7(%rsp)
jmp    11e6 <main+0x96>
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movsbl 0x7(%rsp),%esi
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0AEnter Single Character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [27 x i8] c"\0AYou entered character: %c\00"
@.str.3 = [20 x i8] c"\0ACharacter + 1 = %c\00"
@.str.4 = [46 x i8] c"\0A\0AGenerating upper or lower case version....\0A\00"
@.str.5 = [45 x i8] c"\0AUnable to make character Please try again.\00"
@.str.6 = [50 x i8] c"\0AUpper-to-Lower Case Conversation used a pointer.\00"
@.str.7 = [57 x i8] c"\0ALower-to-Upper Case Conversation used a returned value.\00"
@.str.8 = [72 x i8] c"\0AReturned character value of function (should the altered version): %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, 1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %22
16: ; preds = %0
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @makeLowerCase(i8* %2)
br label %36
22: ; preds = %16, %0
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %24, 97
br i1 %25, label %26, label %33
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 122
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i8, i8* %2
%32 = call signext i8 @makeUpperCase(i8 signext %31)
store i8 %32, i8* %2
br label %35
33: ; preds = %26, %22
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
br label %36
36: ; preds = %35, %20
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
%39 = load i8, i8* %2
%40 = sext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.8, i64 0, i64 0), i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AEnter Single Character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [27 x i8] c"\0AYou entered character: %c\00"
@.str.3 = [20 x i8] c"\0ACharacter + 1 = %c\00"
@.str.5 = [45 x i8] c"\0AUnable to make character Please try again.\00"
@.str.6 = [50 x i8] c"\0AUpper-to-Lower Case Conversation used a pointer.\00"
@.str.7 = [57 x i8] c"\0ALower-to-Upper Case Conversation used a returned value.\00"
@.str.8 = [72 x i8] c"\0AReturned character value of function (should the altered version): %c\0A\00"
@str = [45 x i8] c"\0A\0AGenerating upper or lower case version....\00"
define i32 @main() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 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 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, 1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%12 = load i8, i8* %1
%13 = add i8 %12, -65
%14 = icmp ult i8 %13, 26
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 @makeLowerCase(i8* %1)
br label %24
17: ; preds = %0
%18 = add i8 %12, -97
%19 = icmp ult i8 %18, 26
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call signext i8 @makeUpperCase(i8 signext %12)
store i8 %21, i8* %1
br label %24
22: ; preds = %17
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
br label %24
24: ; preds = %20, %22, %15
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
%27 = load i8, i8* %1
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.8, i64 0, i64 0), i32 %28)
ret i32 0
}