#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 printMulArray(int a[][3]) {
  size_t i;
  size_t j;
  for (i = 0; i <= 1; ++i) {
    for (j = 0; j <= 2; ++j) {
      printf("%d ", a[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printMulArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
ja     1193 <printMulArray+0x83>
movq   $0x0,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
ja     1174 <printMulArray+0x64>
mov    -0x8(%rbp),%rax
imul   $0xc,-0x10(%rbp),%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <printMulArray+0x27>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <printMulArray+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMulArray>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xed0(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

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