#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*/ matrix_display(int **, int);
int /*<<< orphan*/ matrix_multiple(int **, int **, int **, int);
void main() {
  int matrix0[2][2] = {{1, 2}, {3, 4}};
  int matrix1[2][2] = {{0, 1}, {0, 0}};
  int matrix2[2][2] = {0};
  matrix_display(matrix0, 2);
  matrix_display(matrix1, 2);
  matrix_display(matrix2, 2);
  matrix_multiple(matrix0, matrix1, matrix2, 2);
  matrix_display(matrix2, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <matrix_display@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1050 <matrix_display@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
call   1050 <matrix_display@plt>
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x2,%ecx
call   1040 <matrix_multiple@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
call   1050 <matrix_display@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
movaps 0xed0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x2,%esi
call   1040 <matrix_display@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x2,%esi
call   1040 <matrix_display@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <matrix_display@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    $0x2,%ecx
call   1030 <matrix_multiple@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <matrix_display@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.matrix0 = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]
@__const.main.matrix1 = [2 x [2 x i32]] [[2 x i32] [i32 0, i32 1], [2 x i32] zeroinitializer]
define void @main() {
%1 = alloca [2 x [2 x i32]]
%2 = alloca [2 x [2 x i32]]
%3 = alloca [2 x [2 x i32]]
%4 = bitcast [2 x [2 x i32]]* %1 to i8*
%5 = bitcast [2 x [2 x i32]]* %2 to i8*
%6 = bitcast [2 x [2 x i32]]* %3 to i8*
%7 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 0
%8 = bitcast [2 x i32]* %7 to i32**
%9 = call i32 @matrix_display(i32** %8, i32 2)
%10 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%11 = bitcast [2 x i32]* %10 to i32**
%12 = call i32 @matrix_display(i32** %11, i32 2)
%13 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%14 = bitcast [2 x i32]* %13 to i32**
%15 = call i32 @matrix_display(i32** %14, i32 2)
%16 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %1, i64 0, i64 0
%17 = bitcast [2 x i32]* %16 to i32**
%18 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%19 = bitcast [2 x i32]* %18 to i32**
%20 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%21 = bitcast [2 x i32]* %20 to i32**
%22 = call i32 @matrix_multiple(i32** %17, i32** %19, i32** %21, i32 2)
%23 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %3, i64 0, i64 0
%24 = bitcast [2 x i32]* %23 to i32**
%25 = call i32 @matrix_display(i32** %24, i32 2)
ret void
}

LLVM IR (-O2):
@__const.main.matrix0 = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]
@__const.main.matrix1 = [2 x [2 x i32]] [[2 x i32] [i32 0, i32 1], [2 x i32] zeroinitializer]
define void @main() {
%1 = alloca [2 x [2 x i32]]
%2 = alloca [2 x [2 x i32]]
%3 = alloca [2 x [2 x i32]]
%4 = bitcast [2 x [2 x i32]]* %1 to i8*
%5 = bitcast [2 x [2 x i32]]* %2 to i8*
%6 = bitcast [2 x [2 x i32]]* %3 to i8*
%7 = bitcast [2 x [2 x i32]]* %1 to i32**
%8 = call i32 @matrix_display(i32** %7, i32 2)
%9 = bitcast [2 x [2 x i32]]* %2 to i32**
%10 = call i32 @matrix_display(i32** %9, i32 2)
%11 = bitcast [2 x [2 x i32]]* %3 to i32**
%12 = call i32 @matrix_display(i32** %11, i32 2)
%13 = call i32 @matrix_multiple(i32** %7, i32** %9, i32** %11, i32 2)
%14 = call i32 @matrix_display(i32** %11, i32 2)
ret void
}