#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);
int main(void) {
  int matrix[2][5] = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}};
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 5; j++) {
      printf("matrix[%d][%d] Adress:%p --> Value:%d\n", i, j, &matrix[i][j],
             matrix[i][j]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jge    11ca <main+0xaa>
movl   $0x0,-0x38(%rbp)
cmpl   $0x5,-0x38(%rbp)
jge    11b7 <main+0x97>
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rcx
imul   $0x14,%rax,%rax
add    %rax,%rcx
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x34(%rbp),%rdi
lea    -0x30(%rbp),%rax
imul   $0x14,%rdi,%rdi
add    %rdi,%rax
movslq -0x38(%rbp),%rdi
mov    (%rax,%rdi,4),%r8d
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    115c <main+0x3c>
jmp    11bc <main+0x9c>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    114b <main+0x2b>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    0xf00(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xedb(%rip),%rbx
mov    %rsp,%rcx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%r8d
call   1030 <printf@plt>
lea    0x4(%rsp),%rcx
mov    0x4(%rsp),%r8d
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x8(%rsp),%rcx
mov    0x8(%rsp),%r8d
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rcx
mov    0xc(%rsp),%r8d
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    0x10(%rsp),%r8d
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
mov    %r15,%rcx
call   1030 <printf@plt>
lea    0x14(%rsp),%rcx
mov    0x14(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0x18(%rsp),%rcx
mov    0x18(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x1c(%rsp),%rcx
mov    0x1c(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    0x20(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    %r14,%rcx
call   1030 <printf@plt>
lea    0x24(%rsp),%rcx
mov    0x24(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.matrix = [2 x [5 x i32]] [[5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], [5 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10]]
@.str = [39 x i8] c"matrix[%d][%d] Adress:%p --> Value:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [5 x i32]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [2 x [5 x i32]]* %2 to i8*
store i32 0, i32* %3
br label %6
6: ; preds = %34, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %37
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %30, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %33
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [2 x [5 x i32]], [2 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
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %2, i64 0, i64 %23
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [5 x i32], [5 x i32]* %24, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32* %21, i32 %28)
br label %30
30: ; preds = %13
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %10
33: ; preds = %10
br label %34
34: ; preds = %33
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %6
37: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@__const.main.matrix = [2 x [5 x i32]] [[5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5], [5 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10]]
@.str = [39 x i8] c"matrix[%d][%d] Adress:%p --> Value:%d\0A\00"
define i32 @main() {
%1 = alloca [2 x [5 x i32]]
%2 = bitcast [2 x [5 x i32]]* %1 to i8*
%3 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32* %3, i32 1)
%5 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 0, i64 1
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32* %5, i32 %6)
%8 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 0, i64 2
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i32 2, i32* %8, i32 %9)
%11 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 0, i64 3
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i32 3, i32* %11, i32 %12)
%14 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 0, i64 4
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 0, i32 4, i32* %14, i32 %15)
%17 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 1, i64 0
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32* %17, i32 %18)
%20 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 1, i64 1
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32* %20, i32 %21)
%23 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 1, i64 2
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32* %23, i32 %24)
%26 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 1, i64 3
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 1, i32 3, i32* %26, i32 %27)
%29 = getelementptr inbounds [2 x [5 x i32]], [2 x [5 x i32]]* %1, i64 0, i64 1, i64 4
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32* %29, i32 %30)
ret i32 0
}