#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*/ fillMatrix(int **, int);
int /*<<< orphan*/ freeMatrix(int **, int);
int **generateMatrix(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ showMatrix(int **, int);
int main() {
  int i = 0, j = 0, k = 0, size = 0;
  printf("Podaj rozmiar macierzy kwadratowych (jedna liczba): \n");
  scanf("%d", &size);
  printf("Wybrany rozmiar to: %d x %d \n", size, size);
  int **matrixOne = generateMatrix(size);
  int **matrixTwo = generateMatrix(size);
  printf("Wypełnij macierz pierwszą liczbami (wierszami): \n");
  fillMatrix(matrixOne, size);
  printf("Wypełnij macierz drugą liczbami (wierszami): \n");
  fillMatrix(matrixTwo, size);
  printf("Macierz pierwsza: \n");
  showMatrix(matrixOne, size);
  printf("Macierz druga: \n");
  showMatrix(matrixTwo, size);
  int **matrixAdd = generateMatrix(size);
  for (i = 0; i < size; ++i) {
    for (j = 0; j < size; ++j) {
      matrixAdd[i][j] = matrixOne[i][j] + matrixTwo[i][j];
    }
  }
  printf("Wynik dodawania: \n");
  showMatrix(matrixAdd, size);
  int **matrixInc = generateMatrix(size);
  for (i = 0; i < size; ++i) {
    for (j = 0; j < size; ++j) {
      for (k = 0; k < size; ++k) {
        matrixInc[i][j] += matrixOne[i][k] * matrixTwo[k][j];
      }
    }
  }
  printf("Wynik mnożenia: \n");
  showMatrix(matrixInc, size);
  freeMatrix(matrixOne, size);
  freeMatrix(matrixTwo, size);
  freeMatrix(matrixAdd, size);
  freeMatrix(matrixInc, size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <generateMatrix@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1070 <generateMatrix@plt>
mov    %rax,-0x28(%rbp)
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <fillMatrix@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1080 <fillMatrix@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <showMatrix@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <showMatrix@plt>
mov    -0x14(%rbp),%edi
call   1070 <generateMatrix@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12c9 <main+0x169>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12b6 <main+0x156>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1263 <main+0x103>
jmp    12bb <main+0x15b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1250 <main+0xf0>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <showMatrix@plt>
mov    -0x14(%rbp),%edi
call   1070 <generateMatrix@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1399 <main+0x239>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1386 <main+0x226>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1373 <main+0x213>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
imul   (%rax,%rcx,4),%edx
mov    -0x38(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    131c <main+0x1bc>
jmp    1378 <main+0x218>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1309 <main+0x1a9>
jmp    138b <main+0x22b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12f6 <main+0x196>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <showMatrix@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <freeMatrix@plt>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <freeMatrix@plt>
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <freeMatrix@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <freeMatrix@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
lea    0xe68(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edx
lea    0xe56(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edi
call   1080 <generateMatrix@plt>
mov    %rax,%r14
mov    0xc(%rsp),%edi
call   1080 <generateMatrix@plt>
mov    %rax,%r13
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1090 <fillMatrix@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r13,%rdi
call   1090 <fillMatrix@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1050 <showMatrix@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r13,%rdi
call   1050 <showMatrix@plt>
mov    0xc(%rsp),%edi
call   1080 <generateMatrix@plt>
mov    %rax,%r15
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    1289 <main+0x119>
xor    %eax,%eax
jmp    125c <main+0xec>
cs nopw 0x0(%rax,%rax,1)
movslq %ecx,%rdx
add    $0x1,%rax
cmp    %rdx,%rax
jge    1289 <main+0x119>
test   %ecx,%ecx
jle    1250 <main+0xe0>
mov    (%r14,%rax,8),%rdx
mov    0x0(%r13,%rax,8),%rsi
mov    (%r15,%rax,8),%rdi
xor    %ebx,%ebx
nop
mov    (%rsi,%rbx,4),%ecx
add    (%rdx,%rbx,4),%ecx
mov    %ecx,(%rdi,%rbx,4)
add    $0x1,%rbx
movslq 0xc(%rsp),%rcx
cmp    %rcx,%rbx
jl     1270 <main+0x100>
jmp    1250 <main+0xe0>
lea    0xe4c(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r15,%rdi
call   1050 <showMatrix@plt>
mov    0xc(%rsp),%edi
call   1080 <generateMatrix@plt>
mov    %rax,%r12
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    1321 <main+0x1b1>
xor    %r8d,%r8d
jmp    12cc <main+0x15c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r8
movslq %ecx,%rax
cmp    %rax,%r8
jge    1321 <main+0x1b1>
test   %ecx,%ecx
jle    12c0 <main+0x150>
xor    %edx,%edx
jmp    12ec <main+0x17c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %ecx,%rax
add    $0x1,%rdx
cmp    %rax,%rdx
jge    12c0 <main+0x150>
test   %ecx,%ecx
jle    12e0 <main+0x170>
mov    (%r14,%r8,8),%rsi
mov    (%r12,%r8,8),%rdi
mov    (%rdi,%rdx,4),%eax
xor    %ebx,%ebx
nopl   (%rax)
mov    0x0(%r13,%rbx,8),%rcx
mov    (%rcx,%rdx,4),%ecx
imul   (%rsi,%rbx,4),%ecx
add    %ecx,%eax
mov    %eax,(%rdi,%rdx,4)
add    $0x1,%rbx
movslq 0xc(%rsp),%rcx
cmp    %rcx,%rbx
jl     1300 <main+0x190>
jmp    12e0 <main+0x170>
lea    0xdc6(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r12,%rdi
call   1050 <showMatrix@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1070 <freeMatrix@plt>
mov    0xc(%rsp),%esi
mov    %r13,%rdi
call   1070 <freeMatrix@plt>
mov    0xc(%rsp),%esi
mov    %r15,%rdi
call   1070 <freeMatrix@plt>
mov    0xc(%rsp),%esi
mov    %r12,%rdi
call   1070 <freeMatrix@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [54 x i8] c"Podaj rozmiar macierzy kwadratowych (jedna liczba): \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Wybrany rozmiar to: %d x %d \0A\00"
@.str.3 = [52 x i8] c"Wype\C5\82nij macierz pierwsz\C4\85 liczbami (wierszami): \0A\00"
@.str.4 = [49 x i8] c"Wype\C5\82nij macierz drug\C4\85 liczbami (wierszami): \0A\00"
@.str.5 = [20 x i8] c"Macierz pierwsza: \0A\00"
@.str.6 = [17 x i8] c"Macierz druga: \0A\00"
@.str.7 = [19 x i8] c"Wynik dodawania: \0A\00"
@.str.8 = [19 x i8] c"Wynik mno\C5\BCenia: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32**
%7 = alloca i32**
%8 = alloca i32**
%9 = alloca i32**
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%12 = load i32, i32* %5
%13 = load i32, i32* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = call i32** @generateMatrix(i32 %15)
store i32** %16, i32*** %6
%17 = load i32, i32* %5
%18 = call i32** @generateMatrix(i32 %17)
store i32** %18, i32*** %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%20 = load i32**, i32*** %6
%21 = load i32, i32* %5
%22 = call i32 @fillMatrix(i32** %20, i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%24 = load i32**, i32*** %7
%25 = load i32, i32* %5
%26 = call i32 @fillMatrix(i32** %24, i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%28 = load i32**, i32*** %6
%29 = load i32, i32* %5
%30 = call i32 @showMatrix(i32** %28, i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%32 = load i32**, i32*** %7
%33 = load i32, i32* %5
%34 = call i32 @showMatrix(i32** %32, i32 %33)
%35 = load i32, i32* %5
%36 = call i32** @generateMatrix(i32 %35)
store i32** %36, i32*** %8
store i32 0, i32* %2
br label %37
37: ; preds = %78, %0
%38 = load i32, i32* %2
%39 = load i32, i32* %5
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %81
41: ; preds = %37
store i32 0, i32* %3
br label %42
42: ; preds = %74, %41
%43 = load i32, i32* %3
%44 = load i32, i32* %5
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %77
46: ; preds = %42
%47 = load i32**, i32*** %6
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32*, i32** %47, i64 %49
%51 = load i32*, i32** %50
%52 = load i32, i32* %3
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %51, i64 %53
%55 = load i32, i32* %54
%56 = load i32**, i32*** %7
%57 = load i32, i32* %2
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32*, i32** %56, i64 %58
%60 = load i32*, i32** %59
%61 = load i32, i32* %3
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %60, i64 %62
%64 = load i32, i32* %63
%65 = add nsw i32 %55, %64
%66 = load i32**, i32*** %8
%67 = load i32, i32* %2
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32*, i32** %66, i64 %68
%70 = load i32*, i32** %69
%71 = load i32, i32* %3
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %70, i64 %72
store i32 %65, i32* %73
br label %74
74: ; preds = %46
%75 = load i32, i32* %3
%76 = add nsw i32 %75, 1
store i32 %76, i32* %3
br label %42
77: ; preds = %42
br label %78
78: ; preds = %77
%79 = load i32, i32* %2
%80 = add nsw i32 %79, 1
store i32 %80, i32* %2
br label %37
81: ; preds = %37
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%83 = load i32**, i32*** %8
%84 = load i32, i32* %5
%85 = call i32 @showMatrix(i32** %83, i32 %84)
%86 = load i32, i32* %5
%87 = call i32** @generateMatrix(i32 %86)
store i32** %87, i32*** %9
store i32 0, i32* %2
br label %88
88: ; preds = %140, %81
%89 = load i32, i32* %2
%90 = load i32, i32* %5
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %143
92: ; preds = %88
store i32 0, i32* %3
br label %93
93: ; preds = %136, %92
%94 = load i32, i32* %3
%95 = load i32, i32* %5
%96 = icmp slt i32 %94, %95
br i1 %96, label %97, label %139
97: ; preds = %93
store i32 0, i32* %4
br label %98
98: ; preds = %132, %97
%99 = load i32, i32* %4
%100 = load i32, i32* %5
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %135
102: ; preds = %98
%103 = load i32**, i32*** %6
%104 = load i32, i32* %2
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i32*, i32** %103, i64 %105
%107 = load i32*, i32** %106
%108 = load i32, i32* %4
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i32, i32* %107, i64 %109
%111 = load i32, i32* %110
%112 = load i32**, i32*** %7
%113 = load i32, i32* %4
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i32*, i32** %112, i64 %114
%116 = load i32*, i32** %115
%117 = load i32, i32* %3
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i32, i32* %116, i64 %118
%120 = load i32, i32* %119
%121 = mul nsw i32 %111, %120
%122 = load i32**, i32*** %9
%123 = load i32, i32* %2
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i32*, i32** %122, i64 %124
%126 = load i32*, i32** %125
%127 = load i32, i32* %3
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i32, i32* %126, i64 %128
%130 = load i32, i32* %129
%131 = add nsw i32 %130, %121
store i32 %131, i32* %129
br label %132
132: ; preds = %102
%133 = load i32, i32* %4
%134 = add nsw i32 %133, 1
store i32 %134, i32* %4
br label %98
135: ; preds = %98
br label %136
136: ; preds = %135
%137 = load i32, i32* %3
%138 = add nsw i32 %137, 1
store i32 %138, i32* %3
br label %93
139: ; preds = %93
br label %140
140: ; preds = %139
%141 = load i32, i32* %2
%142 = add nsw i32 %141, 1
store i32 %142, i32* %2
br label %88
143: ; preds = %88
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%145 = load i32**, i32*** %9
%146 = load i32, i32* %5
%147 = call i32 @showMatrix(i32** %145, i32 %146)
%148 = load i32**, i32*** %6
%149 = load i32, i32* %5
%150 = call i32 @freeMatrix(i32** %148, i32 %149)
%151 = load i32**, i32*** %7
%152 = load i32, i32* %5
%153 = call i32 @freeMatrix(i32** %151, i32 %152)
%154 = load i32**, i32*** %8
%155 = load i32, i32* %5
%156 = call i32 @freeMatrix(i32** %154, i32 %155)
%157 = load i32**, i32*** %9
%158 = load i32, i32* %5
%159 = call i32 @freeMatrix(i32** %157, i32 %158)
%160 = load i32, i32* %1
ret i32 %160
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Wybrany rozmiar to: %d x %d \0A\00"
@str = [53 x i8] c"Podaj rozmiar macierzy kwadratowych (jedna liczba): \00"
@str.9 = [51 x i8] c"Wype\C5\82nij macierz pierwsz\C4\85 liczbami (wierszami): \00"
@str.10 = [48 x i8] c"Wype\C5\82nij macierz drug\C4\85 liczbami (wierszami): \00"
@str.11 = [19 x i8] c"Macierz pierwsza: \00"
@str.12 = [16 x i8] c"Macierz druga: \00"
@str.13 = [18 x i8] c"Wynik dodawania: \00"
@str.14 = [18 x i8] c"Wynik mno\C5\BCenia: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %5)
%7 = load i32, i32* %1
%8 = call i32** @generateMatrix(i32 %7)
%9 = load i32, i32* %1
%10 = call i32** @generateMatrix(i32 %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.9, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = call i32 @fillMatrix(i32** %8, i32 %12)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.10, i64 0, i64 0))
%15 = load i32, i32* %1
%16 = call i32 @fillMatrix(i32** %10, i32 %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
%18 = load i32, i32* %1
%19 = call i32 @showMatrix(i32** %8, i32 %18)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.12, i64 0, i64 0))
%21 = load i32, i32* %1
%22 = call i32 @showMatrix(i32** %10, i32 %21)
%23 = load i32, i32* %1
%24 = call i32** @generateMatrix(i32 %23)
%25 = load i32, i32* %1
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %55
27: ; preds = %0, %50
%28 = phi i32 [ %51, %50 ], [ %25, %0 ]
%29 = phi i64 [ %53, %50 ], [ 0, %0 ]
%30 = icmp sgt i32 %28, 0
br i1 %30, label %31, label %50
31: ; preds = %27
%32 = getelementptr inbounds i32*, i32** %8, i64 %29
%33 = load i32*, i32** %32
%34 = getelementptr inbounds i32*, i32** %10, i64 %29
%35 = load i32*, i32** %34
%36 = getelementptr inbounds i32*, i32** %24, i64 %29
%37 = load i32*, i32** %36
br label %38
38: ; preds = %31, %38
%39 = phi i64 [ 0, %31 ], [ %46, %38 ]
%40 = getelementptr inbounds i32, i32* %33, i64 %39
%41 = load i32, i32* %40
%42 = getelementptr inbounds i32, i32* %35, i64 %39
%43 = load i32, i32* %42
%44 = add nsw i32 %43, %41
%45 = getelementptr inbounds i32, i32* %37, i64 %39
store i32 %44, i32* %45
%46 = add nuw nsw i64 %39, 1
%47 = load i32, i32* %1
%48 = sext i32 %47 to i64
%49 = icmp slt i64 %46, %48
br i1 %49, label %38, label %50
50: ; preds = %38, %27
%51 = phi i32 [ %28, %27 ], [ %47, %38 ]
%52 = sext i32 %51 to i64
%53 = add nuw nsw i64 %29, 1
%54 = icmp slt i64 %53, %52
br i1 %54, label %27, label %55
55: ; preds = %50, %0
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.13, i64 0, i64 0))
%57 = load i32, i32* %1
%58 = call i32 @showMatrix(i32** %24, i32 %57)
%59 = load i32, i32* %1
%60 = call i32** @generateMatrix(i32 %59)
%61 = load i32, i32* %1
%62 = icmp sgt i32 %61, 0
br i1 %62, label %63, label %106
63: ; preds = %55, %101
%64 = phi i32 [ %102, %101 ], [ %61, %55 ]
%65 = phi i64 [ %103, %101 ], [ 0, %55 ]
%66 = icmp sgt i32 %64, 0
br i1 %66, label %67, label %101
67: ; preds = %63
%68 = getelementptr inbounds i32*, i32** %8, i64 %65
%69 = getelementptr inbounds i32*, i32** %60, i64 %65
br label %70
70: ; preds = %67, %95
%71 = phi i32 [ %64, %67 ], [ %97, %95 ]
%72 = phi i32 [ %64, %67 ], [ %96, %95 ]
%73 = phi i64 [ 0, %67 ], [ %99, %95 ]
%74 = icmp sgt i32 %72, 0
br i1 %74, label %75, label %95
75: ; preds = %70
%76 = load i32*, i32** %68
%77 = load i32*, i32** %69
%78 = getelementptr inbounds i32, i32* %77, i64 %73
%79 = load i32, i32* %78
br label %80
80: ; preds = %75, %80
%81 = phi i32 [ %79, %75 ], [ %90, %80 ]
%82 = phi i64 [ 0, %75 ], [ %91, %80 ]
%83 = getelementptr inbounds i32, i32* %76, i64 %82
%84 = load i32, i32* %83
%85 = getelementptr inbounds i32*, i32** %10, i64 %82
%86 = load i32*, i32** %85
%87 = getelementptr inbounds i32, i32* %86, i64 %73
%88 = load i32, i32* %87
%89 = mul nsw i32 %88, %84
%90 = add nsw i32 %81, %89
store i32 %90, i32* %78
%91 = add nuw nsw i64 %82, 1
%92 = load i32, i32* %1
%93 = sext i32 %92 to i64
%94 = icmp slt i64 %91, %93
br i1 %94, label %80, label %95
95: ; preds = %80, %70
%96 = phi i32 [ %72, %70 ], [ %92, %80 ]
%97 = phi i32 [ %71, %70 ], [ %92, %80 ]
%98 = sext i32 %96 to i64
%99 = add nuw nsw i64 %73, 1
%100 = icmp slt i64 %99, %98
br i1 %100, label %70, label %101
101: ; preds = %95, %63
%102 = phi i32 [ %64, %63 ], [ %97, %95 ]
%103 = add nuw nsw i64 %65, 1
%104 = sext i32 %102 to i64
%105 = icmp slt i64 %103, %104
br i1 %105, label %63, label %106
106: ; preds = %101, %55
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.14, i64 0, i64 0))
%108 = load i32, i32* %1
%109 = call i32 @showMatrix(i32** %60, i32 %108)
%110 = load i32, i32* %1
%111 = call i32 @freeMatrix(i32** %8, i32 %110)
%112 = load i32, i32* %1
%113 = call i32 @freeMatrix(i32** %10, i32 %112)
%114 = load i32, i32* %1
%115 = call i32 @freeMatrix(i32** %24, i32 %114)
%116 = load i32, i32* %1
%117 = call i32 @freeMatrix(i32** %60, i32 %116)
ret i32 0
}