int main() {
  char kid1[12];
  char kid2[] = "Maddie";
  char kid3[7] = "Andrew";
  char hero1 = "Batman";
  char hero2[34] = "spiderman";
  char hero3[25];
  kid1[0] = 'K';
  kid1[1] = 'a';
  kid1[2] = 't';
  kid1[3] = 'i';
  kid1[4] = 'e';
  kid1[5] = '\0';
  strcpy(hero3, "the incredible hulk");
  printf("%s\'s favorite hero is %s.\n", kid1, hero1);
  printf("%s\'s favorite hero is %s.\n", kid2, hero2);
  printf("%s\'s favorite hero is %s.\n", kid3, hero3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xead(%rip),%al
mov    %al,-0x11(%rbp)
mov    0xea5(%rip),%eax
mov    %eax,-0x1e(%rbp)
mov    0xe9f(%rip),%ax
mov    %ax,-0x1a(%rbp)
mov    0xe97(%rip),%al
mov    %al,-0x18(%rbp)
lea    0xe8e(%rip),%rax
mov    %al,-0x1f(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x22,%edx
call   1050 <memcpy@plt>
movb   $0x4b,-0x10(%rbp)
movb   $0x61,-0xf(%rbp)
movb   $0x74,-0xe(%rbp)
movb   $0x69,-0xd(%rbp)
movb   $0x65,-0xc(%rbp)
movb   $0x0,-0xb(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x10(%rbp),%rsi
movsbl -0x1f(%rbp),%edx
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x17(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1e(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
movl   $0x656964,0xf(%rsp)
movl   $0x6464614d,0xc(%rsp)
64
movl   $0x776572,0x7(%rsp)
movl   $0x72646e41,0x4(%rsp)
72
movaps 0xf24(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf08(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movw   $0x0,0x60(%rsp)
movl   $0x6974614b,0x14(%rsp)
69
movw   $0x65,0x18(%rsp)
movups 0xeab(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x6b6c75,0x30(%rsp)
lea    0xe90(%rip),%rax
movsbl %al,%edx
lea    0xea1(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
lea    0x40(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
lea    0x20(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.kid2 = [7 x i8] c"Maddie\00"
@__const.main.kid3 = [7 x i8] c"Andrew\00"
@.str = [7 x i8] c"Batman\00"
@__const.main.hero2 = [34 x i8] c"spiderman\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [20 x i8] c"the incredible hulk\00"
@.str.2 = [27 x i8] c"%s's favorite hero is %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca [7 x i8]
%4 = alloca [7 x i8]
%5 = alloca i8
%6 = alloca [34 x i8]
%7 = alloca [25 x i8]
store i32 0, i32* %1
%8 = bitcast [7 x i8]* %3 to i8*
%9 = bitcast [7 x i8]* %4 to i8*
store i8 ptrtoint ([7 x i8]* @.str to i8), i8* %5
%10 = bitcast [34 x i8]* %6 to i8*
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
store i8 75, i8* %11
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 1
store i8 97, i8* %12
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 2
store i8 116, i8* %13
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 3
store i8 105, i8* %14
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 4
store i8 101, i8* %15
%16 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 5
store i8 0, i8* %16
%17 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%18 = call i8* @strcpy(i8* %17, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%19 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%20 = load i8, i8* %5
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %19, i32 %21)
%23 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%24 = getelementptr inbounds [34 x i8], [34 x i8]* %6, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %23, i8* %24)
%26 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%27 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %26, i8* %27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.kid2 = [7 x i8] c"Maddie\00"
@__const.main.kid3 = [7 x i8] c"Andrew\00"
@.str = [7 x i8] c"Batman\00"
@__const.main.hero2 = [34 x i8] c"spiderman\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [20 x i8] c"the incredible hulk\00"
@.str.2 = [27 x i8] c"%s's favorite hero is %s.\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [7 x i8]
%3 = alloca [7 x i8]
%4 = alloca [34 x i8]
%5 = alloca [25 x i8]
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [34 x i8], [34 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %5, i64 0, i64 0
store i8 75, i8* %6
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 1
store i8 97, i8* %11
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 2
store i8 116, i8* %12
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 3
store i8 105, i8* %13
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 4
store i8 101, i8* %14
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 5
store i8 0, i8* %15
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 sext (i8 ptrtoint ([7 x i8]* @.str to i8) to i32))
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %9)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %8, i8* %10)
ret i32 0
}