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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int zippo[4][2] = {{2, 4}, {6, 8}, {1, 3}, {5, 7}};
  int(*px)[2] = zippo;
  printf("   zippo = %p,    zippo + 1 = %p\n", zippo, zippo + 1);
  printf("zippo[0] = %p, zippo[0] + 1 = %p\n", zippo[0], zippo[0] + 1);
  printf("  *zippo = %p,   *zippo + 1 = %p\n\n", *zippo, *zippo + 1);
  printf("zippo[0][0] = %d\n", zippo[0][0]);
  printf("  *zippo[0] = %d\n", *zippo[0]);
  printf("    **zippo = %d\n", **zippo);
  printf("      zippo[2][1] = %d\n", zippo[2][1]);
  printf("*(*(zippo+2) + 1) = %d\n", *(*(zippo + 2) + 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0x4,%rdx
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0x4,%rdx
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0xef2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rdx
lea    0xee6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%r14
lea    0xeef(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xf09(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xf0a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xf0b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
lea    0xf0b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
lea    0xf11(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.zippo = [4 x [2 x i32]] [[2 x i32] [i32 2, i32 4], [2 x i32] [i32 6, i32 8], [2 x i32] [i32 1, i32 3], [2 x i32] [i32 5, i32 7]]
@.str = [34 x i8] c" zippo = %p, zippo + 1 = %p\0A\00"
@.str.1 = [34 x i8] c"zippo[0] = %p, zippo[0] + 1 = %p\0A\00"
@.str.2 = [35 x i8] c" *zippo = %p, *zippo + 1 = %p\0A\0A\00"
@.str.3 = [18 x i8] c"zippo[0][0] = %d\0A\00"
@.str.4 = [18 x i8] c" *zippo[0] = %d\0A\00"
@.str.5 = [18 x i8] c" **zippo = %d\0A\00"
@.str.6 = [24 x i8] c" zippo[2][1] = %d\0A\00"
@.str.7 = [24 x i8] c"*(*(zippo+2) + 1) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [2 x i32]]
%3 = alloca [2 x i32]*
store i32 0, i32* %1
%4 = bitcast [4 x [2 x i32]]* %2 to i8*
%5 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
store [2 x i32]* %5, [2 x i32]** %3
%6 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), [2 x i32]* %6, [2 x i32]* %8)
%10 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%12 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32* %11, i32* %14)
%16 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 0
%18 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 0, i64 0
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32* %17, i32* %20)
%22 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %22, i64 0, i64 0
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 0, i64 0
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 0
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 2
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %34, i64 0, i64 1
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %2, i64 0, i64 0
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %38, i64 2
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %39, i64 0, i64 0
%41 = getelementptr inbounds i32, i32* %40, i64 1
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 %42)
ret i32 0
}

LLVM IR (-O2):
@__const.main.zippo = [4 x [2 x i32]] [[2 x i32] [i32 2, i32 4], [2 x i32] [i32 6, i32 8], [2 x i32] [i32 1, i32 3], [2 x i32] [i32 5, i32 7]]
@.str = [34 x i8] c" zippo = %p, zippo + 1 = %p\0A\00"
@.str.1 = [34 x i8] c"zippo[0] = %p, zippo[0] + 1 = %p\0A\00"
@.str.2 = [35 x i8] c" *zippo = %p, *zippo + 1 = %p\0A\0A\00"
@.str.3 = [18 x i8] c"zippo[0][0] = %d\0A\00"
@.str.4 = [18 x i8] c" *zippo[0] = %d\0A\00"
@.str.5 = [18 x i8] c" **zippo = %d\0A\00"
@.str.6 = [24 x i8] c" zippo[2][1] = %d\0A\00"
@.str.7 = [24 x i8] c"*(*(zippo+2) + 1) = %d\0A\00"
define i32 @main() {
%1 = alloca [4 x [2 x i32]]
%2 = bitcast [4 x [2 x i32]]* %1 to i8*
%3 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %1, i64 0, i64 1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), [2 x i32]* %3, [2 x i32]* %4)
%6 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %1, i64 0, i64 0, i64 0
%7 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %1, i64 0, i64 0, i64 1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32* %6, i32* %7)
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %1, i64 0, i64 2, i64 1
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %16
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32 %19)
ret i32 0
}