#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 */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printArr(int *, int);
int /*<<< orphan*/ printStr(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char msg[] = "this is a long msg, longer then 4";
  printStr(msg);
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8};
  printf("sizeof(arr) = %d\n", sizeof(arr));
  printArr(arr, sizeof(arr) / sizeof(int));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x22,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1030 <printStr@plt>
mov    0xebc(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xeb6(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x20,%esi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x8,%esi
call   1060 <printArr@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x34,0x20(%rsp)
mov    %rsp,%rdi
call   1030 <printStr@plt>
movaps 0xedf(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xed7(%rip),%rdi
mov    $0x20,%esi
call   1040 <printf@plt>
lea    0x30(%rsp),%rdi
mov    $0x8,%esi
call   1050 <printArr@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.msg = [34 x i8] c"this is a long msg, longer then 4\00"
@__const.main.arr = [8 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [18 x i8] c"sizeof(arr) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [34 x i8]
%3 = alloca [8 x i32]
store i32 0, i32* %1
%4 = bitcast [34 x i8]* %2 to i8*
%5 = getelementptr inbounds [34 x i8], [34 x i8]* %2, i64 0, i64 0
%6 = call i32 @printStr(i8* %5)
%7 = bitcast [8 x i32]* %3 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 32)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 @printArr(i32* %9, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [34 x i8] c"this is a long msg, longer then 4\00"
@__const.main.arr = [8 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [18 x i8] c"sizeof(arr) = %d\0A\00"
define i32 @main() {
%1 = alloca [34 x i8]
%2 = alloca [8 x i32]
%3 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 0
%4 = call i32 @printStr(i8* %3)
%5 = bitcast [8 x i32]* %2 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 32)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%8 = call i32 @printArr(i32* %7, i32 8)
ret i32 0
}