int main() {
  int b = 1;
  printf("b=%d\n", b);
  int calendar[12][31];
  printf("sizeof = %d\n", sizeof(calendar));
  int a[3];
  int *p = a;
  printf("sizeof(a) = %d,sizeof(int) = %d\n", sizeof a, sizeof(int));
  *a = 84;
  printf("a[0] = %d,*a = %d,*(a+0) = %d,*(0+a) = %d,0[a] = %d\n", a[0], *a,
         *(a + 0), *(0 + a), 0 [a]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x600,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x5d0,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x5ec(%rbp),%rax
mov    %rax,-0x5f8(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x54,-0x5ec(%rbp)
mov    -0x5ec(%rbp),%esi
mov    -0x5ec(%rbp),%edx
mov    -0x5ec(%rbp),%ecx
mov    -0x5ec(%rbp),%r8d
mov    -0x5ec(%rbp),%r9d
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x600,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x5d0,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0xc,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x54,%esi
mov    $0x54,%edx
mov    $0x54,%ecx
mov    $0x54,%r8d
mov    $0x54,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"b=%d\0A\00"
@.str.1 = [13 x i8] c"sizeof = %d\0A\00"
@.str.2 = [33 x i8] c"sizeof(a) = %d,sizeof(int) = %d\0A\00"
@.str.3 = [53 x i8] c"a[0] = %d,*a = %d,*(a+0) = %d,*(0+a) = %d,0[a] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [12 x [31 x i32]]
%4 = alloca [3 x i32]
%5 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 1488)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32* %9, i32** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 4)
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 84, i32* %11
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%15 = load i32, i32* %14
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i32 %13, i32 %15, i32 %18, i32 %21, i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"b=%d\0A\00"
@.str.1 = [13 x i8] c"sizeof = %d\0A\00"
@.str.2 = [33 x i8] c"sizeof(a) = %d,sizeof(int) = %d\0A\00"
@.str.3 = [53 x i8] c"a[0] = %d,*a = %d,*(a+0) = %d,*(0+a) = %d,0[a] = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i64 1488)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i64 12, i64 4)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i32 84, i32 84, i32 84, i32 84, i32 84)
ret i32 0
}