#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*/ printArray(int **);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int array1[2][3] = {{1, 2, 3}, {4, 5, 6}};
  int array2[2][3] = {1, 2, 3, 4, 5};
  int array3[2][3] = {{1, 2}, {4}};
  printf("Values in array1 by row are:\n");
  printArray(array1);
  printf("Values in array2 by row are:\n");
  printArray(array2);
  printf("Values in array3 by row are:\n");
  printArray(array3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xec2(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <printArray@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <printArray@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xeed(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0x40(%rsp),%rdi
call   1040 <printArray@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rdi
call   1040 <printArray@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.array1 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@__const.main.array2 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 0]]
@__const.main.array3 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 0], [3 x i32] [i32 4, i32 0, i32 0]]
@.str = [30 x i8] c"Values in array1 by row are:\0A\00"
@.str.1 = [30 x i8] c"Values in array2 by row are:\0A\00"
@.str.2 = [30 x i8] c"Values in array3 by row are:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [3 x i32]]
%3 = alloca [2 x [3 x i32]]
%4 = alloca [2 x [3 x i32]]
store i32 0, i32* %1
%5 = bitcast [2 x [3 x i32]]* %2 to i8*
%6 = bitcast [2 x [3 x i32]]* %3 to i8*
%7 = bitcast [2 x [3 x i32]]* %4 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0
%10 = bitcast [3 x i32]* %9 to i32**
%11 = call i32 @printArray(i32** %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %3, i64 0, i64 0
%14 = bitcast [3 x i32]* %13 to i32**
%15 = call i32 @printArray(i32** %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %4, i64 0, i64 0
%18 = bitcast [3 x i32]* %17 to i32**
%19 = call i32 @printArray(i32** %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array1 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@__const.main.array2 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 0]]
@__const.main.array3 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 0], [3 x i32] [i32 4, i32 0, i32 0]]
@str = [29 x i8] c"Values in array1 by row are:\00"
@str.3 = [29 x i8] c"Values in array2 by row are:\00"
@str.4 = [29 x i8] c"Values in array3 by row are:\00"
define i32 @main() {
%1 = alloca [2 x [3 x i32]]
%2 = alloca [2 x [3 x i32]]
%3 = alloca [2 x [3 x i32]]
%4 = bitcast [2 x [3 x i32]]* %1 to i8*
%5 = bitcast [2 x [3 x i32]]* %2 to i8*
%6 = bitcast [2 x [3 x i32]]* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%8 = bitcast [2 x [3 x i32]]* %1 to i32**
%9 = call i32 @printArray(i32** %8)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
%11 = bitcast [2 x [3 x i32]]* %2 to i32**
%12 = call i32 @printArray(i32** %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%14 = bitcast [2 x [3 x i32]]* %3 to i32**
%15 = call i32 @printArray(i32** %14)
ret i32 0
}