#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 /*<<< orphan*/ putchar(char);
int main() {
  int test[10][5] = {{1, 2, 3, 4, 5}, {4, 1, 6, 7, 8}, {9, 7, 7, 4, 0},
                     {7, 0, 4, 2, 9}, {3, 9, 3, 3, 8}, {4, 3, 1, 4, 7},
                     {5, 2, 2, 6, 6}, {0, 3, 3, 7, 5}, {1, 4, 4, 7, 4},
                     {2, 7, 0, 8, 3}};
  for (int i = 0; i < 5 * 10; i++)
    printf("%d, ", ((int *)test)[i]);
  putchar('\n');
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0xeb0(%rip),%rsi
mov    $0xc8,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0xd4(%rbp)
cmpl   $0x32,-0xd4(%rbp)
jge    119f <main+0x6f>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%esi
lea    0xf42(%rip),%rdi
call   1040 <printf@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1164 <main+0x34>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xed2(%rip),%r15
lea    0xf93(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%r15,1),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    $0xc8,%rbx
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.test = [10 x [5 x i32]] [[5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], [5 x i32] [i32 4, i32 1, i32 6, i32 7, i32 8], [5 x i32] [i32 9, i32 7, i32 7, i32 4, i32 0], [5 x i32] [i32 7, i32 0, i32 4, i32 2, i32 9], [5 x i32] [i32 3, i32 9, i32 3, i32 3, i32 8], [5 x i32] [i32 4, i32 3, i32 1, i32 4, i32 7], [5 x i32] [i32 5, i32 2, i32 2, i32 6, i32 6], [5 x i32] [i32 0, i32 3, i32 3, i32 7, i32 5], [5 x i32] [i32 1, i32 4, i32 4, i32 7, i32 4], [5 x i32] [i32 2, i32 7, i32 0, i32 8, i32 3]]
@.str = [5 x i8] c"%d, \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [5 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [10 x [5 x i32]]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 50
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* %2, i64 0, i64 0
%10 = bitcast [5 x i32]* %9 to i32*
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = call i32 @putchar(i8 signext 10)
%21 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test = [10 x [5 x i32]] [[5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], [5 x i32] [i32 4, i32 1, i32 6, i32 7, i32 8], [5 x i32] [i32 9, i32 7, i32 7, i32 4, i32 0], [5 x i32] [i32 7, i32 0, i32 4, i32 2, i32 9], [5 x i32] [i32 3, i32 9, i32 3, i32 3, i32 8], [5 x i32] [i32 4, i32 3, i32 1, i32 4, i32 7], [5 x i32] [i32 5, i32 2, i32 2, i32 6, i32 6], [5 x i32] [i32 0, i32 3, i32 3, i32 7, i32 5], [5 x i32] [i32 1, i32 4, i32 4, i32 7, i32 4], [5 x i32] [i32 2, i32 7, i32 0, i32 8, i32 3]]
@.str = [5 x i8] c"%d, \00"
define i32 @main() {
br label %4
1: ; preds = %4
%2 = tail call i32 @putchar(i8 signext 10)
%3 = tail call i32 @putchar(i8 signext 10)
ret i32 0
4: ; preds = %0, %4
%5 = phi i64 [ 0, %0 ], [ %9, %4 ]
%6 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* @__const.main.test, i64 0, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 50
br i1 %10, label %1, label %4
}