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

/* Variables and functions */
int /*<<< orphan*/ caveat(int *, char *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int three[3] = {1, 2, 3};
  char hello[5] = "hello";
  printf("items in three: %d / %d = %d\n", (int)sizeof(three),
         (int)sizeof(three[0]), (int)(sizeof(three) / sizeof((three)[0])));
  printf("items in hello: %d / %d = %d\n", (int)sizeof(hello),
         (int)sizeof(hello[0]), (int)(sizeof(hello) / sizeof((hello)[0])));
  caveat(three, hello);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xeca(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xec5(%rip),%al
mov    %al,-0xd(%rbp)
lea    0xebc(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
mov    $0x3,%ecx
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x5,%ecx
mov    $0x1,%edx
mov    %ecx,%esi
call   1040 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    -0x11(%rbp),%rsi
call   1030 <caveat@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
movb   $0x6f,0x4(%rsp)
movl   $0x6c6c6568,(%rsp)
lea    0xec4(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
mov    $0x3,%ecx
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    $0x5,%ecx
call   1040 <printf@plt>
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <caveat@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.three = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.hello = [5 x i8] c"hello"
@.str = [30 x i8] c"items in three: %d / %d = %d\0A\00"
@.str.1 = [30 x i8] c"items in hello: %d / %d = %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [5 x i8]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [5 x i8]* %2 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 12, i32 4, i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 1, i32 5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%9 = call i32 @caveat(i32* %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.three = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.hello = [5 x i8] c"hello"
@.str = [30 x i8] c"items in three: %d / %d = %d\0A\00"
@.str.1 = [30 x i8] c"items in hello: %d / %d = %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [5 x i8]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 12, i32 4, i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 1, i32 5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = call i32 @caveat(i32* %7, i8* %4)
ret i32 0
}