int main() {
  char myString[] = "Adam likes dogs.";
  char *name = "Rick";
  int nums[] = {1, 6, 3, 8};
  int *newNums = malloc(sizeof(int) * 4);
  memcpy(newNums, nums, sizeof(int) * 4);
  memcpy(myString[0], name, sizeof(char) * 4);
  printf("%s\n", myString);
  for (int i = 0; i < 3; i++)
    printf("%i\n", newNums[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%al
mov    %al,-0x10(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x38(%rbp),%rcx
mov    %rcx,0x8(%rax)
movsbq -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
lea    -0x20(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0x3,-0x4c(%rbp)
jge    11e7 <main+0xc7>
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11b6 <main+0x96>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x6b636952,0x41
52 69 63 6b
mov    %rsp,%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.myString = [17 x i8] c"Adam likes dogs.\00"
@.str = [5 x i8] c"Rick\00"
@__const.main.nums = [4 x i32] [i32 1, i32 6, i32 3, i32 8]
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
%3 = alloca i8*
%4 = alloca [4 x i32]
%5 = alloca i32*
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [17 x i8]* %2 to i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
%8 = bitcast [4 x i32]* %4 to i8*
%9 = call i8* @malloc(i64 16)
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = bitcast i32* %11 to i8*
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%14 = bitcast i32* %13 to i8*
%15 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = load i8*, i8** %3
%20 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %20)
store i32 0, i32* %6
br label %22
22: ; preds = %32, %0
%23 = load i32, i32* %6
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i32*, i32** %5
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %25
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %22
35: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@__const.main.myString = [17 x i8] c"Adam likes dogs.\00"
@.str.2 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
store i32 1801677138, i32* inttoptr (i64 65 to i32*)
%3 = call i32 @puts(i8* %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 6)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret i32 0
}