#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 */
typedef int /*<<< orphan*/ ptr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void multi_arr(int (*ptr)[3], int row) {
  int j, i;
  int col = sizeof(*ptr) / sizeof(int);
  printf("%d\n", sizeof(ptr));
  printf("%d\n", *ptr[1]);
  for (i = 0; i < row; i++) {
    for (j = 0; j < col; j++)
      printf("%d\n", ptr[i][j]);
  }
}


x86 assembly (clang, -O0):
<multi_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x3,-0x18(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b3 <multi_arr+0xa3>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11a0 <multi_arr+0x90>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <multi_arr+0x54>
jmp    11a5 <multi_arr+0x95>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <multi_arr+0x41>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multi_arr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xedd(%rip),%r14
mov    %r14,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
jle    118c <multi_arr+0x7c>
mov    %ebp,%eax
shl    $0x2,%rax
lea    (%rax,%rax,2),%r15
xor    %ebp,%ebp
lea    0xeae(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx,%rbp,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx,%rbp,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xc,%rbp
cmp    %rbp,%r15
jne    1160 <multi_arr+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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