#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*/ add(int **, int **, int, int, int, int);
int /*<<< orphan*/ multiply(int **, int **, int, int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int /*<<< orphan*/ subtract(int **, int **, int, int, int, int);
int /*<<< orphan*/ transpose(int **, int, int);
int main() {
  int choice, m, n, p, q, i, j;
  int arr1[20][20], arr2[20][20];
  printf("\nEnter number of rows and columns for matrix 1: ");
  scanf("%d %d", &m, &n);
  printf("\nEnter matrix 1:\n");
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      scanf("%d", &arr1[i][j]);
  printf("\nEnter number of rows and columns for matrix 2: ");
  scanf("%d %d", &p, &q);
  printf("\nEnter matrix 2:\n");
  for (i = 0; i < p; i++)
    for (j = 0; j < q; j++)
      scanf("%d", &arr2[i][j]);
  printf("\n1) To perform matrix addition");
  printf("\n2) To perform matrix subtraction");
  printf("\n3) To perform matrix multiplication");
  printf("\n4) To find transpose");
  printf("\nEnter 1,2,3 or 4: ");
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    add(arr1, arr2, m, n, p, q);
    break;
  case 2:
    subtract(arr1, arr2, m, n, p, q);
    break;
  case 3:
    multiply(arr1, arr2, m, n, p, q);
    break;
  case 4:
    transpose(arr1, m, n);
    break;
  default:
    printf("\nInvalid Choice");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xcb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
call   1050 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1212 <main+0xb2>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ff <main+0x9f>
movslq -0x1c(%rbp),%rax
lea    -0x660(%rbp),%rsi
imul   $0x50,%rax,%rax
add    %rax,%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ba <main+0x5a>
jmp    1204 <main+0xa4>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a7 <main+0x47>
lea    0xe40(%rip),%rdi
call   1050 <printf@plt>
lea    0xe1c(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe4f(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12b2 <main+0x152>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    129f <main+0x13f>
movslq -0x1c(%rbp),%rax
lea    -0xca0(%rbp),%rsi
imul   $0x50,%rax,%rax
add    %rax,%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    125a <main+0xfa>
jmp    12a4 <main+0x144>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1247 <main+0xe7>
lea    0xde3(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf6(%rip),%rdi
call   1050 <printf@plt>
lea    0xe0c(%rip),%rdi
call   1050 <printf@plt>
lea    0xe25(%rip),%rdi
call   1050 <printf@plt>
lea    0xe2f(%rip),%rdi
call   1050 <printf@plt>
lea    0xd4f(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xca8(%rbp)
sub    $0x3,%eax
ja     13b8 <main+0x258>
mov    -0xca8(%rbp),%rax
lea    0xcda(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x660(%rbp),%rdi
lea    -0xca0(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <add@plt>
jmp    13c4 <main+0x264>
lea    -0x660(%rbp),%rdi
lea    -0xca0(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1080 <subtract@plt>
jmp    13c4 <main+0x264>
lea    -0x660(%rbp),%rdi
lea    -0xca0(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1040 <multiply@plt>
jmp    13c4 <main+0x264>
lea    -0x660(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1060 <transpose@plt>
jmp    13c4 <main+0x264>
lea    0xd6d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xcb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xca0,%rsp
lea    0xe89(%rip),%rdi
call   1060 <printf@plt>
lea    0xeae(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xf6d(%rip),%rdi
call   1050 <puts@plt>
mov    0x10(%rsp),%ecx
test   %ecx,%ecx
jle    1215 <main+0xa5>
lea    0x20(%rsp),%r15
mov    0xc(%rsp),%eax
lea    0xe7c(%rip),%r14
xor    %r12d,%r12d
jmp    11e0 <main+0x70>
nopl   (%rax)
add    $0x1,%r12
movslq %ecx,%rdx
add    $0x50,%r15
cmp    %rdx,%r12
jge    1215 <main+0xa5>
test   %eax,%eax
jle    11d0 <main+0x60>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     11f0 <main+0x80>
mov    0x10(%rsp),%ecx
jmp    11d0 <main+0x60>
lea    0xe2b(%rip),%rdi
call   1060 <printf@plt>
lea    0xe19(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xee9(%rip),%rdi
call   1050 <puts@plt>
mov    0x18(%rsp),%ecx
test   %ecx,%ecx
jle    12b5 <main+0x145>
lea    0x660(%rsp),%r15
mov    0x14(%rsp),%eax
lea    0xde4(%rip),%r14
xor    %r12d,%r12d
jmp    1280 <main+0x110>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r12
movslq %ecx,%rdx
add    $0x50,%r15
cmp    %rdx,%r12
jge    12b5 <main+0x145>
test   %eax,%eax
jle    1270 <main+0x100>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
add    $0x1,%rbx
movslq 0x14(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     1290 <main+0x120>
mov    0x18(%rsp),%ecx
jmp    1270 <main+0x100>
lea    0xdbc(%rip),%rdi
call   1060 <printf@plt>
lea    0xdcf(%rip),%rdi
call   1060 <printf@plt>
lea    0xde5(%rip),%rdi
call   1060 <printf@plt>
lea    0xdfe(%rip),%rdi
call   1060 <printf@plt>
lea    0xe08(%rip),%rdi
call   1060 <printf@plt>
lea    0xd4c(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x1c(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1346 <main+0x1d6>
lea    0xce9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x14(%rsp),%r9d
lea    0x20(%rsp),%rdi
lea    0x660(%rsp),%rsi
call   1030 <add@plt>
jmp    13b2 <main+0x242>
lea    0xdbb(%rip),%rdi
call   1060 <printf@plt>
jmp    13b2 <main+0x242>
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x14(%rsp),%r9d
lea    0x20(%rsp),%rdi
lea    0x660(%rsp),%rsi
call   1090 <subtract@plt>
jmp    13b2 <main+0x242>
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x14(%rsp),%r9d
lea    0x20(%rsp),%rdi
lea    0x660(%rsp),%rsi
call   1040 <multiply@plt>
jmp    13b2 <main+0x242>
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0x20(%rsp),%rdi
call   1070 <transpose@plt>
xor    %eax,%eax
add    $0xca0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0AEnter number of rows and columns for matrix 1: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [18 x i8] c"\0AEnter matrix 1:\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [49 x i8] c"\0AEnter number of rows and columns for matrix 2: \00"
@.str.5 = [18 x i8] c"\0AEnter matrix 2:\0A\00"
@.str.6 = [31 x i8] c"\0A1) To perform matrix addition\00"
@.str.7 = [34 x i8] c"\0A2) To perform matrix subtraction\00"
@.str.8 = [37 x i8] c"\0A3) To perform matrix multiplication\00"
@.str.9 = [22 x i8] c"\0A4) To find transpose\00"
@.str.10 = [20 x i8] c"\0AEnter 1,2,3 or 4: \00"
@.str.11 = [16 x i8] c"\0AInvalid Choice\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 [20 x [20 x i32]]
%10 = alloca [20 x [20 x i32]]
store i32 0, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %14
14: ; preds = %35, %0
%15 = load i32, i32* %7
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %38
18: ; preds = %14
store i32 0, i32* %8
br label %19
19: ; preds = %31, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %34
23: ; preds = %19
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %9, i64 0, i64 %25
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [20 x i32], [20 x i32]* %26, i64 0, i64 %28
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %29)
br label %31
31: ; preds = %23
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %19
34: ; preds = %19
br label %35
35: ; preds = %34
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %14
38: ; preds = %14
%39 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%40 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%41 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %7
br label %42
42: ; preds = %63, %38
%43 = load i32, i32* %7
%44 = load i32, i32* %5
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %66
46: ; preds = %42
store i32 0, i32* %8
br label %47
47: ; preds = %59, %46
%48 = load i32, i32* %8
%49 = load i32, i32* %6
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %62
51: ; preds = %47
%52 = load i32, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %10, i64 0, i64 %53
%55 = load i32, i32* %8
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [20 x i32], [20 x i32]* %54, i64 0, i64 %56
%58 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %57)
br label %59
59: ; preds = %51
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 1
store i32 %61, i32* %8
br label %47
62: ; preds = %47
br label %63
63: ; preds = %62
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
br label %42
66: ; preds = %42
%67 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%68 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%69 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
%70 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%71 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
%72 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%73 = load i32, i32* %2
switch i32 %73, label %110 [
i32 1, label %74
i32 2, label %84
i32 3, label %94
i32 4, label %104
]
74: ; preds = %66
%75 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %9, i64 0, i64 0
%76 = bitcast [20 x i32]* %75 to i32**
%77 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %10, i64 0, i64 0
%78 = bitcast [20 x i32]* %77 to i32**
%79 = load i32, i32* %3
%80 = load i32, i32* %4
%81 = load i32, i32* %5
%82 = load i32, i32* %6
%83 = call i32 @add(i32** %76, i32** %78, i32 %79, i32 %80, i32 %81, i32 %82)
br label %112
84: ; preds = %66
%85 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %9, i64 0, i64 0
%86 = bitcast [20 x i32]* %85 to i32**
%87 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %10, i64 0, i64 0
%88 = bitcast [20 x i32]* %87 to i32**
%89 = load i32, i32* %3
%90 = load i32, i32* %4
%91 = load i32, i32* %5
%92 = load i32, i32* %6
%93 = call i32 @subtract(i32** %86, i32** %88, i32 %89, i32 %90, i32 %91, i32 %92)
br label %112
94: ; preds = %66
%95 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %9, i64 0, i64 0
%96 = bitcast [20 x i32]* %95 to i32**
%97 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %10, i64 0, i64 0
%98 = bitcast [20 x i32]* %97 to i32**
%99 = load i32, i32* %3
%100 = load i32, i32* %4
%101 = load i32, i32* %5
%102 = load i32, i32* %6
%103 = call i32 @multiply(i32** %96, i32** %98, i32 %99, i32 %100, i32 %101, i32 %102)
br label %112
104: ; preds = %66
%105 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %9, i64 0, i64 0
%106 = bitcast [20 x i32]* %105 to i32**
%107 = load i32, i32* %3
%108 = load i32, i32* %4
%109 = call i32 @transpose(i32** %106, i32 %107, i32 %108)
br label %112
110: ; preds = %66
%111 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %112
112: ; preds = %110, %104, %94, %84, %74
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0AEnter number of rows and columns for matrix 1: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [49 x i8] c"\0AEnter number of rows and columns for matrix 2: \00"
@.str.6 = [31 x i8] c"\0A1) To perform matrix addition\00"
@.str.7 = [34 x i8] c"\0A2) To perform matrix subtraction\00"
@.str.8 = [37 x i8] c"\0A3) To perform matrix multiplication\00"
@.str.9 = [22 x i8] c"\0A4) To find transpose\00"
@.str.10 = [20 x i8] c"\0AEnter 1,2,3 or 4: \00"
@.str.11 = [16 x i8] c"\0AInvalid Choice\00"
@str = [17 x i8] c"\0AEnter matrix 1:\00"
@str.12 = [17 x i8] c"\0AEnter matrix 2:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [20 x [20 x i32]]
%7 = alloca [20 x [20 x i32]]
%8 = bitcast i32* %1 to i8*
%9 = bitcast i32* %2 to i8*
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast [20 x [20 x i32]]* %6 to i8*
%14 = bitcast [20 x [20 x i32]]* %7 to i8*
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %43
20: ; preds = %0
%21 = load i32, i32* %3
br label %22
22: ; preds = %20, %37
%23 = phi i32 [ %18, %20 ], [ %38, %37 ]
%24 = phi i32 [ %21, %20 ], [ %39, %37 ]
%25 = phi i64 [ 0, %20 ], [ %40, %37 ]
%26 = icmp sgt i32 %24, 0
br i1 %26, label %27, label %37
27: ; preds = %22, %27
%28 = phi i64 [ %31, %27 ], [ 0, %22 ]
%29 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %6, i64 0, i64 %25, i64 %28
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %29)
%31 = add nuw nsw i64 %28, 1
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %31, %33
br i1 %34, label %27, label %35
35: ; preds = %27
%36 = load i32, i32* %2
br label %37
37: ; preds = %35, %22
%38 = phi i32 [ %36, %35 ], [ %23, %22 ]
%39 = phi i32 [ %32, %35 ], [ %24, %22 ]
%40 = add nuw nsw i64 %25, 1
%41 = sext i32 %38 to i64
%42 = icmp slt i64 %40, %41
br i1 %42, label %22, label %43
43: ; preds = %37, %0
%44 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%45 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0))
%47 = load i32, i32* %4
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %72
49: ; preds = %43
%50 = load i32, i32* %5
br label %51
51: ; preds = %49, %66
%52 = phi i32 [ %47, %49 ], [ %67, %66 ]
%53 = phi i32 [ %50, %49 ], [ %68, %66 ]
%54 = phi i64 [ 0, %49 ], [ %69, %66 ]
%55 = icmp sgt i32 %53, 0
br i1 %55, label %56, label %66
56: ; preds = %51, %56
%57 = phi i64 [ %60, %56 ], [ 0, %51 ]
%58 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %7, i64 0, i64 %54, i64 %57
%59 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %58)
%60 = add nuw nsw i64 %57, 1
%61 = load i32, i32* %5
%62 = sext i32 %61 to i64
%63 = icmp slt i64 %60, %62
br i1 %63, label %56, label %64
64: ; preds = %56
%65 = load i32, i32* %4
br label %66
66: ; preds = %64, %51
%67 = phi i32 [ %65, %64 ], [ %52, %51 ]
%68 = phi i32 [ %61, %64 ], [ %53, %51 ]
%69 = add nuw nsw i64 %54, 1
%70 = sext i32 %67 to i64
%71 = icmp slt i64 %69, %70
br i1 %71, label %51, label %72
72: ; preds = %66, %43
%73 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%74 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%75 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
%76 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%77 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
%78 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%79 = load i32, i32* %1
switch i32 %79, label %109 [
i32 1, label %80
i32 2, label %88
i32 3, label %96
i32 4, label %104
]
80: ; preds = %72
%81 = bitcast [20 x [20 x i32]]* %6 to i32**
%82 = bitcast [20 x [20 x i32]]* %7 to i32**
%83 = load i32, i32* %2
%84 = load i32, i32* %3
%85 = load i32, i32* %4
%86 = load i32, i32* %5
%87 = call i32 @add(i32** %81, i32** %82, i32 %83, i32 %84, i32 %85, i32 %86)
br label %111
88: ; preds = %72
%89 = bitcast [20 x [20 x i32]]* %6 to i32**
%90 = bitcast [20 x [20 x i32]]* %7 to i32**
%91 = load i32, i32* %2
%92 = load i32, i32* %3
%93 = load i32, i32* %4
%94 = load i32, i32* %5
%95 = call i32 @subtract(i32** %89, i32** %90, i32 %91, i32 %92, i32 %93, i32 %94)
br label %111
96: ; preds = %72
%97 = bitcast [20 x [20 x i32]]* %6 to i32**
%98 = bitcast [20 x [20 x i32]]* %7 to i32**
%99 = load i32, i32* %2
%100 = load i32, i32* %3
%101 = load i32, i32* %4
%102 = load i32, i32* %5
%103 = call i32 @multiply(i32** %97, i32** %98, i32 %99, i32 %100, i32 %101, i32 %102)
br label %111
104: ; preds = %72
%105 = bitcast [20 x [20 x i32]]* %6 to i32**
%106 = load i32, i32* %2
%107 = load i32, i32* %3
%108 = call i32 @transpose(i32** %105, i32 %106, i32 %107)
br label %111
109: ; preds = %72
%110 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
br label %111
111: ; preds = %109, %104, %96, %88, %80
ret i32 0
}