#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() {
  int a[3][5] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
  int *p;
  int i = 0;
  int j = 0;
  printf("\nwhole double sized array a:\n");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 5; j++) {
      printf("%2d ", a[i][j]);
    }
    printf("\n");
  }
  printf("\n* ( * ( a + 1 ) + 2 ) = %2d;\n", *(*(a + 1) + 2));
  printf("* ( * ( a + 2 ) + 2 ) = %d;\n", *(*(a + 2) + 2));
  printf("* ( * ( a + 2 ) + 3 ) = %d;\n", *(*(a + 2) + 3));
  printf("* ( * a + 3 ) = %d;\n", *(*a + 3));
  printf("\nfirst elements of strings:\n\n");
  for (i = 0; i < 3; i++) {
    printf("* ( ( * a ) + ROW * ( i = %d ) ) = %2d;\n", i, *((*a) + 5 * i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0x3,-0x4c(%rbp)
jge    11d0 <main+0xb0>
movl   $0x0,-0x50(%rbp)
cmpl   $0x5,-0x50(%rbp)
jge    11b4 <main+0x94>
movslq -0x4c(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1178 <main+0x58>
lea    0xf2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1167 <main+0x47>
mov    -0x24(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0x3,-0x4c(%rbp)
jge    125c <main+0x13c>
mov    -0x4c(%rbp),%esi
imul   $0x5,-0x4c(%rbp),%eax
cltq
mov    -0x40(%rbp,%rax,4),%edx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1229 <main+0x109>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf64(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdbb(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdc7(%rip),%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdd1(%rip),%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xddb(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe23(%rip),%rdi
call   1040 <puts@plt>
lea    0xdd1(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xb,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [3 x [5 x i32]] [[5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], [5 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10], [5 x i32] [i32 11, i32 12, i32 13, i32 14, i32 15]]
@.str = [30 x i8] c"\0Awhole double sized array a:\0A\00"
@.str.1 = [5 x i8] c"%2d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [31 x i8] c"\0A* ( * ( a + 1 ) + 2 ) = %2d;\0A\00"
@.str.4 = [29 x i8] c"* ( * ( a + 2 ) + 2 ) = %d;\0A\00"
@.str.5 = [29 x i8] c"* ( * ( a + 2 ) + 3 ) = %d;\0A\00"
@.str.6 = [21 x i8] c"* ( * a + 3 ) = %d;\0A\00"
@.str.7 = [30 x i8] c"\0Afirst elements of strings:\0A\0A\00"
@.str.8 = [41 x i8] c"* ( ( * a ) + ROW * ( i = %d ) ) = %2d;\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [5 x i32]]
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [3 x [5 x i32]]* %2 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %8
8: ; preds = %29, %0
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %32
11: ; preds = %8
store i32 0, i32* %5
br label %12
12: ; preds = %24, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 %17
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %18, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %15
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %12
27: ; preds = %12
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %27
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %8
32: ; preds = %8
%33 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0
%34 = getelementptr inbounds [5 x i32], [5 x i32]* %33, i64 1
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %34, i64 0, i64 0
%36 = getelementptr inbounds i32, i32* %35, i64 2
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0
%40 = getelementptr inbounds [5 x i32], [5 x i32]* %39, i64 2
%41 = getelementptr inbounds [5 x i32], [5 x i32]* %40, i64 0, i64 0
%42 = getelementptr inbounds i32, i32* %41, i64 2
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0
%46 = getelementptr inbounds [5 x i32], [5 x i32]* %45, i64 2
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %46, i64 0, i64 0
%48 = getelementptr inbounds i32, i32* %47, i64 3
%49 = load i32, i32* %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %49)
%51 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0
%52 = getelementptr inbounds [5 x i32], [5 x i32]* %51, i64 0, i64 0
%53 = getelementptr inbounds i32, i32* %52, i64 3
%54 = load i32, i32* %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %4
br label %57
57: ; preds = %70, %32
%58 = load i32, i32* %4
%59 = icmp slt i32 %58, 3
br i1 %59, label %60, label %73
60: ; preds = %57
%61 = load i32, i32* %4
%62 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0
%63 = getelementptr inbounds [5 x i32], [5 x i32]* %62, i64 0, i64 0
%64 = load i32, i32* %4
%65 = mul nsw i32 5, %64
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %63, i64 %66
%68 = load i32, i32* %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 %61, i32 %68)
br label %70
70: ; preds = %60
%71 = load i32, i32* %4
%72 = add nsw i32 %71, 1
store i32 %72, i32* %4
br label %57
73: ; preds = %57
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%2d \00"
@.str.3 = [31 x i8] c"\0A* ( * ( a + 1 ) + 2 ) = %2d;\0A\00"
@.str.4 = [29 x i8] c"* ( * ( a + 2 ) + 2 ) = %d;\0A\00"
@.str.5 = [29 x i8] c"* ( * ( a + 2 ) + 3 ) = %d;\0A\00"
@.str.6 = [21 x i8] c"* ( * a + 3 ) = %d;\0A\00"
@.str.8 = [41 x i8] c"* ( ( * a ) + ROW * ( i = %d ) ) = %2d;\0A\00"
@str = [29 x i8] c"\0Awhole double sized array a:\00"
@str.9 = [29 x i8] c"\0Afirst elements of strings:\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 5)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 6)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 7)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 8)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 9)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 10)
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 11)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 12)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 13)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 14)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 15)
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 8)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 13)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 14)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 4)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.9, i64 0, i64 0))
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 0, i32 1)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 1, i32 6)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 2, i32 11)
ret i32 0
}