#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);
int main() {
  int i[3];
  int *ii;
  for (int j = 0; j < 3; ++j) {
    i[j] = j + 1;
  }
  i[0] = 1;
  i[1] = 2;
  i[2] = 3;
  ii = i;
  for (int j = 0; j < 3; ++j) {
    printf("%d\n", i[j]);
  }
  for (int j = 0; j < 3; ++j) {
    *ii = *ii + j + 1;
    ii = ii + 1;
  }
  for (int j = 0; j < 3; ++j) {
    printf("%d\n", i[j]);
  }
  int k[2][2];
  k[0][0] = 5;
  k[1][0] = 6;
  int(*kk)[2] = k;
  printf("%d\n", (*kk)[0]);
  ++kk;
  printf("%d\n", (*kk)[0]);
  --kk;
  printf("%d\n", (*kk)[0]);
  kk = kk - (-1);
  printf("%d\n", (*kk)[0]);
  0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    114c <main+0x3c>
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq -0x1c(%rbp),%rax
mov    %ecx,-0x10(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1126 <main+0x16>
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x3,-0x20(%rbp)
jge    119c <main+0x8c>
movslq -0x20(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1170 <main+0x60>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    11d9 <main+0xc9>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a3 <main+0x93>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    120c <main+0xfc>
movslq -0x28(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%esi
lea    0xe07(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e0 <main+0xd0>
movl   $0x5,-0x40(%rbp)
movl   $0x6,-0x38(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
lea    0xdd1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
lea    0xdb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
lea    0xd95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
lea    0xd77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x [2 x i32]]
%9 = alloca [2 x i32]*
store i32 0, i32* %1
store i32 0, i32* %4
br label %10
10: ; preds = %19, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %17
store i32 %15, i32* %18
br label %19
19: ; preds = %13
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %10
22: ; preds = %10
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 1, i32* %23
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 2, i32* %24
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 3, i32* %25
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32* %26, i32** %3
store i32 0, i32* %5
br label %27
27: ; preds = %36, %22
%28 = load i32, i32* %5
%29 = icmp slt i32 %28, 3
br i1 %29, label %30, label %39
30: ; preds = %27
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %30
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %27
39: ; preds = %27
store i32 0, i32* %6
br label %40
40: ; preds = %52, %39
%41 = load i32, i32* %6
%42 = icmp slt i32 %41, 3
br i1 %42, label %43, label %55
43: ; preds = %40
%44 = load i32*, i32** %3
%45 = load i32, i32* %44
%46 = load i32, i32* %6
%47 = add nsw i32 %45, %46
%48 = add nsw i32 %47, 1
%49 = load i32*, i32** %3
store i32 %48, i32* %49
%50 = load i32*, i32** %3
%51 = getelementptr inbounds i32, i32* %50, i64 1
store i32* %51, i32** %3
br label %52
52: ; preds = %43
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %40
55: ; preds = %40
store i32 0, i32* %7
br label %56
56: ; preds = %65, %55
%57 = load i32, i32* %7
%58 = icmp slt i32 %57, 3
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %59
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 1
store i32 %67, i32* %7
br label %56
68: ; preds = %56
%69 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 0
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %69, i64 0, i64 0
store i32 5, i32* %70
%71 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 1
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %71, i64 0, i64 0
store i32 6, i32* %72
%73 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 0
store [2 x i32]* %73, [2 x i32]** %9
%74 = load [2 x i32]*, [2 x i32]** %9
%75 = getelementptr inbounds [2 x i32], [2 x i32]* %74, i64 0, i64 0
%76 = load i32, i32* %75
%77 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %76)
%78 = load [2 x i32]*, [2 x i32]** %9
%79 = getelementptr inbounds [2 x i32], [2 x i32]* %78, i32 1
store [2 x i32]* %79, [2 x i32]** %9
%80 = load [2 x i32]*, [2 x i32]** %9
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %80, i64 0, i64 0
%82 = load i32, i32* %81
%83 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %82)
%84 = load [2 x i32]*, [2 x i32]** %9
%85 = getelementptr inbounds [2 x i32], [2 x i32]* %84, i32 -1
store [2 x i32]* %85, [2 x i32]** %9
%86 = load [2 x i32]*, [2 x i32]** %9
%87 = getelementptr inbounds [2 x i32], [2 x i32]* %86, i64 0, i64 0
%88 = load i32, i32* %87
%89 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %88)
%90 = load [2 x i32]*, [2 x i32]** %9
%91 = getelementptr inbounds [2 x i32], [2 x i32]* %90, i64 1
store [2 x i32]* %91, [2 x i32]** %9
%92 = load [2 x i32]*, [2 x i32]** %9
%93 = getelementptr inbounds [2 x i32], [2 x i32]* %92, i64 0, i64 0
%94 = load i32, i32* %93
%95 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %94)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}