#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 0, j = 0, row = 0, column = 0;
  printf("Please enter the order m x n of the matrix. \n");
  scanf("%d", &row);
  scanf("%d", &column);
  int mat[row][column];
  int trans[column][row];
  printf("Please enter the elements of the matrix. \n");
  for (i = 0; i < row; i++) {
    for (j = 0; j < column; j++) {
      scanf("%d", &mat[i][j]);
    }
  }
  printf("The matrix you entered is: \n");
  for (i = 0; i < row; i++) {
    for (j = 0; j < column; j++) {
      printf("%d ", mat[i][j]);
    }
    printf("\n");
  }
  for (i = 0; i < row; i++) {
    for (j = 0; j < column; j++) {
      trans[i][j] = mat[j][i];
    }
  }
  printf("The transpose of the matrix you entered is: \n");
  for (i = 0; i < row; i++) {
    for (j = 0; j < column; j++) {
      printf("%d ", trans[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rdi,-0x68(%rbp)
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x68(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
mov    %rax,-0x60(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x58(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    %rax,-0x50(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x48(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x38(%rbp)
mov    %rax,-0x40(%rbp)
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    126c <main+0x14c>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1259 <main+0x139>
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rcx
movslq -0x8(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xde8(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1211 <main+0xf1>
jmp    125e <main+0x13e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11fe <main+0xde>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12f6 <main+0x1d6>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12da <main+0x1ba>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rdx
movslq -0x8(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1294 <main+0x174>
lea    0xd4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1281 <main+0x161>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1379 <main+0x259>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1366 <main+0x246>
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%rdi
movslq -0xc(%rbp),%rdx
imul   %rdi,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x8(%rbp),%rdx
mov    (%rcx,%rdx,4),%edx
movslq -0x8(%rbp),%rcx
imul   %rsi,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1310 <main+0x1f0>
jmp    136b <main+0x24b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12fd <main+0x1dd>
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1403 <main+0x2e3>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13e7 <main+0x2c7>
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rdx
movslq -0x8(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13a1 <main+0x281>
lea    0xc3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    138e <main+0x26e>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8b(%rip),%rbx
lea    -0x30(%rbp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    -0x2c(%rbp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %rsp,-0x70(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x2c(%rbp),%edx
mov    %rdx,-0x48(%rbp)
imul   %rdx,%rax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%edx
mov    %rdx,-0x60(%rbp)
imul   %rdx,%rax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
lea    0xe4e(%rip),%rdi
call   1040 <puts@plt>
mov    -0x30(%rbp),%ecx
test   %ecx,%ecx
jle    1261 <main+0x121>
mov    -0x2c(%rbp),%eax
mov    -0x48(%rbp),%rdx
lea    0x0(,%rdx,4),%rdx
mov    %rdx,-0x50(%rbp)
xor    %r15d,%r15d
lea    0xdf1(%rip),%r14
mov    -0x40(%rbp),%r13
jmp    1230 <main+0xf0>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r15
movslq %ecx,%rdx
add    -0x50(%rbp),%r13
cmp    %rdx,%r15
jge    1261 <main+0x121>
test   %eax,%eax
jle    1220 <main+0xe0>
mov    %r13,%rbx
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
add    $0x1,%r12
movslq -0x2c(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r12
jl     1240 <main+0x100>
mov    -0x30(%rbp),%ecx
jmp    1220 <main+0xe0>
lea    0xdf6(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x30(%rbp)
jle    1573 <main+0x433>
mov    -0x48(%rbp),%rax
lea    0x0(,%rax,4),%r14
lea    0xd79(%rip),%r15
mov    -0x40(%rbp),%r12
xor    %r13d,%r13d
jmp    12ba <main+0x17a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
movslq -0x30(%rbp),%rax
add    %r14,%r12
cmp    %rax,%r13
jge    12ed <main+0x1ad>
cmpl   $0x0,-0x2c(%rbp)
jle    12a0 <main+0x160>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jl     12d0 <main+0x190>
jmp    12a0 <main+0x160>
mov    %eax,%eax
mov    %rax,-0x50(%rbp)
test   %eax,%eax
jle    1573 <main+0x433>
mov    -0x2c(%rbp),%r10d
cmp    $0x8,%r10
setae  %al
mov    %r10d,%ecx
and    $0xfffffff8,%ecx
mov    %rcx,-0x98(%rbp)
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rdx
shr    $0x3,%rdx
add    $0x1,%rdx
mov    -0x48(%rbp),%r11
cmp    $0x1,%r11d
sete   %cl
and    %al,%cl
mov    %cl,-0x31(%rbp)
mov    %edx,%ecx
and    $0x3,%ecx
and    $0xfffffffffffffffc,%rdx
mov    %rdx,-0x80(%rbp)
mov    %r10d,%eax
and    $0x3,%eax
mov    %rax,-0xa0(%rbp)
mov    -0x58(%rbp),%r13
lea    0x70(%r13),%rdi
mov    -0x60(%rbp),%rax
lea    0x0(,%rax,4),%rax
mov    %rax,-0xa8(%rbp)
mov    %r11,%rax
shl    $0x7,%rax
mov    %rax,-0x78(%rbp)
mov    %r11,%r9
shl    $0x5,%r9
mov    %rcx,-0x88(%rbp)
shl    $0x5,%rcx
mov    %rcx,-0x68(%rbp)
shl    $0x4,%r11
xor    %r8d,%r8d
jmp    13c0 <main+0x280>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r8
mov    -0xa8(%rbp),%rax
add    %rax,%rdi
addq   $0x4,-0x40(%rbp)
add    %rax,%r13
cmp    -0x50(%rbp),%r8
je     1573 <main+0x433>
test   %r10d,%r10d
jle    13a0 <main+0x260>
cmpb   $0x0,-0x31(%rbp)
je     13e0 <main+0x2a0>
cmpq   $0x18,-0x90(%rbp)
18
jae    13e7 <main+0x2a7>
xor    %esi,%esi
mov    -0x68(%rbp),%r12
jmp    1466 <main+0x326>
xor    %esi,%esi
jmp    14bf <main+0x37f>
mov    -0x80(%rbp),%rax
mov    -0x40(%rbp),%r15
xor    %esi,%esi
mov    -0x78(%rbp),%rbx
mov    -0x68(%rbp),%r12
nopl   0x0(%rax)
movups (%r15),%xmm0
movups 0x10(%r15),%xmm1
movups %xmm0,-0x70(%rdi,%rsi,4)
movups %xmm1,-0x60(%rdi,%rsi,4)
lea    (%r15,%r9,1),%rcx
movups (%r15,%r9,1),%xmm0
movups 0x10(%r15,%r9,1),%xmm1
movups %xmm0,-0x50(%rdi,%rsi,4)
movups %xmm1,-0x40(%rdi,%rsi,4)
lea    (%rcx,%r9,1),%rdx
movups (%r9,%rcx,1),%xmm0
movups 0x10(%r9,%rcx,1),%xmm1
movups %xmm0,-0x30(%rdi,%rsi,4)
movups %xmm1,-0x20(%rdi,%rsi,4)
movups (%r9,%rdx,1),%xmm0
movups 0x10(%r9,%rdx,1),%xmm1
movups %xmm0,-0x10(%rdi,%rsi,4)
movups %xmm1,(%rdi,%rsi,4)
add    $0x20,%rsi
add    %rbx,%r15
add    $0xfffffffffffffffc,%rax
jne    1400 <main+0x2c0>
cmpq   $0x0,-0x88(%rbp)
je     14ac <main+0x36c>
lea    0x0(,%rsi,4),%rax
add    %r13,%rax
imul   -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rcx
lea    (%rcx,%rsi,4),%rcx
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm1
movups %xmm0,(%rax,%rdx,1)
movups %xmm1,0x10(%rax,%rdx,1)
add    $0x20,%rdx
add    %r9,%rcx
cmp    %rdx,%r12
jne    1490 <main+0x350>
mov    -0x98(%rbp),%rax
mov    %rax,%rsi
cmp    %r10,%rax
je     13a0 <main+0x260>
mov    %rsi,%rax
not    %rax
add    %r10,%rax
mov    -0xa0(%rbp),%rbx
test   %rbx,%rbx
je     1504 <main+0x3c4>
mov    -0x48(%rbp),%rcx
imul   %rsi,%rcx
mov    -0x40(%rbp),%rdx
lea    (%rdx,%rcx,4),%rcx
mov    %rbx,%rdx
nopw   0x0(%rax,%rax,1)
mov    (%rcx),%ebx
mov    %ebx,0x0(%r13,%rsi,4)
add    $0x1,%rsi
add    %r14,%rcx
add    $0xffffffffffffffff,%rdx
jne    14f0 <main+0x3b0>
cmp    $0x3,%rax
jb     13a0 <main+0x260>
lea    0x1(%rsi),%r15
imul   %r14,%r15
lea    0x3(%rsi),%r12
imul   %r14,%r12
mov    %r14,%rdx
imul   %rsi,%rdx
lea    0x2(%rsi),%rcx
imul   %r14,%rcx
mov    -0x40(%rbp),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rax,%rdx,1),%ebx
mov    %ebx,0x0(%r13,%rsi,4)
mov    (%rax,%r15,1),%ebx
mov    %ebx,0x4(%r13,%rsi,4)
mov    (%rax,%rcx,1),%ebx
mov    %ebx,0x8(%r13,%rsi,4)
mov    (%rax,%r12,1),%ebx
mov    %ebx,0xc(%r13,%rsi,4)
add    $0x4,%rsi
add    %r11,%rax
cmp    %rsi,%r10
jne    1540 <main+0x400>
jmp    13a0 <main+0x260>
lea    0xb00(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,-0x30(%rbp)
mov    -0x60(%rbp),%r12
mov    -0x58(%rbp),%r13
jle    15ee <main+0x4ae>
shl    $0x2,%r12
lea    0xa6b(%rip),%r15
xor    %r14d,%r14d
jmp    15ba <main+0x47a>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
movslq -0x30(%rbp),%rax
add    %r12,%r13
cmp    %rax,%r14
jge    15ee <main+0x4ae>
cmpl   $0x0,-0x2c(%rbp)
jle    15a0 <main+0x460>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%r13,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jl     15d0 <main+0x490>
jmp    15a0 <main+0x460>
mov    -0x70(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Please enter the order m x n of the matrix. \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"Please enter the elements of the matrix. \0A\00"
@.str.3 = [29 x i8] c"The matrix you entered is: \0A\00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [46 x i8] c"The transpose of the matrix you entered is: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
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
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %4
%15 = zext i32 %14 to i64
%16 = load i32, i32* %5
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %6
%19 = mul nuw i64 %15, %17
%20 = alloca i32, i64 %19
store i64 %15, i64* %7
store i64 %17, i64* %8
%21 = load i32, i32* %5
%22 = zext i32 %21 to i64
%23 = load i32, i32* %4
%24 = zext i32 %23 to i64
%25 = mul nuw i64 %22, %24
%26 = alloca i32, i64 %25
store i64 %22, i64* %9
store i64 %24, i64* %10
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %28
28: ; preds = %50, %0
%29 = load i32, i32* %2
%30 = load i32, i32* %4
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %53
32: ; preds = %28
store i32 0, i32* %3
br label %33
33: ; preds = %46, %32
%34 = load i32, i32* %3
%35 = load i32, i32* %5
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %49
37: ; preds = %33
%38 = load i32, i32* %2
%39 = sext i32 %38 to i64
%40 = mul nsw i64 %39, %17
%41 = getelementptr inbounds i32, i32* %20, i64 %40
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %44)
br label %46
46: ; preds = %37
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %33
49: ; preds = %33
br label %50
50: ; preds = %49
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %28
53: ; preds = %28
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %55
55: ; preds = %79, %53
%56 = load i32, i32* %2
%57 = load i32, i32* %4
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %82
59: ; preds = %55
store i32 0, i32* %3
br label %60
60: ; preds = %74, %59
%61 = load i32, i32* %3
%62 = load i32, i32* %5
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %77
64: ; preds = %60
%65 = load i32, i32* %2
%66 = sext i32 %65 to i64
%67 = mul nsw i64 %66, %17
%68 = getelementptr inbounds i32, i32* %20, i64 %67
%69 = load i32, i32* %3
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %68, i64 %70
%72 = load i32, i32* %71
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %64
%75 = load i32, i32* %3
%76 = add nsw i32 %75, 1
store i32 %76, i32* %3
br label %60
77: ; preds = %60
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %79
79: ; preds = %77
%80 = load i32, i32* %2
%81 = add nsw i32 %80, 1
store i32 %81, i32* %2
br label %55
82: ; preds = %55
store i32 0, i32* %2
br label %83
83: ; preds = %112, %82
%84 = load i32, i32* %2
%85 = load i32, i32* %4
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %115
87: ; preds = %83
store i32 0, i32* %3
br label %88
88: ; preds = %108, %87
%89 = load i32, i32* %3
%90 = load i32, i32* %5
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %111
92: ; preds = %88
%93 = load i32, i32* %3
%94 = sext i32 %93 to i64
%95 = mul nsw i64 %94, %17
%96 = getelementptr inbounds i32, i32* %20, i64 %95
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32, i32* %96, i64 %98
%100 = load i32, i32* %99
%101 = load i32, i32* %2
%102 = sext i32 %101 to i64
%103 = mul nsw i64 %102, %24
%104 = getelementptr inbounds i32, i32* %26, i64 %103
%105 = load i32, i32* %3
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i32, i32* %104, i64 %106
store i32 %100, i32* %107
br label %108
108: ; preds = %92
%109 = load i32, i32* %3
%110 = add nsw i32 %109, 1
store i32 %110, i32* %3
br label %88
111: ; preds = %88
br label %112
112: ; preds = %111
%113 = load i32, i32* %2
%114 = add nsw i32 %113, 1
store i32 %114, i32* %2
br label %83
115: ; preds = %83
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %117
117: ; preds = %141, %115
%118 = load i32, i32* %2
%119 = load i32, i32* %4
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %144
121: ; preds = %117
store i32 0, i32* %3
br label %122
122: ; preds = %136, %121
%123 = load i32, i32* %3
%124 = load i32, i32* %5
%125 = icmp slt i32 %123, %124
br i1 %125, label %126, label %139
126: ; preds = %122
%127 = load i32, i32* %2
%128 = sext i32 %127 to i64
%129 = mul nsw i64 %128, %24
%130 = getelementptr inbounds i32, i32* %26, i64 %129
%131 = load i32, i32* %3
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i32, i32* %130, i64 %132
%134 = load i32, i32* %133
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %134)
br label %136
136: ; preds = %126
%137 = load i32, i32* %3
%138 = add nsw i32 %137, 1
store i32 %138, i32* %3
br label %122
139: ; preds = %122
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %141
141: ; preds = %139
%142 = load i32, i32* %2
%143 = add nsw i32 %142, 1
store i32 %143, i32* %2
br label %117
144: ; preds = %117
store i32 0, i32* %1
%145 = load i8*, i8** %6
%146 = load i32, i32* %1
ret i32 %146
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [4 x i8] c"%d \00"
@str = [45 x i8] c"Please enter the order m x n of the matrix. \00"
@str.7 = [42 x i8] c"Please enter the elements of the matrix. \00"
@str.8 = [28 x i8] c"The matrix you entered is: \00"
@str.9 = [45 x i8] c"The transpose of the matrix you entered is: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %1
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
%13 = mul nuw i64 %11, %9
%14 = alloca i32, i64 %13
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %1
%18 = zext i32 %17 to i64
%19 = mul nuw i64 %18, %16
%20 = alloca i32, i64 %19
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.7, i64 0, i64 0))
%22 = load i32, i32* %1
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %50
24: ; preds = %0
%25 = load i32, i32* %2
br label %26
26: ; preds = %24, %44
%27 = phi i32 [ %22, %24 ], [ %45, %44 ]
%28 = phi i32 [ %25, %24 ], [ %46, %44 ]
%29 = phi i64 [ 0, %24 ], [ %47, %44 ]
%30 = icmp sgt i32 %28, 0
br i1 %30, label %31, label %44
31: ; preds = %26
%32 = mul nuw nsw i64 %29, %11
%33 = getelementptr inbounds i32, i32* %14, i64 %32
br label %34
34: ; preds = %31, %34
%35 = phi i64 [ 0, %31 ], [ %38, %34 ]
%36 = getelementptr inbounds i32, i32* %33, i64 %35
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %36)
%38 = add nuw nsw i64 %35, 1
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = icmp slt i64 %38, %40
br i1 %41, label %34, label %42
42: ; preds = %34
%43 = load i32, i32* %1
br label %44
44: ; preds = %42, %26
%45 = phi i32 [ %43, %42 ], [ %27, %26 ]
%46 = phi i32 [ %39, %42 ], [ %28, %26 ]
%47 = add nuw nsw i64 %29, 1
%48 = sext i32 %45 to i64
%49 = icmp slt i64 %47, %48
br i1 %49, label %26, label %50
50: ; preds = %44, %0
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.8, i64 0, i64 0))
%52 = load i32, i32* %1
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %221
54: ; preds = %50, %92
%55 = phi i64 [ %94, %92 ], [ 0, %50 ]
%56 = load i32, i32* %2
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %92
58: ; preds = %54
%59 = mul nuw nsw i64 %55, %11
%60 = getelementptr inbounds i32, i32* %14, i64 %59
br label %83
61: ; preds = %92
%62 = icmp sgt i32 %95, 0
br i1 %62, label %63, label %221
63: ; preds = %61
%64 = load i32, i32* %2
%65 = icmp sgt i32 %64, 0
%66 = zext i32 %95 to i64
%67 = zext i32 %64 to i64
%68 = and i64 %67, 4294967288
%69 = add nsw i64 %68, -8
%70 = lshr exact i64 %69, 3
%71 = add nuw nsw i64 %70, 1
%72 = icmp ugt i32 %64, 7
%73 = icmp eq i32 %10, 1
%74 = select i1 %72, i1 %73, i1 false
%75 = and i64 %67, 4294967288
%76 = and i64 %71, 3
%77 = icmp ult i64 %69, 24
%78 = and i64 %71, 4611686018427387900
%79 = icmp eq i64 %76, 0
%80 = icmp eq i64 %75, %67
%81 = and i64 %67, 3
%82 = icmp eq i64 %81, 0
br label %98
83: ; preds = %58, %83
%84 = phi i64 [ 0, %58 ], [ %88, %83 ]
%85 = getelementptr inbounds i32, i32* %60, i64 %84
%86 = load i32, i32* %85
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %86)
%88 = add nuw nsw i64 %84, 1
%89 = load i32, i32* %2
%90 = sext i32 %89 to i64
%91 = icmp slt i64 %88, %90
br i1 %91, label %83, label %92
92: ; preds = %83, %54
%93 = call i32 @putchar(i32 10)
%94 = add nuw nsw i64 %55, 1
%95 = load i32, i32* %1
%96 = sext i32 %95 to i64
%97 = icmp slt i64 %94, %96
br i1 %97, label %54, label %61
98: ; preds = %63, %218
%99 = phi i64 [ 0, %63 ], [ %219, %218 ]
br i1 %65, label %100, label %218
100: ; preds = %98
%101 = mul nuw nsw i64 %99, %18
%102 = getelementptr inbounds i32, i32* %20, i64 %101
%103 = getelementptr inbounds i32, i32* %14, i64 %99
br i1 %74, label %104, label %178
104: ; preds = %100
br i1 %77, label %158, label %105
105: ; preds = %104, %105
%106 = phi i64 [ %155, %105 ], [ 0, %104 ]
%107 = phi i64 [ %156, %105 ], [ 0, %104 ]
%108 = mul nuw nsw i64 %106, %11
%109 = getelementptr inbounds i32, i32* %103, i64 %108
%110 = bitcast i32* %109 to <4 x i32>*
%111 = load <4 x i32>, <4 x i32>* %110
%112 = getelementptr inbounds i32, i32* %109, i64 4
%113 = bitcast i32* %112 to <4 x i32>*
%114 = load <4 x i32>, <4 x i32>* %113
%115 = getelementptr inbounds i32, i32* %102, i64 %106
%116 = bitcast i32* %115 to <4 x i32>*
store <4 x i32> %111, <4 x i32>* %116
%117 = getelementptr inbounds i32, i32* %115, i64 4
%118 = bitcast i32* %117 to <4 x i32>*
store <4 x i32> %114, <4 x i32>* %118
%119 = or i64 %106, 8
%120 = mul nuw nsw i64 %119, %11
%121 = getelementptr inbounds i32, i32* %103, i64 %120
%122 = bitcast i32* %121 to <4 x i32>*
%123 = load <4 x i32>, <4 x i32>* %122
%124 = getelementptr inbounds i32, i32* %121, i64 4
%125 = bitcast i32* %124 to <4 x i32>*
%126 = load <4 x i32>, <4 x i32>* %125
%127 = getelementptr inbounds i32, i32* %102, i64 %119
%128 = bitcast i32* %127 to <4 x i32>*
store <4 x i32> %123, <4 x i32>* %128
%129 = getelementptr inbounds i32, i32* %127, i64 4
%130 = bitcast i32* %129 to <4 x i32>*
store <4 x i32> %126, <4 x i32>* %130
%131 = or i64 %106, 16
%132 = mul nuw nsw i64 %131, %11
%133 = getelementptr inbounds i32, i32* %103, i64 %132
%134 = bitcast i32* %133 to <4 x i32>*
%135 = load <4 x i32>, <4 x i32>* %134
%136 = getelementptr inbounds i32, i32* %133, i64 4
%137 = bitcast i32* %136 to <4 x i32>*
%138 = load <4 x i32>, <4 x i32>* %137
%139 = getelementptr inbounds i32, i32* %102, i64 %131
%140 = bitcast i32* %139 to <4 x i32>*
store <4 x i32> %135, <4 x i32>* %140
%141 = getelementptr inbounds i32, i32* %139, i64 4
%142 = bitcast i32* %141 to <4 x i32>*
store <4 x i32> %138, <4 x i32>* %142
%143 = or i64 %106, 24
%144 = mul nuw nsw i64 %143, %11
%145 = getelementptr inbounds i32, i32* %103, i64 %144
%146 = bitcast i32* %145 to <4 x i32>*
%147 = load <4 x i32>, <4 x i32>* %146
%148 = getelementptr inbounds i32, i32* %145, i64 4
%149 = bitcast i32* %148 to <4 x i32>*
%150 = load <4 x i32>, <4 x i32>* %149
%151 = getelementptr inbounds i32, i32* %102, i64 %143
%152 = bitcast i32* %151 to <4 x i32>*
store <4 x i32> %147, <4 x i32>* %152
%153 = getelementptr inbounds i32, i32* %151, i64 4
%154 = bitcast i32* %153 to <4 x i32>*
store <4 x i32> %150, <4 x i32>* %154
%155 = add nuw i64 %106, 32
%156 = add i64 %107, 4
%157 = icmp eq i64 %156, %78
br i1 %157, label %158, label %105
158: ; preds = %105, %104
%159 = phi i64 [ 0, %104 ], [ %155, %105 ]
br i1 %79, label %177, label %160
160: ; preds = %158, %160
%161 = phi i64 [ %174, %160 ], [ %159, %158 ]
%162 = phi i64 [ %175, %160 ], [ 0, %158 ]
%163 = mul nuw nsw i64 %161, %11
%164 = getelementptr inbounds i32, i32* %103, i64 %163
%165 = bitcast i32* %164 to <4 x i32>*
%166 = load <4 x i32>, <4 x i32>* %165
%167 = getelementptr inbounds i32, i32* %164, i64 4
%168 = bitcast i32* %167 to <4 x i32>*
%169 = load <4 x i32>, <4 x i32>* %168
%170 = getelementptr inbounds i32, i32* %102, i64 %161
%171 = bitcast i32* %170 to <4 x i32>*
store <4 x i32> %166, <4 x i32>* %171
%172 = getelementptr inbounds i32, i32* %170, i64 4
%173 = bitcast i32* %172 to <4 x i32>*
store <4 x i32> %169, <4 x i32>* %173
%174 = add nuw i64 %161, 8
%175 = add i64 %162, 1
%176 = icmp eq i64 %175, %76
br i1 %176, label %177, label %160
177: ; preds = %160, %158
br i1 %80, label %218, label %178
178: ; preds = %100, %177
%179 = phi i64 [ 0, %100 ], [ %75, %177 ]
%180 = xor i64 %179, -1
%181 = add nsw i64 %180, %67
br i1 %82, label %192, label %182
182: ; preds = %178, %182
%183 = phi i64 [ %189, %182 ], [ %179, %178 ]
%184 = phi i64 [ %190, %182 ], [ 0, %178 ]
%185 = mul nuw nsw i64 %183, %11
%186 = getelementptr inbounds i32, i32* %103, i64 %185
%187 = load i32, i32* %186
%188 = getelementptr inbounds i32, i32* %102, i64 %183
store i32 %187, i32* %188
%189 = add nuw nsw i64 %183, 1
%190 = add i64 %184, 1
%191 = icmp eq i64 %190, %81
br i1 %191, label %192, label %182
192: ; preds = %182, %178
%193 = phi i64 [ %179, %178 ], [ %189, %182 ]
%194 = icmp ult i64 %181, 3
br i1 %194, label %218, label %195
195: ; preds = %192, %195
%196 = phi i64 [ %216, %195 ], [ %193, %192 ]
%197 = mul nuw nsw i64 %196, %11
%198 = getelementptr inbounds i32, i32* %103, i64 %197
%199 = load i32, i32* %198
%200 = getelementptr inbounds i32, i32* %102, i64 %196
store i32 %199, i32* %200
%201 = add nuw nsw i64 %196, 1
%202 = mul nuw nsw i64 %201, %11
%203 = getelementptr inbounds i32, i32* %103, i64 %202
%204 = load i32, i32* %203
%205 = getelementptr inbounds i32, i32* %102, i64 %201
store i32 %204, i32* %205
%206 = add nuw nsw i64 %196, 2
%207 = mul nuw nsw i64 %206, %11
%208 = getelementptr inbounds i32, i32* %103, i64 %207
%209 = load i32, i32* %208
%210 = getelementptr inbounds i32, i32* %102, i64 %206
store i32 %209, i32* %210
%211 = add nuw nsw i64 %196, 3
%212 = mul nuw nsw i64 %211, %11
%213 = getelementptr inbounds i32, i32* %103, i64 %212
%214 = load i32, i32* %213
%215 = getelementptr inbounds i32, i32* %102, i64 %211
store i32 %214, i32* %215
%216 = add nuw nsw i64 %196, 4
%217 = icmp eq i64 %216, %67
br i1 %217, label %218, label %195
218: ; preds = %192, %195, %177, %98
%219 = add nuw nsw i64 %99, 1
%220 = icmp eq i64 %219, %66
br i1 %220, label %221, label %98
221: ; preds = %218, %50, %61
%222 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.9, i64 0, i64 0))
%223 = load i32, i32* %1
%224 = icmp sgt i32 %223, 0
br i1 %224, label %225, label %247
225: ; preds = %221, %241
%226 = phi i64 [ %243, %241 ], [ 0, %221 ]
%227 = load i32, i32* %2
%228 = icmp sgt i32 %227, 0
br i1 %228, label %229, label %241
229: ; preds = %225
%230 = mul nuw nsw i64 %226, %18
%231 = getelementptr inbounds i32, i32* %20, i64 %230
br label %232
232: ; preds = %229, %232
%233 = phi i64 [ 0, %229 ], [ %237, %232 ]
%234 = getelementptr inbounds i32, i32* %231, i64 %233
%235 = load i32, i32* %234
%236 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %235)
%237 = add nuw nsw i64 %233, 1
%238 = load i32, i32* %2
%239 = sext i32 %238 to i64
%240 = icmp slt i64 %237, %239
br i1 %240, label %232, label %241
241: ; preds = %232, %225
%242 = call i32 @putchar(i32 10)
%243 = add nuw nsw i64 %226, 1
%244 = load i32, i32* %1
%245 = sext i32 %244 to i64
%246 = icmp slt i64 %243, %245
br i1 %246, label %225, label %247
247: ; preds = %241, %221
ret i32 0
}