#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*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int a[5] = {2, 4, 5, 7, 10};
  printf("sizeof a=%d,a[0]=%d,a[5]=%d,a[6]=%d\n", sizeof(a), sizeof(a[0]),
         sizeof(a[5]), sizeof(a[6]));
  int *p = a;
  char *pc = "abcd";
  printf("&a[0]:%p,&a[1]:%p,&a[2]:%p\n", &a[0], &a[1], &a[2]);
  printf("&pc[0]:%p,&pc[1]:%p,&pc[2]:%p", &pc[0], &pc[1], &pc[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x14,%esi
mov    $0x4,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xed4(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x4,%rdx
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x30(%rbp),%rdx
add    $0x1,%rdx
mov    -0x30(%rbp),%rcx
add    $0x2,%rcx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee4(%rip),%rdi
mov    $0x14,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xee1(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0xec4(%rip),%rsi
lea    0xebe(%rip),%rdx
lea    0xeb8(%rip),%rcx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 2, i32 4, i32 5, i32 7, i32 10]
@.str = [37 x i8] c"sizeof a=%d,a[0]=%d,a[5]=%d,a[6]=%d\0A\00"
@.str.1 = [5 x i8] c"abcd\00"
@.str.2 = [28 x i8] c"&a[0]:%p,&a[1]:%p,&a[2]:%p\0A\00"
@.str.3 = [30 x i8] c"&pc[0]:%p,&pc[1]:%p,&pc[2]:%p\00"
define void @main() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = alloca i8*
%4 = bitcast [5 x i32]* %1 to i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 20, i64 4, i64 4, i64 4)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32* %6, i32** %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32* %7, i32* %8, i32* %9)
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %12, i8* %14, i8* %16)
ret void
}

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 2, i32 4, i32 5, i32 7, i32 10]
@.str = [37 x i8] c"sizeof a=%d,a[0]=%d,a[5]=%d,a[6]=%d\0A\00"
@.str.1 = [5 x i8] c"abcd\00"
@.str.2 = [28 x i8] c"&a[0]:%p,&a[1]:%p,&a[2]:%p\0A\00"
@.str.3 = [30 x i8] c"&pc[0]:%p,&pc[1]:%p,&pc[2]:%p\00"
define void @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 20, i64 4, i64 4, i64 4)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 1), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 2))
ret void
}