#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, void *, int);
int main(void) {
  int array[3][5];
  int ii, jj, kk;
  int *pp;
  kk = 0;
  for (ii = 0; ii < 3; ++ii) {
    for (jj = 0; jj < 5; ++jj) {
      array[ii][jj] = kk;
      printf("array[%d][%d]=%d\n", ii, jj, array[ii][jj]);
      kk = kk + 1;
    }
  }
  for (pp = &array[0][0], kk = 0; kk < (3 * 5); kk = kk + 1, pp = pp + 1) {
    printf("kk=%d pp=%p *pp=%d\n", kk, (void *)pp, *pp);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    11b4 <main+0xa4>
movl   $0x0,-0x48(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    11a1 <main+0x91>
mov    -0x4c(%rbp),%edx
movslq -0x44(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x48(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x44(%rbp),%esi
movslq -0x48(%rbp),%rdx
movslq -0x44(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x48(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    113e <main+0x2e>
jmp    11a6 <main+0x96>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    112d <main+0x1d>
lea    -0x40(%rbp),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0xf,-0x4c(%rbp)
jge    1200 <main+0xf0>
mov    -0x4c(%rbp),%esi
mov    -0x58(%rbp),%rdx
mov    -0x58(%rbp),%rax
mov    (%rax),%ecx
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x58(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x58(%rbp)
jmp    11c3 <main+0xb3>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xf0e(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    $0x1,%edx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%ecx
call   1030 <printf@plt>
mov    $0x2,%edx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%ecx
call   1030 <printf@plt>
movaps 0xea1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x3,%edx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%ecx
call   1030 <printf@plt>
lea    0x10(%rsp),%r14
mov    $0x4,%edx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x5,%ecx
call   1030 <printf@plt>
mov    $0x1,%edx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x6,%ecx
call   1030 <printf@plt>
movaps 0xe4e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    $0x2,%edx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x7,%ecx
call   1030 <printf@plt>
lea    0x14(%rsp),%r12
mov    $0x3,%edx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x8,%ecx
call   1030 <printf@plt>
mov    $0x4,%edx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x9,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0xa,%ecx
call   1030 <printf@plt>
movaps 0xdf4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    $0x1,%edx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xb,%ecx
call   1030 <printf@plt>
lea    0x28(%rsp),%r15
movl   $0xc,0x30(%rsp)
mov    $0x2,%edx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xc,%ecx
call   1030 <printf@plt>
movl   $0xd,0x34(%rsp)
mov    $0x3,%edx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xd,%ecx
call   1030 <printf@plt>
movl   $0xe,0x38(%rsp)
mov    $0x4,%edx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xe,%ecx
call   1030 <printf@plt>
lea    0xd91(%rip),%rbx
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rdx
mov    0x8(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdx
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    0x10(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    0x14(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %r12,%rdx
call   1030 <printf@plt>
lea    0x18(%rsp),%rdx
mov    0x18(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0x1c(%rsp),%rdx
mov    0x1c(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
lea    0x20(%rsp),%rdx
mov    0x20(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0x24(%rsp),%rdx
mov    0x24(%rsp),%ecx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    0x28(%rsp),%ecx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %r15,%rdx
call   1030 <printf@plt>
lea    0x2c(%rsp),%rdx
mov    0x2c(%rsp),%ecx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
lea    0x30(%rsp),%rdx
mov    0x30(%rsp),%ecx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0x34(%rsp),%rdx
mov    0x34(%rsp),%ecx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
lea    0x38(%rsp),%rdx
mov    0x38(%rsp),%ecx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"array[%d][%d]=%d\0A\00"
@.str.1 = [20 x i8] c"kk=%d pp=%p *pp=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [5 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %3
br label %7
7: ; preds = %40, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %43
10: ; preds = %7
store i32 0, i32* %4
br label %11
11: ; preds = %36, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 5
br i1 %13, label %14, label %39
14: ; preds = %11
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%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* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %18, i64 0, i64 %20
store i32 %15, i32* %21
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 %27
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %28, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %22, i8* %25, i32 %32)
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %36
36: ; preds = %14
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %11
39: ; preds = %11
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %7
43: ; preds = %7
%44 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %2, i64 0, i64 0
%45 = getelementptr inbounds [5 x i32], [5 x i32]* %44, i64 0, i64 0
store i32* %45, i32** %6
store i32 0, i32* %5
br label %46
46: ; preds = %56, %43
%47 = load i32, i32* %5
%48 = icmp slt i32 %47, 15
br i1 %48, label %49, label %61
49: ; preds = %46
%50 = load i32, i32* %5
%51 = load i32*, i32** %6
%52 = bitcast i32* %51 to i8*
%53 = load i32*, i32** %6
%54 = load i32, i32* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %50, i8* %52, i32 %54)
br label %56
56: ; preds = %49
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
%59 = load i32*, i32** %6
%60 = getelementptr inbounds i32, i32* %59, i64 1
store i32* %60, i32** %6
br label %46
61: ; preds = %46
%62 = load i32, i32* %1
ret i32 %62
}

LLVM IR (-O2):
@.str = [18 x i8] c"array[%d][%d]=%d\0A\00"
@.str.1 = [20 x i8] c"kk=%d pp=%p *pp=%d\0A\00"
define i32 @main() {
%1 = alloca [3 x [5 x i32]]
%2 = bitcast [3 x [5 x i32]]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i8* null, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i8* inttoptr (i64 1 to i8*), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i8* inttoptr (i64 2 to i8*), i32 2)
%6 = bitcast [3 x [5 x i32]]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %6
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i8* inttoptr (i64 3 to i8*), i32 3)
%8 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i8* inttoptr (i64 4 to i8*), i32 4)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i8* null, i32 5)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i8* inttoptr (i64 1 to i8*), i32 6)
%12 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %12
%13 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i8* inttoptr (i64 2 to i8*), i32 7)
%14 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 1, i64 3
%15 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i8* inttoptr (i64 3 to i8*), i32 8)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1, i8* inttoptr (i64 4 to i8*), i32 9)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i8* null, i32 10)
%18 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %18
%19 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i8* inttoptr (i64 1 to i8*), i32 11)
%20 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 2, i64 2
store i32 12, i32* %20
%21 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i8* inttoptr (i64 2 to i8*), i32 12)
%22 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 2, i64 3
store i32 13, i32* %22
%23 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i8* inttoptr (i64 3 to i8*), i32 13)
%24 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 2, i64 4
store i32 14, i32* %24
%25 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2, i8* inttoptr (i64 4 to i8*), i32 14)
%26 = bitcast [3 x [5 x i32]]* %1 to i8*
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0, i8* %26, i32 0)
%28 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 1
%29 = bitcast i32* %28 to i8*
%30 = load i32, i32* %28
%31 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %29, i32 %30)
%32 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 2
%33 = bitcast i32* %32 to i8*
%34 = load i32, i32* %32
%35 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %33, i32 %34)
%36 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 3
%37 = bitcast i32* %36 to i8*
%38 = load i32, i32* %36
%39 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* %37, i32 %38)
%40 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 4
%41 = bitcast i32* %40 to i8*
%42 = load i32, i32* %40
%43 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 4, i8* %41, i32 %42)
%44 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 5
%45 = bitcast i32* %44 to i8*
%46 = load i32, i32* %44
%47 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 5, i8* %45, i32 %46)
%48 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 6
%49 = bitcast i32* %48 to i8*
%50 = load i32, i32* %48
%51 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 6, i8* %49, i32 %50)
%52 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 7
%53 = bitcast i32* %52 to i8*
%54 = load i32, i32* %52
%55 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 7, i8* %53, i32 %54)
%56 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 8
%57 = bitcast i32* %56 to i8*
%58 = load i32, i32* %56
%59 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 8, i8* %57, i32 %58)
%60 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 9
%61 = bitcast i32* %60 to i8*
%62 = load i32, i32* %60
%63 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 9, i8* %61, i32 %62)
%64 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 10
%65 = bitcast i32* %64 to i8*
%66 = load i32, i32* %64
%67 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* %65, i32 %66)
%68 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 11
%69 = bitcast i32* %68 to i8*
%70 = load i32, i32* %68
%71 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 11, i8* %69, i32 %70)
%72 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 12
%73 = bitcast i32* %72 to i8*
%74 = load i32, i32* %72
%75 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 12, i8* %73, i32 %74)
%76 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 13
%77 = bitcast i32* %76 to i8*
%78 = load i32, i32* %76
%79 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 13, i8* %77, i32 %78)
%80 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %1, i64 0, i64 0, i64 14
%81 = bitcast i32* %80 to i8*
%82 = load i32, i32* %80
%83 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 14, i8* %81, i32 %82)
ret i32 0
}