#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*/ printf(char *, char *, char *);
char *totitle(char *);
int main(int argc, char const *argv[]) {
  printf(">%s\n>%s\n", "tHiS iS a rEALy mEsSy sTRING",
         totitle("tHiS iS a rEALy mEsSy sTRING"));
  char str[] = "tHiS iS aNoTeR rEALy mEsSy sTRING";
  printf(">%s\n>%s\n", str, totitle(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <totitle@plt>
mov    %rax,%rdx
lea    0xea4(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x22,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <totitle@plt>
mov    -0x48(%rbp),%rsi
mov    %rax,%rdx
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xedb(%rip),%rbx
mov    %rbx,%rdi
call   1030 <totitle@plt>
lea    0xec3(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x47,0x20(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <totitle@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c">%s\0A>%s\0A\00"
@.str.1 = [29 x i8] c"tHiS iS a rEALy mEsSy sTRING\00"
@__const.main.str = [34 x i8] c"tHiS iS aNoTeR rEALy mEsSy sTRING\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [34 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @totitle(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = bitcast [34 x i8]* %6 to i8*
%10 = getelementptr inbounds [34 x i8], [34 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [34 x i8], [34 x i8]* %6, i64 0, i64 0
%12 = call i8* @totitle(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c">%s\0A>%s\0A\00"
@.str.1 = [29 x i8] c"tHiS iS a rEALy mEsSy sTRING\00"
@__const.main.str = [34 x i8] c"tHiS iS aNoTeR rEALy mEsSy sTRING\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [34 x i8]
%4 = tail call i8* @totitle(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
%7 = call i8* @totitle(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}