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

/* Variables and functions */
int /*<<< orphan*/ memset(long *, int /*<<< orphan*/, int);
int /*<<< orphan*/ multiplicar(long *, long *, long *, int);
int /*<<< orphan*/ print_matriz(long *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  long a[100 * 100], c[100 * 100];
  int ord, n, i;
  scanf("%d", &ord);
  memset(a, 0, sizeof(a));
  memset(c, 0, sizeof(c));
  for (i = 0; i < ord * ord; i++)
    scanf("%ld", &a[i]);
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    multiplicar(a, a, c, ord);
  }
  print_matriz(c, ord);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x27120,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x27114(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x13890(%rbp),%rdi
xor    %esi,%esi
mov    $0x13880,%edx
call   1030 <memset@plt>
lea    -0x27110(%rbp),%rdi
xor    %esi,%esi
mov    $0x13880,%edx
call   1030 <memset@plt>
movl   $0x0,-0x2711c(%rbp)
mov    -0x2711c(%rbp),%eax
mov    -0x27114(%rbp),%ecx
imul   -0x27114(%rbp),%ecx
cmp    %ecx,%eax
jge    11e9 <main+0xa9>
movslq -0x2711c(%rbp),%rax
lea    -0x13890(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x2711c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2711c(%rbp)
jmp    1197 <main+0x57>
lea    0xe10(%rip),%rdi
lea    -0x27118(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x1,-0x2711c(%rbp)
mov    -0x2711c(%rbp),%eax
cmp    -0x27118(%rbp),%eax
jge    124e <main+0x10e>
lea    -0x13890(%rbp),%rdi
lea    -0x13890(%rbp),%rsi
lea    -0x27110(%rbp),%rdx
mov    -0x27114(%rbp),%ecx
call   1040 <multiplicar@plt>
mov    -0x2711c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2711c(%rbp)
jmp    1208 <main+0xc8>
lea    -0x27110(%rbp),%rdi
mov    -0x27114(%rbp),%esi
call   1060 <print_matriz@plt>
xor    %eax,%eax
add    $0x27120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x27118,%rsp
lea    0xeac(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x13890(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x13880,%edx
call   1030 <memset@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x13880,%edx
call   1030 <memset@plt>
mov    0x8(%rsp),%eax
imul   %eax,%eax
test   %eax,%eax
je     11c1 <main+0x81>
lea    0xe69(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
mov    0x8(%rsp),%eax
imul   %eax,%eax
add    $0x8,%r15
cmp    %rax,%rbx
jb     11a0 <main+0x60>
lea    0xe38(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x2,0xc(%rsp)
jl     120b <main+0xcb>
mov    $0x1,%ebp
lea    0x13890(%rsp),%rbx
lea    0x10(%rsp),%r14
nopl   (%rax)
mov    0x8(%rsp),%ecx
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <multiplicar@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     11f0 <main+0xb0>
mov    0x8(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1060 <print_matriz@plt>
xor    %eax,%eax
add    $0x27118,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [10000 x i64]
%2 = alloca [10000 x i64]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [10000 x i64]* %1 to i8*
%6 = bitcast [10000 x i64]* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = getelementptr inbounds [10000 x i64], [10000 x i64]* %1, i64 0, i64 0
%11 = call i32 @memset(i64* %10, i32 0, i32 80000)
%12 = getelementptr inbounds [10000 x i64], [10000 x i64]* %2, i64 0, i64 0
%13 = call i32 @memset(i64* %12, i32 0, i32 80000)
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %26, label %17
17: ; preds = %0, %17
%18 = phi i64 [ %21, %17 ], [ 0, %0 ]
%19 = getelementptr inbounds [10000 x i64], [10000 x i64]* %1, i64 0, i64 %18
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %19)
%21 = add nuw nsw i64 %18, 1
%22 = load i32, i32* %3
%23 = mul nsw i32 %22, %22
%24 = zext i32 %23 to i64
%25 = icmp ult i64 %21, %24
br i1 %25, label %17, label %26
26: ; preds = %17, %0
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 1
br i1 %29, label %30, label %37
30: ; preds = %26, %30
%31 = phi i32 [ %34, %30 ], [ 1, %26 ]
%32 = load i32, i32* %3
%33 = call i32 @multiplicar(i64* %10, i64* %10, i64* %12, i32 %32)
%34 = add nuw nsw i32 %31, 1
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %30, label %37
37: ; preds = %30, %26
%38 = load i32, i32* %3
%39 = call i32 @print_matriz(i64* %12, i32 %38)
ret i32 0
}