#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stderr;
int main() {
  int i, j, rows, columns, matrix[25][25];
  printf("Matrix - Display \n");
  printf("Maximum Permissible Rows/Columns = 24 \n");
  printf("\n");
  printf("Rows = ");
  scanf("%d", &rows);
  printf("Columns = ");
  scanf("%d", &columns);
  if ((rows > 24) || (columns > 24)) {
    fprintf(stderr, "Rows/Columns > 24 \nAborting! \n");
    return -1;
  }
  printf("\n");
  printf("Input the Matrix: \n");
  for (i = 0; i < rows; i++) {
    for (j = 0; j < columns; j++) {
      scanf("%d", &matrix[i][j]);
    }
  }
  printf("\n\nMatrix: \n");
  for (i = 0; i < rows; i++) {
    for (j = 0; j < columns; j++) {
      printf("%d	", matrix[i][j]);
    }
    printf("\n");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x18,-0x10(%rbp)
jg     11bc <main+0x8c>
cmpl   $0x18,-0x14(%rbp)
jle    11dd <main+0xad>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1303 <main+0x1d3>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1269 <main+0x139>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1256 <main+0x126>
movslq -0x8(%rbp),%rax
lea    -0x9e0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe00(%rip),%rdi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1213 <main+0xe3>
jmp    125b <main+0x12b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1200 <main+0xd0>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12ee <main+0x1be>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12d2 <main+0x1a2>
movslq -0x8(%rbp),%rcx
lea    -0x9e0(%rbp),%rax
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1291 <main+0x161>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    127e <main+0x14e>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x9e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9e0,%rsp
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe71(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
cmpl   $0x18,0xc(%rsp)
jg     1243 <main+0xf3>
cmpl   $0x19,0x8(%rsp)
jge    1243 <main+0xf3>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    1262 <main+0x112>
lea    0x10(%rsp),%r15
mov    0x8(%rsp),%eax
xor    %r12d,%r12d
lea    0xe0a(%rip),%r14
jmp    1210 <main+0xc0>
add    $0x1,%r12
movslq %ecx,%rdx
add    $0x64,%r15
cmp    %rdx,%r12
jge    1262 <main+0x112>
test   %eax,%eax
jle    1200 <main+0xb0>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     1220 <main+0xd0>
mov    0xc(%rsp),%ecx
jmp    1200 <main+0xb0>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
lea    0xdc3(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    12ea <main+0x19a>
lea    0xe1c(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    12de <main+0x18e>
lea    0x10(%rsp),%r12
lea    0xdb4(%rip),%r14
xor    %r15d,%r15d
jmp    12ac <main+0x15c>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
movslq 0xc(%rsp),%rax
add    $0x64,%r12
cmp    %rax,%r15
jge    12de <main+0x18e>
cmpl   $0x0,0x8(%rsp)
jle    1290 <main+0x140>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jl     12c0 <main+0x170>
jmp    1290 <main+0x140>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x9e0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Matrix - Display \0A\00"
@.str.1 = [40 x i8] c"Maximum Permissible Rows/Columns = 24 \0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [8 x i8] c"Rows = \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [11 x i8] c"Columns = \00"
@stderr = global i32 0
@.str.6 = [31 x i8] c"Rows/Columns > 24 \0AAborting! \0A\00"
@.str.7 = [20 x i8] c"Input the Matrix: \0A\00"
@.str.8 = [12 x i8] c"\0A\0AMatrix: \0A\00"
@.str.9 = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [25 x [25 x i32]]
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 24
br i1 %15, label %19, label %16
16: ; preds = %0
%17 = load i32, i32* %5
%18 = icmp sgt i32 %17, 24
br i1 %18, label %19, label %22
19: ; preds = %16, %0
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
store i32 -1, i32* %1
br label %79
22: ; preds = %16
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %2
br label %25
25: ; preds = %46, %22
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %49
29: ; preds = %25
store i32 0, i32* %3
br label %30
30: ; preds = %42, %29
%31 = load i32, i32* %3
%32 = load i32, i32* %5
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %45
34: ; preds = %30
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [25 x [25 x i32]], [25 x [25 x i32]]* %6, i64 0, i64 %36
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [25 x i32], [25 x i32]* %37, i64 0, i64 %39
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %40)
br label %42
42: ; preds = %34
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %30
45: ; preds = %30
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %25
49: ; preds = %25
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %51
51: ; preds = %74, %49
%52 = load i32, i32* %2
%53 = load i32, i32* %4
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %77
55: ; preds = %51
store i32 0, i32* %3
br label %56
56: ; preds = %69, %55
%57 = load i32, i32* %3
%58 = load i32, i32* %5
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %72
60: ; preds = %56
%61 = load i32, i32* %2
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [25 x [25 x i32]], [25 x [25 x i32]]* %6, i64 0, i64 %62
%64 = load i32, i32* %3
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [25 x i32], [25 x i32]* %63, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %60
%70 = load i32, i32* %3
%71 = add nsw i32 %70, 1
store i32 %71, i32* %3
br label %56
72: ; preds = %56
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %74
74: ; preds = %72
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %51
77: ; preds = %51
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %79
79: ; preds = %77, %19
%80 = load i32, i32* %1
ret i32 %80
}

LLVM IR (-O2):
@.str.3 = [8 x i8] c"Rows = \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [11 x i8] c"Columns = \00"
@stderr = global i32 0
@.str.6 = [31 x i8] c"Rows/Columns > 24 \0AAborting! \0A\00"
@.str.9 = [4 x i8] c"%d\09\00"
@str = [18 x i8] c"Matrix - Display \00"
@str.10 = [39 x i8] c"Maximum Permissible Rows/Columns = 24 \00"
@str.11 = [19 x i8] c"Input the Matrix: \00"
@str.12 = [11 x i8] c"\0A\0AMatrix: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [25 x [25 x i32]]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [25 x [25 x i32]]* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 24
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 24
%18 = select i1 %15, i1 true, i1 %17
br i1 %18, label %19, label %22
19: ; preds = %0
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %75
22: ; preds = %0
%23 = call i32 @putchar(i32 10)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.11, i64 0, i64 0))
%25 = load i32, i32* %1
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %50
27: ; preds = %22
%28 = load i32, i32* %2
br label %29
29: ; preds = %27, %44
%30 = phi i32 [ %25, %27 ], [ %45, %44 ]
%31 = phi i32 [ %28, %27 ], [ %46, %44 ]
%32 = phi i64 [ 0, %27 ], [ %47, %44 ]
%33 = icmp sgt i32 %31, 0
br i1 %33, label %34, label %44
34: ; preds = %29, %34
%35 = phi i64 [ %38, %34 ], [ 0, %29 ]
%36 = getelementptr inbounds [25 x [25 x i32]], [25 x [25 x i32]]* %3, i64 0, i64 %32, i64 %35
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, 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, %29
%45 = phi i32 [ %43, %42 ], [ %30, %29 ]
%46 = phi i32 [ %39, %42 ], [ %31, %29 ]
%47 = add nuw nsw i64 %32, 1
%48 = sext i32 %45 to i64
%49 = icmp slt i64 %47, %48
br i1 %49, label %29, label %50
50: ; preds = %44, %22
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0))
%52 = load i32, i32* %1
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %73
54: ; preds = %50, %67
%55 = phi i64 [ %69, %67 ], [ 0, %50 ]
%56 = load i32, i32* %2
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %67
58: ; preds = %54, %58
%59 = phi i64 [ %63, %58 ], [ 0, %54 ]
%60 = getelementptr inbounds [25 x [25 x i32]], [25 x [25 x i32]]* %3, i64 0, i64 %55, i64 %59
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %61)
%63 = add nuw nsw i64 %59, 1
%64 = load i32, i32* %2
%65 = sext i32 %64 to i64
%66 = icmp slt i64 %63, %65
br i1 %66, label %58, label %67
67: ; preds = %58, %54
%68 = call i32 @putchar(i32 10)
%69 = add nuw nsw i64 %55, 1
%70 = load i32, i32* %1
%71 = sext i32 %70 to i64
%72 = icmp slt i64 %69, %71
br i1 %72, label %54, label %73
73: ; preds = %67, %50
%74 = call i32 @putchar(i32 10)
br label %75
75: ; preds = %73, %19
%76 = phi i32 [ -1, %19 ], [ 0, %73 ]
ret i32 %76
}