#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 *, ...);
void printMatrices(int arr[][4], size_t size) {
  for (int i = 0; i < size; i++) {
    for (int j = 0; j < size - 1; j++)
      printf("%d ", arr[i][j]);
    printf("%d\n", arr[i][size - 1]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printMatrices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11b9 <printMatrices+0xa9>
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    1183 <printMatrices+0x73>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <printMatrices+0x2c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <printMatrices+0x17>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMatrices>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,(%rsp)
test   %rsi,%rsi
je     11aa <printMatrices+0x8a>
mov    %rsi,%r12
lea    -0x1(%rsi),%rbx
lea    0xebe(%rip),%r13
mov    (%rsp),%rbp
xor    %r15d,%r15d
jmp    1179 <printMatrices+0x59>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rax
shl    $0x4,%rax
add    (%rsp),%rax
mov    (%rax,%rbx,4),%esi
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r15
add    $0x10,%rbp
cmp    %r12,%r15
je     11aa <printMatrices+0x8a>
test   %rbx,%rbx
je     1150 <printMatrices+0x30>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r14,4),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbx
jne    1190 <printMatrices+0x70>
jmp    1150 <printMatrices+0x30>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @printMatrices([4 x i32]* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = icmp eq i64 %5, 0
br label %7
7: ; preds = %4, %11
%8 = phi i64 [ 0, %4 ], [ %15, %11 ]
br i1 %6, label %11, label %17
9: ; preds = %11, %2
%10 = tail call i32 @putchar(i32 10)
ret void
11: ; preds = %17, %7
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %8, i64 %5
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = add nuw i64 %8, 1
%16 = icmp eq i64 %15, %1
br i1 %16, label %9, label %7
17: ; preds = %7, %17
%18 = phi i64 [ %22, %17 ], [ 0, %7 ]
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 %8, i64 %18
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = add nuw i64 %18, 1
%23 = icmp eq i64 %22, %5
br i1 %23, label %11, label %17
}