#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*/ getchar();
int /*<<< orphan*/ printarray_1(int /*<<< orphan*/);
int /*<<< orphan*/ printarray_2(int **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  int multi[3][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
  int(*ptr)[4], count;
  ptr = multi;
  for (count = 0; count < 3; count++)
    printarray_1(ptr++);
  puts("\n\nPress Enter...");
  getchar();
  printarray_2(multi, 3);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x30,%edx
call   1070 <memcpy@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x3,-0x4c(%rbp)
jge    11c8 <main+0x68>
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x48(%rbp)
mov    %eax,%edi
call   1030 <printarray_1@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    119a <main+0x3a>
lea    0xe61(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
lea    -0x40(%rbp),%rdi
mov    $0x3,%esi
call   1080 <printarray_2@plt>
lea    0xe51(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movaps 0xec0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r14
lea    0x10(%rsp),%rbx
mov    %rsp,%r15
mov    %r15d,%edi
call   1040 <printarray_1@plt>
mov    %ebx,%edi
call   1040 <printarray_1@plt>
mov    %r14d,%edi
call   1040 <printarray_1@plt>
lea    0xe89(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %r15,%rdi
mov    $0x3,%esi
call   1070 <printarray_2@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@__const.main.multi = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 3, i32 4], [4 x i32] [i32 5, i32 6, i32 7, i32 8], [4 x i32] [i32 9, i32 10, i32 11, i32 12]]
@.str = [17 x i8] c"\0A\0APress Enter...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x [4 x i32]]
%4 = bitcast [3 x [4 x i32]]* %3 to i8*
%5 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %3, i64 0, i64 1
%6 = ptrtoint [3 x [4 x i32]]* %3 to i64
%7 = trunc i64 %6 to i32
%8 = call i32 @printarray_1(i32 %7)
%9 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %3, i64 0, i64 2
%10 = ptrtoint [4 x i32]* %5 to i64
%11 = trunc i64 %10 to i32
%12 = call i32 @printarray_1(i32 %11)
%13 = ptrtoint [4 x i32]* %9 to i64
%14 = trunc i64 %13 to i32
%15 = call i32 @printarray_1(i32 %14)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (...) @getchar()
%18 = bitcast [3 x [4 x i32]]* %3 to i32**
%19 = call i32 @printarray_2(i32** %18, i32 3)
%20 = call i32 @putchar(i32 10)
ret i32 0
}