#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 argc, const char *argv[]) {
  int a[3][5];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      a[i][j] = i * j;
    }
  }
  int b[][5] = {
      {1, 2, 3, 4, 5},
      {3, 4, 5, 6, 8},
  };
  int d[][3] = {
      1, 2, 4, 5, 6, 7, 8, 9, 3,
  };
  int i, j, k = 2;
  for (i = 0; i < 3; i++) {
    printf("%d", d[k][i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    1199 <main+0x79>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jge    1186 <main+0x66>
mov    -0x54(%rbp),%edx
imul   -0x58(%rbp),%edx
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1151 <main+0x31>
jmp    118b <main+0x6b>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1140 <main+0x20>
lea    -0x80(%rbp),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xe74(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x2,-0xbc(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x3,-0xb4(%rbp)
jge    1226 <main+0x106>
movslq -0xbc(%rbp),%rcx
lea    -0xb0(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0xb4(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    11da <main+0xba>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

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

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

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