#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 lower(char);
int /*<<< orphan*/ printf(char *, char, int);
int main() {
  char a = 'a';
  char A = 'A';
  char z = 'z';
  char Z = 'Z';
  printf("\n\nInput = %c\nOutput = %c\n\n", a, lower(a));
  printf("Input = %c\nOutput = %c\n\n", A, lower(A));
  printf("Input = %c\nOutput = %c\n\n", z, lower(z));
  printf("Input = %c\nOutput = %c\n\n", Z, lower(Z));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x41,-0x6(%rbp)
movb   $0x7a,-0x7(%rbp)
movb   $0x5a,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0xc(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <lower@plt>
mov    %eax,%edx
mov    -0xc(%rbp),%al
lea    0xea6(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x6(%rbp),%al
mov    %al,-0xb(%rbp)
movsbl -0x6(%rbp),%edi
call   1040 <lower@plt>
mov    %eax,%edx
mov    -0xb(%rbp),%al
lea    0xe85(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x7(%rbp),%al
mov    %al,-0xa(%rbp)
movsbl -0x7(%rbp),%edi
call   1040 <lower@plt>
mov    %eax,%edx
mov    -0xa(%rbp),%al
lea    0xe62(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
movsbl -0x8(%rbp),%edi
call   1040 <lower@plt>
mov    %eax,%edx
mov    -0x9(%rbp),%al
lea    0xe3f(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x61,%edi
call   1040 <lower@plt>
lea    0xece(%rip),%rdi
mov    $0x61,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x41,%edi
call   1040 <lower@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x7a,%edi
call   1040 <lower@plt>
mov    %rbx,%rdi
mov    $0x7a,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x5a,%edi
call   1040 <lower@plt>
mov    %rbx,%rdi
mov    $0x5a,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0A\0AInput = %c\0AOutput = %c\0A\0A\00"
@.str.1 = [25 x i8] c"Input = %c\0AOutput = %c\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
store i8 65, i8* %3
store i8 122, i8* %4
store i8 90, i8* %5
%6 = load i8, i8* %2
%7 = load i8, i8* %2
%8 = call i32 @lower(i8 signext %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext %6, i32 %8)
%10 = load i8, i8* %3
%11 = load i8, i8* %3
%12 = call i32 @lower(i8 signext %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext %10, i32 %12)
%14 = load i8, i8* %4
%15 = load i8, i8* %4
%16 = call i32 @lower(i8 signext %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext %14, i32 %16)
%18 = load i8, i8* %5
%19 = load i8, i8* %5
%20 = call i32 @lower(i8 signext %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext %18, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0A\0AInput = %c\0AOutput = %c\0A\0A\00"
@.str.1 = [25 x i8] c"Input = %c\0AOutput = %c\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @lower(i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 signext 97, i32 %1)
%3 = tail call i32 @lower(i8 signext 65)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext 65, i32 %3)
%5 = tail call i32 @lower(i8 signext 122)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext 122, i32 %5)
%7 = tail call i32 @lower(i8 signext 90)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8 signext 90, i32 %7)
ret i32 0
}