#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*/ get_matrix(int **, int, int);
int /*<<< orphan*/ mul_matrix(int **, int **, int **, int, int, int);
int /*<<< orphan*/ put_matrix(int **, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int m, n, q;
  int product[100][100];
  int matrix1[100][100];
  int matrix2[100][100];
  scanf("%d%d%d", &m, &n, &q);
  get_matrix(matrix1, m, n);
  get_matrix(matrix2, n, q);
  mul_matrix(product, matrix1, matrix2, m, n, q);
  put_matrix(product, m, q);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d4d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1060 <scanf@plt>
lea    -0x13890(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <get_matrix@plt>
lea    -0x1d4d0(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <get_matrix@plt>
lea    -0x9c50(%rbp),%rdi
lea    -0x13890(%rbp),%rsi
lea    -0x1d4d0(%rbp),%rdx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
call   1050 <mul_matrix@plt>
lea    -0x9c50(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <put_matrix@plt>
xor    %eax,%eax
add    $0x1d4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1d4d0,%rsp
lea    0xead(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0x9c50(%rsp),%r14
mov    %r14,%rdi
call   1030 <get_matrix@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
call   1030 <get_matrix@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0x4(%rsp),%r9d
lea    0x13890(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <mul_matrix@plt>
mov    0xc(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
call   1040 <put_matrix@plt>
xor    %eax,%eax
add    $0x1d4d0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x [100 x i32]]
%6 = alloca [100 x [100 x i32]]
%7 = alloca [100 x [100 x i32]]
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%10 = bitcast [100 x i32]* %9 to i32**
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @get_matrix(i32** %10, i32 %11, i32 %12)
%14 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 0
%15 = bitcast [100 x i32]* %14 to i32**
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = call i32 @get_matrix(i32** %15, i32 %16, i32 %17)
%19 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %5, i64 0, i64 0
%20 = bitcast [100 x i32]* %19 to i32**
%21 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%22 = bitcast [100 x i32]* %21 to i32**
%23 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 0
%24 = bitcast [100 x i32]* %23 to i32**
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @mul_matrix(i32** %20, i32** %22, i32** %24, i32 %25, i32 %26, i32 %27)
%29 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %5, i64 0, i64 0
%30 = bitcast [100 x i32]* %29 to i32**
%31 = load i32, i32* %2
%32 = load i32, i32* %4
%33 = call i32 @put_matrix(i32** %30, i32 %31, i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x [100 x i32]]
%5 = alloca [100 x [100 x i32]]
%6 = alloca [100 x [100 x i32]]
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast [100 x [100 x i32]]* %4 to i8*
%11 = bitcast [100 x [100 x i32]]* %5 to i8*
%12 = bitcast [100 x [100 x i32]]* %6 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%14 = bitcast [100 x [100 x i32]]* %5 to i32**
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = call i32 @get_matrix(i32** %14, i32 %15, i32 %16)
%18 = bitcast [100 x [100 x i32]]* %6 to i32**
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @get_matrix(i32** %18, i32 %19, i32 %20)
%22 = bitcast [100 x [100 x i32]]* %4 to i32**
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @mul_matrix(i32** %22, i32** %14, i32** %18, i32 %23, i32 %24, i32 %25)
%27 = load i32, i32* %1
%28 = load i32, i32* %3
%29 = call i32 @put_matrix(i32** %22, i32 %27, i32 %28)
ret i32 0
}