int main() {
  char upper[20] = {"upper"};
  char lower[20] = {"LOWER"};
  convert_upper(upper);
  printf("upper: %s\n", upper);
  convert_lower(lower);
  printf("lower: %s\n", lower);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeb6(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <convert_upper@plt>
lea    -0x20(%rbp),%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <convert_lower@plt>
lea    -0x40(%rbp),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x0,0x30(%rsp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <convert_upper@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <convert_lower@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.upper = [20 x i8] c"upper\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.lower = [20 x i8] c"LOWER\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [11 x i8] c"upper: %s\0A\00"
@.str.1 = [11 x i8] c"lower: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = bitcast [20 x i8]* %2 to i8*
%5 = bitcast [20 x i8]* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @convert_upper to i32 (i8*, ...)*)(i8* %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @convert_lower to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.upper = [20 x i8] c"upper\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.lower = [20 x i8] c"LOWER\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [11 x i8] c"upper: %s\0A\00"
@.str.1 = [11 x i8] c"lower: %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @convert_upper to i32 (i8*, ...)*)(i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @convert_lower to i32 (i8*, ...)*)(i8* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}