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


x86 assembly (clang, -O0):
<fig06_21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    -0x20(%rbp),%rdi
call   1040 <printMulArray@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    -0x40(%rbp),%rdi
call   1040 <printMulArray@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig06_21>:
sub    $0x38,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeed(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rdi
call   1040 <printMulArray@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <printMulArray@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.fig06_21.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.fig06_21.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.1 = [29 x i8] c"Values in array2 by row are:\00"
@.str.2 = [29 x i8] c"Values in array3 by row are:\00"
define void @fig06_21() {
%1 = alloca [2 x [3 x i32]]
%2 = alloca [2 x [3 x i32]]
%3 = bitcast [2 x [3 x i32]]* %1 to i8*
%4 = bitcast [2 x [3 x i32]]* %2 to i8*
%5 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0
%7 = bitcast [3 x i32]* %6 to i32**
%8 = call i32 @printMulArray(i32** %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0
%12 = bitcast [3 x i32]* %11 to i32**
%13 = call i32 @printMulArray(i32** %12)
ret void
}

LLVM IR (-O2):
@__const.fig06_21.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.fig06_21.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.1 = [29 x i8] c"Values in array2 by row are:\00"
@.str.2 = [29 x i8] c"Values in array3 by row are:\00"
define void @fig06_21() {
%1 = alloca [2 x [3 x i32]]
%2 = alloca [2 x [3 x i32]]
%3 = bitcast [2 x [3 x i32]]* %1 to i8*
%4 = bitcast [2 x [3 x i32]]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = bitcast [2 x [3 x i32]]* %1 to i32**
%7 = call i32 @printMulArray(i32** %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = bitcast [2 x [3 x i32]]* %2 to i32**
%11 = call i32 @printMulArray(i32** %10)
ret void
}