#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 */
char lowercase(char);
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char c;
  c = lowercase('a');
  printf("%c\n", c);
  c = lowercase('h');
  printf("%c\n", c);
  c = lowercase('A');
  printf("%c\n", c);
  c = lowercase('{');
  printf("%c\n", c);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1040 <lowercase@plt>
mov    %al,-0x5(%rbp)
lea    0xebd(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    $0x68,%edi
call   1040 <lowercase@plt>
mov    %al,-0x5(%rbp)
lea    0xea0(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    $0x41,%edi
call   1040 <lowercase@plt>
mov    %al,-0x5(%rbp)
lea    0xe83(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    $0x7b,%edi
call   1040 <lowercase@plt>
mov    %al,-0x5(%rbp)
lea    0xe66(%rip),%rdi
movsbl -0x5(%rbp),%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 <lowercase@plt>
movsbl %al,%esi
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x68,%edi
call   1040 <lowercase@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x41,%edi
call   1040 <lowercase@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x7b,%edi
call   1040 <lowercase@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 @lowercase(i8 signext 97)
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = call signext i8 @lowercase(i8 signext 104)
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = call signext i8 @lowercase(i8 signext 65)
store i8 %9, i8* %2
%10 = load i8, i8* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = call signext i8 @lowercase(i8 signext 123)
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %13)
ret i32 0
}

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