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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x5,-0x64(%rbp)
jge    1184 <main+0x74>
movl   $0x0,-0x68(%rbp)
cmpl   $0x4,-0x68(%rbp)
jge    1171 <main+0x61>
mov    -0x64(%rbp),%edx
shl    $0x1,%edx
imul   $0x3,-0x68(%rbp),%eax
add    %eax,%edx
movslq -0x64(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x68(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1137 <main+0x27>
jmp    1176 <main+0x66>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x64(%rbp)
cmpl   $0x5,-0x64(%rbp)
jge    11ef <main+0xdf>
movl   $0x0,-0x68(%rbp)
cmpl   $0x4,-0x68(%rbp)
jge    11dc <main+0xcc>
mov    -0x64(%rbp),%esi
mov    -0x68(%rbp),%edx
movslq -0x64(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    119c <main+0x8c>
jmp    11e1 <main+0xd1>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    118b <main+0x7b>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movaps 0xee0(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r15
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeec(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
xor    %ecx,%ecx
lea    0xeee(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    -0xc(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    -0x8(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    -0x4(%r15),%ecx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
cmp    $0x4,%rbx
je     11c8 <main+0xb8>
mov    (%r15),%ecx
add    $0x10,%r15
add    $0x1,%rbx
jmp    1170 <main+0x60>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"numbers[%d][%d] = %d \0A\00"
define i32 @main() {
%1 = alloca [5 x [4 x i32]]
%2 = bitcast [5 x [4 x i32]]* %1 to i8*
%3 = bitcast [5 x [4 x i32]]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 3, i32 6, i32 9>, <4 x i32>* %3
%4 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 1, i64 0
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 2, i32 5, i32 8, i32 11>, <4 x i32>* %5
%6 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 2, i64 0
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 4, i32 7, i32 10, i32 13>, <4 x i32>* %7
%8 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 3, i64 0
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 6, i32 9, i32 12, i32 15>, <4 x i32>* %9
%10 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 4, i64 0
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 8, i32 11, i32 14, i32 17>, <4 x i32>* %11
br label %12
12: ; preds = %28, %0
%13 = phi i32 [ 0, %0 ], [ %30, %28 ]
%14 = phi i64 [ 0, %0 ], [ %26, %28 ]
%15 = trunc i64 %14 to i32
%16 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %15, i32 0, i32 %13)
%17 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 %14, i64 1
%18 = load i32, i32* %17
%19 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %15, i32 1, i32 %18)
%20 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 %14, i64 2
%21 = load i32, i32* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %15, i32 2, i32 %21)
%23 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 %14, i64 3
%24 = load i32, i32* %23
%25 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %15, i32 3, i32 %24)
%26 = add nuw nsw i64 %14, 1
%27 = icmp eq i64 %26, 5
br i1 %27, label %31, label %28
28: ; preds = %12
%29 = getelementptr inbounds [5 x [4 x i32]], [5 x [4 x i32]]* %1, i64 0, i64 %26, i64 0
%30 = load i32, i32* %29
br label %12
31: ; preds = %12
ret i32 0
}