#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*/ arr1;

/* Variables and functions */
int memcmp(int *, int **, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main(int argc, char *argv[]) {
  int arr1[] = {1, 2, 3, 4, 5, 6};
  int arr2[3][2] = {{1, 2}, {3, 4}, {5, 6}};
  int arr3[2][3] = {{1, 2, 3}, {4, 5, 6}};
  printf("%d\n", memcmp(arr1, arr2, sizeof(arr1)));
  printf("%d\n", memcmp(arr1, arr3, sizeof(arr1)));
  int *rows[3];
  int **buffer = rows;
  for (int i = 0; i < 3; ++i)
    buffer[i] = &arr1[i * 2];
  buffer[0][0] *= 10;
  buffer[0][1] *= 10;
  buffer[1][0] *= 10;
  buffer[1][1] *= 10;
  buffer[2][0] *= 10;
  buffer[2][1] *= 10;
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 2; ++j)
      printf("%d ", buffer[i][j]);
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xeac(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xea9(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x18,%edx
call   1050 <memcmp@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x18,%edx
call   1050 <memcmp@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
cmpl   $0x3,-0x9c(%rbp)
jge    124d <main+0x11d>
mov    -0x9c(%rbp),%eax
shl    $0x1,%eax
cltq
lea    -0x30(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x98(%rbp),%rax
movslq -0x9c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1204 <main+0xd4>
mov    -0x98(%rbp),%rax
mov    (%rax),%rax
imul   $0xa,(%rax),%ecx
mov    %ecx,(%rax)
mov    -0x98(%rbp),%rax
mov    (%rax),%rax
imul   $0xa,0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    0x8(%rax),%rax
imul   $0xa,(%rax),%ecx
mov    %ecx,(%rax)
mov    -0x98(%rbp),%rax
mov    0x8(%rax),%rax
imul   $0xa,0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
mov    -0x98(%rbp),%rax
mov    0x10(%rax),%rax
imul   $0xa,(%rax),%ecx
mov    %ecx,(%rax)
mov    -0x98(%rbp),%rax
mov    0x10(%rax),%rax
imul   $0xa,0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
movl   $0x0,-0xa0(%rbp)
cmpl   $0x3,-0xa0(%rbp)
jge    1339 <main+0x209>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x2,-0xa4(%rbp)
jge    131b <main+0x1eb>
mov    -0x98(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd5a(%rip),%rdi
call   1040 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    12d2 <main+0x1a2>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    12bb <main+0x18b>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    0xee2(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0xeeb(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    0xef3(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%r14
lea    0x40(%rsp),%rsi
mov    %r14,%rdi
mov    $0x18,%edx
call   1050 <memcmp@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %r14,%rdi
mov    $0x18,%edx
call   1050 <memcmp@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movdqa (%rsp),%xmm0
movdqa 0xe33(%rip),%xmm1
pshufd $0xf5,%xmm0,%xmm2
pmuludq %xmm1,%xmm0
pshufd $0xe8,%xmm0,%xmm3
pmuludq %xmm1,%xmm2
pshufd $0xe8,%xmm2,%xmm1
punpckldq %xmm1,%xmm3
movdqa %xmm3,(%rsp)
mov    0x10(%rsp),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,0x10(%rsp)
mov    0x14(%rsp),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %eax,0x14(%rsp)
movd   %xmm0,%esi
lea    0xe5a(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.arr1 = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.main.arr2 = [3 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4], [2 x i32] [i32 5, i32 6]]
@__const.main.arr3 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i32]
%7 = alloca [3 x [2 x i32]]
%8 = alloca [2 x [3 x i32]]
%9 = alloca [3 x i32*]
%10 = alloca i32**
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = bitcast [6 x i32]* %6 to i8*
%15 = bitcast [3 x [2 x i32]]* %7 to i8*
%16 = bitcast [2 x [3 x i32]]* %8 to i8*
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%18 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %7, i64 0, i64 0
%19 = bitcast [2 x i32]* %18 to i32**
%20 = call i32 @memcmp(i32* %17, i32** %19, i32 24)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%23 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %8, i64 0, i64 0
%24 = bitcast [3 x i32]* %23 to i32**
%25 = call i32 @memcmp(i32* %22, i32** %24, i32 24)
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [3 x i32*], [3 x i32*]* %9, i64 0, i64 0
store i32** %27, i32*** %10
store i32 0, i32* %11
br label %28
28: ; preds = %40, %2
%29 = load i32, i32* %11
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %43
31: ; preds = %28
%32 = load i32, i32* %11
%33 = mul nsw i32 %32, 2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 %34
%36 = load i32**, i32*** %10
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32*, i32** %36, i64 %38
store i32* %35, i32** %39
br label %40
40: ; preds = %31
%41 = load i32, i32* %11
%42 = add nsw i32 %41, 1
store i32 %42, i32* %11
br label %28
43: ; preds = %28
%44 = load i32**, i32*** %10
%45 = getelementptr inbounds i32*, i32** %44, i64 0
%46 = load i32*, i32** %45
%47 = getelementptr inbounds i32, i32* %46, i64 0
%48 = load i32, i32* %47
%49 = mul nsw i32 %48, 10
store i32 %49, i32* %47
%50 = load i32**, i32*** %10
%51 = getelementptr inbounds i32*, i32** %50, i64 0
%52 = load i32*, i32** %51
%53 = getelementptr inbounds i32, i32* %52, i64 1
%54 = load i32, i32* %53
%55 = mul nsw i32 %54, 10
store i32 %55, i32* %53
%56 = load i32**, i32*** %10
%57 = getelementptr inbounds i32*, i32** %56, i64 1
%58 = load i32*, i32** %57
%59 = getelementptr inbounds i32, i32* %58, i64 0
%60 = load i32, i32* %59
%61 = mul nsw i32 %60, 10
store i32 %61, i32* %59
%62 = load i32**, i32*** %10
%63 = getelementptr inbounds i32*, i32** %62, i64 1
%64 = load i32*, i32** %63
%65 = getelementptr inbounds i32, i32* %64, i64 1
%66 = load i32, i32* %65
%67 = mul nsw i32 %66, 10
store i32 %67, i32* %65
%68 = load i32**, i32*** %10
%69 = getelementptr inbounds i32*, i32** %68, i64 2
%70 = load i32*, i32** %69
%71 = getelementptr inbounds i32, i32* %70, i64 0
%72 = load i32, i32* %71
%73 = mul nsw i32 %72, 10
store i32 %73, i32* %71
%74 = load i32**, i32*** %10
%75 = getelementptr inbounds i32*, i32** %74, i64 2
%76 = load i32*, i32** %75
%77 = getelementptr inbounds i32, i32* %76, i64 1
%78 = load i32, i32* %77
%79 = mul nsw i32 %78, 10
store i32 %79, i32* %77
store i32 0, i32* %12
br label %80
80: ; preds = %103, %43
%81 = load i32, i32* %12
%82 = icmp slt i32 %81, 3
br i1 %82, label %83, label %106
83: ; preds = %80
store i32 0, i32* %13
br label %84
84: ; preds = %98, %83
%85 = load i32, i32* %13
%86 = icmp slt i32 %85, 2
br i1 %86, label %87, label %101
87: ; preds = %84
%88 = load i32**, i32*** %10
%89 = load i32, i32* %12
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i32*, i32** %88, i64 %90
%92 = load i32*, i32** %91
%93 = load i32, i32* %13
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %92, i64 %94
%96 = load i32, i32* %95
%97 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %96)
br label %98
98: ; preds = %87
%99 = load i32, i32* %13
%100 = add nsw i32 %99, 1
store i32 %100, i32* %13
br label %84
101: ; preds = %84
%102 = call i32 @putchar(i8 signext 10)
br label %103
103: ; preds = %101
%104 = load i32, i32* %12
%105 = add nsw i32 %104, 1
store i32 %105, i32* %12
br label %80
106: ; preds = %80
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr1 = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.main.arr2 = [3 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4], [2 x i32] [i32 5, i32 6]]
@__const.main.arr3 = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = alloca [3 x [2 x i32]]
%5 = alloca [2 x [3 x i32]]
%6 = bitcast [6 x i32]* %3 to i8*
%7 = bitcast [3 x [2 x i32]]* %4 to i8*
%8 = bitcast [2 x [3 x i32]]* %5 to i8*
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%10 = bitcast [3 x [2 x i32]]* %4 to i32**
%11 = call i32 @memcmp(i32* %9, i32** %10, i32 24)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = bitcast [2 x [3 x i32]]* %5 to i32**
%14 = call i32 @memcmp(i32* %9, i32** %13, i32 24)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%20 = bitcast [6 x i32]* %3 to <4 x i32>*
%21 = load <4 x i32>, <4 x i32>* %20
%22 = mul nsw <4 x i32> %21, <i32 10, i32 10, i32 10, i32 10>
%23 = bitcast [6 x i32]* %3 to <4 x i32>*
store <4 x i32> %22, <4 x i32>* %23
%24 = load i32, i32* %17
%25 = mul nsw i32 %24, 10
store i32 %25, i32* %17
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%27 = load i32, i32* %26
%28 = mul nsw i32 %27, 10
store i32 %28, i32* %26
%29 = extractelement <4 x i32> %22, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %18
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = call i32 @putchar(i8 signext 10)
%34 = load i32, i32* %16
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %19
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = call i32 @putchar(i8 signext 10)
%39 = load i32, i32* %17
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %26
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = call i32 @putchar(i8 signext 10)
ret i32 0
}