#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 *, long long, long long, long long);
void printArray(long long arr[1000][3], long long size) {
  long long i;
  for (i = 0; i < size; i++) {
    printf("%lld %lld %lld\n", arr[i][0], arr[i][1], arr[i][2]);
  }
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1182 <printArray+0x72>
mov    -0x8(%rbp),%rax
imul   $0x18,-0x18(%rbp),%rcx
add    %rcx,%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
imul   $0x18,-0x18(%rbp),%rcx
add    %rcx,%rax
mov    0x8(%rax),%rdx
mov    -0x8(%rbp),%rax
imul   $0x18,-0x18(%rbp),%rcx
add    %rcx,%rax
mov    0x10(%rax),%rcx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printArray+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    114d <printArray+0x3d>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x10,%rbx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    -0x10(%rbx),%rsi
mov    -0x8(%rbx),%rdx
mov    (%rbx),%rcx
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x18,%rbx
add    $0xffffffffffffffff,%r14
jne    1130 <printArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%lld %lld %lld\0A\00"
define void @printArray([3 x i64]* %0, i64 %1) {
%3 = alloca [3 x i64]*
%4 = alloca i64
%5 = alloca i64
store [3 x i64]* %0, [3 x i64]** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %27, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %6
%11 = load [3 x i64]*, [3 x i64]** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %11, i64 %12
%14 = getelementptr inbounds [3 x i64], [3 x i64]* %13, i64 0, i64 0
%15 = load i64, i64* %14
%16 = load [3 x i64]*, [3 x i64]** %3
%17 = load i64, i64* %5
%18 = getelementptr inbounds [3 x i64], [3 x i64]* %16, i64 %17
%19 = getelementptr inbounds [3 x i64], [3 x i64]* %18, i64 0, i64 1
%20 = load i64, i64* %19
%21 = load [3 x i64]*, [3 x i64]** %3
%22 = load i64, i64* %5
%23 = getelementptr inbounds [3 x i64], [3 x i64]* %21, i64 %22
%24 = getelementptr inbounds [3 x i64], [3 x i64]* %23, i64 0, i64 2
%25 = load i64, i64* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %15, i64 %20, i64 %25)
br label %27
27: ; preds = %10
%28 = load i64, i64* %5
%29 = add nsw i64 %28, 1
store i64 %29, i64* %5
br label %6
30: ; preds = %6
ret void
}

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