#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 n;
  int a[10][10];
  int b[10][10];
  int answer[10][10];
  int i, j;
  printf("Enter order of the matrix: ");
  scanf("%d", &n);
  printf("Enter elements of matrix 1: \n");
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  printf("Enter elements of matrix 2: \n");
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      scanf("%d", &b[i][j]);
    }
  }
  printf("Martix 1:\n");
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      printf("%d ", a[i][j]);
    }
    printf("\n");
  }
  printf("Matrix 2:\n");
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      printf("%d ", b[i][j]);
    }
    printf("\n");
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      answer[i][j] = a[i][j] + b[i][j];
    }
  }
  printf("Sum of the 2 matrices is:\n");
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      printf("%d ", answer[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c4(%rbp)
mov    -0x4c4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ec <main+0xcc>
movl   $0x0,-0x4c8(%rbp)
mov    -0x4c8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d3 <main+0xb3>
movslq -0x4c4(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
movslq -0x4c8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe62(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x4c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c8(%rbp)
jmp    1181 <main+0x61>
jmp    11d8 <main+0xb8>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    1168 <main+0x48>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c4(%rbp)
mov    -0x4c4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1288 <main+0x168>
movl   $0x0,-0x4c8(%rbp)
mov    -0x4c8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    126f <main+0x14f>
movslq -0x4c4(%rbp),%rax
lea    -0x330(%rbp),%rsi
imul   $0x28,%rax,%rax
add    %rax,%rsi
movslq -0x4c8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdc6(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x4c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c8(%rbp)
jmp    121d <main+0xfd>
jmp    1274 <main+0x154>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    1204 <main+0xe4>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c4(%rbp)
mov    -0x4c4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    132b <main+0x20b>
movl   $0x0,-0x4c8(%rbp)
mov    -0x4c8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1309 <main+0x1e9>
movslq -0x4c4(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x4c8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c8(%rbp)
jmp    12b9 <main+0x199>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    12a0 <main+0x180>
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c4(%rbp)
mov    -0x4c4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13ce <main+0x2ae>
movl   $0x0,-0x4c8(%rbp)
mov    -0x4c8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13ac <main+0x28c>
movslq -0x4c4(%rbp),%rcx
lea    -0x330(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x4c8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c8(%rbp)
jmp    135c <main+0x23c>
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    1343 <main+0x223>
movl   $0x0,-0x4c4(%rbp)
mov    -0x4c4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    148a <main+0x36a>
movl   $0x0,-0x4c8(%rbp)
mov    -0x4c8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1471 <main+0x351>
movslq -0x4c4(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x4c8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x4c4(%rbp),%rcx
lea    -0x330(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x4c8(%rbp),%rcx
add    (%rax,%rcx,4),%edx
movslq -0x4c4(%rbp),%rcx
lea    -0x4c0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x4c8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c8(%rbp)
jmp    13f1 <main+0x2d1>
jmp    1476 <main+0x356>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    13d8 <main+0x2b8>
lea    0xbe4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c4(%rbp)
mov    -0x4c4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    152d <main+0x40d>
movl   $0x0,-0x4c8(%rbp)
mov    -0x4c8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    150b <main+0x3eb>
movslq -0x4c4(%rbp),%rcx
lea    -0x4c0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x4c8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xb76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c8(%rbp)
jmp    14bb <main+0x39b>
lea    0xb29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c4(%rbp)
jmp    14a2 <main+0x382>
xor    %eax,%eax
add    $0x4d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4c8,%rsp
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11df <main+0x9f>
lea    0x1a0(%rsp),%r15
xor    %r12d,%r12d
lea    0xe86(%rip),%r14
jmp    11b0 <main+0x70>
nopl   0x0(%rax,%rax,1)
movslq %eax,%rcx
add    $0x1,%r12
add    $0x28,%r15
cmp    %rcx,%r12
jge    11df <main+0x9f>
test   %eax,%eax
jle    11a0 <main+0x60>
mov    %r15,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11c0 <main+0x80>
jmp    11a0 <main+0x60>
lea    0xe5a(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    124f <main+0x10f>
lea    0x10(%rsp),%r15
xor    %r12d,%r12d
lea    0xe1a(%rip),%r14
jmp    1220 <main+0xe0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %eax,%rcx
add    $0x1,%r12
add    $0x28,%r15
cmp    %rcx,%r12
jge    124f <main+0x10f>
test   %eax,%eax
jle    1210 <main+0xd0>
mov    %r15,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     1230 <main+0xf0>
jmp    1210 <main+0xd0>
lea    0xe07(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    12cd <main+0x18d>
lea    0x1a0(%rsp),%rbx
lea    0xdad(%rip),%r14
xor    %r15d,%r15d
jmp    129c <main+0x15c>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
movslq 0x4(%rsp),%rax
add    $0x28,%rbx
cmp    %rax,%r15
jge    12cd <main+0x18d>
test   %eax,%eax
jle    1280 <main+0x140>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
cmp    %rax,%rbp
jl     12b0 <main+0x170>
jmp    1280 <main+0x140>
lea    0xd93(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%r14d
test   %r14d,%r14d
jle    14f7 <main+0x3b7>
lea    0x10(%rsp),%rbx
lea    0xd2c(%rip),%r15
xor    %r12d,%r12d
jmp    131c <main+0x1dc>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
movslq 0x4(%rsp),%r14
add    $0x28,%rbx
cmp    %r14,%r12
jge    134d <main+0x20d>
test   %r14d,%r14d
jle    1300 <main+0x1c0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%rbp,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
cmp    %rax,%rbp
jl     1330 <main+0x1f0>
jmp    1300 <main+0x1c0>
test   %r14d,%r14d
jle    14f7 <main+0x3b7>
mov    %r14d,%r15d
mov    %r15d,%r11d
and    $0xfffffff8,%r11d
lea    -0x8(%r11),%r9
mov    %r9,%r10
shr    $0x3,%r10
add    $0x1,%r10
mov    %r10,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,0x8(%rsp)
lea    0x1d0(%rsp),%rbx
lea    0x40(%rsp),%rsi
lea    0x360(%rsp),%rdi
lea    0x1a0(%rsp),%r13
lea    0x10(%rsp),%rax
lea    0x330(%rsp),%rcx
xor    %r12d,%r12d
jmp    13d5 <main+0x295>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
add    $0x28,%rbx
add    $0x28,%rsi
add    $0x28,%rdi
add    $0x28,%r13
add    $0x28,%rax
add    $0x28,%rcx
cmp    %r15,%r12
je     14f7 <main+0x3b7>
cmp    $0x8,%r14d
jae    13f0 <main+0x2b0>
xor    %edx,%edx
jmp    14d0 <main+0x390>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %r9,%r9
je     14e9 <main+0x3a9>
mov    0x8(%rsp),%rbp
xor    %edx,%edx
movdqu -0x30(%rbx,%rdx,4),%xmm0
movdqu -0x20(%rbx,%rdx,4),%xmm1
movdqu -0x30(%rsi,%rdx,4),%xmm2
paddd  %xmm0,%xmm2
movdqu -0x20(%rsi,%rdx,4),%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm2,-0x30(%rdi,%rdx,4)
movdqu %xmm0,-0x20(%rdi,%rdx,4)
movdqu -0x10(%rbx,%rdx,4),%xmm0
movdqu (%rbx,%rdx,4),%xmm1
movdqu -0x10(%rsi,%rdx,4),%xmm2
paddd  %xmm0,%xmm2
movdqu (%rsi,%rdx,4),%xmm0
paddd  %xmm1,%xmm0
movdqu %xmm2,-0x10(%rdi,%rdx,4)
movdqu %xmm0,(%rdi,%rdx,4)
add    $0x10,%rdx
add    $0xfffffffffffffffe,%rbp
jne    1400 <main+0x2c0>
test   $0x1,%r10b
je     14ba <main+0x37a>
lea    0x0(,%r12,8),%rbp
lea    0x0(%rbp,%rbp,4),%rbp
lea    (%rsp,%rbp,1),%r8
add    $0x1a0,%r8
movdqu (%r8,%rdx,4),%xmm0
movdqu 0x10(%r8,%rdx,4),%xmm1
lea    0x10(%rsp,%rbp,1),%r8
movdqu (%r8,%rdx,4),%xmm2
paddd  %xmm0,%xmm2
movdqu 0x10(%r8,%rdx,4),%xmm0
paddd  %xmm1,%xmm0
add    %rsp,%rbp
add    $0x330,%rbp
movdqu %xmm2,0x0(%rbp,%rdx,4)
movdqu %xmm0,0x10(%rbp,%rdx,4)
mov    %r11,%rdx
cmp    %r15,%r11
je     13b0 <main+0x270>
cs nopw 0x0(%rax,%rax,1)
mov    (%rax,%rdx,4),%ebp
add    0x0(%r13,%rdx,4),%ebp
mov    %ebp,(%rcx,%rdx,4)
add    $0x1,%rdx
cmp    %rdx,%r15
jne    14d0 <main+0x390>
jmp    13b0 <main+0x270>
xor    %edx,%edx
test   $0x1,%r10b
jne    1465 <main+0x325>
jmp    14ba <main+0x37a>
lea    0xb73(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    156d <main+0x42d>
lea    0x330(%rsp),%rbx
lea    0xb05(%rip),%r14
xor    %r15d,%r15d
jmp    153c <main+0x3fc>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
movslq 0x4(%rsp),%rax
add    $0x28,%rbx
cmp    %rax,%r15
jge    156d <main+0x42d>
test   %eax,%eax
jle    1520 <main+0x3e0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
cmp    %rax,%rbp
jl     1550 <main+0x410>
jmp    1520 <main+0x3e0>
xor    %eax,%eax
add    $0x4c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter order of the matrix: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"Enter elements of matrix 1: \0A\00"
@.str.3 = [30 x i8] c"Enter elements of matrix 2: \0A\00"
@.str.4 = [11 x i8] c"Martix 1:\0A\00"
@.str.5 = [4 x i8] c"%d \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [11 x i8] c"Matrix 2:\0A\00"
@.str.8 = [27 x i8] c"Sum of the 2 matrices is:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x [10 x i32]]
%4 = alloca [10 x [10 x i32]]
%5 = alloca [10 x [10 x i32]]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %11
11: ; preds = %32, %0
%12 = load i32, i32* %6
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %35
15: ; preds = %11
store i32 0, i32* %7
br label %16
16: ; preds = %28, %15
%17 = load i32, i32* %7
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %22
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %23, i64 0, i64 %25
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %26)
br label %28
28: ; preds = %20
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %16
31: ; preds = %16
br label %32
32: ; preds = %31
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %11
35: ; preds = %11
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %37
37: ; preds = %58, %35
%38 = load i32, i32* %6
%39 = load i32, i32* %2
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %61
41: ; preds = %37
store i32 0, i32* %7
br label %42
42: ; preds = %54, %41
%43 = load i32, i32* %7
%44 = load i32, i32* %2
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %57
46: ; preds = %42
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %48
%50 = load i32, i32* %7
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %49, i64 0, i64 %51
%53 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %52)
br label %54
54: ; preds = %46
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %42
57: ; preds = %42
br label %58
58: ; preds = %57
%59 = load i32, i32* %6
%60 = add nsw i32 %59, 1
store i32 %60, i32* %6
br label %37
61: ; preds = %37
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %63
63: ; preds = %86, %61
%64 = load i32, i32* %6
%65 = load i32, i32* %2
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %89
67: ; preds = %63
store i32 0, i32* %7
br label %68
68: ; preds = %81, %67
%69 = load i32, i32* %7
%70 = load i32, i32* %2
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %84
72: ; preds = %68
%73 = load i32, i32* %6
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %74
%76 = load i32, i32* %7
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [10 x i32], [10 x i32]* %75, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %79)
br label %81
81: ; preds = %72
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
store i32 %83, i32* %7
br label %68
84: ; preds = %68
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %86
86: ; preds = %84
%87 = load i32, i32* %6
%88 = add nsw i32 %87, 1
store i32 %88, i32* %6
br label %63
89: ; preds = %63
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %6
br label %91
91: ; preds = %114, %89
%92 = load i32, i32* %6
%93 = load i32, i32* %2
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %117
95: ; preds = %91
store i32 0, i32* %7
br label %96
96: ; preds = %109, %95
%97 = load i32, i32* %7
%98 = load i32, i32* %2
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %112
100: ; preds = %96
%101 = load i32, i32* %6
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %102
%104 = load i32, i32* %7
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [10 x i32], [10 x i32]* %103, i64 0, i64 %105
%107 = load i32, i32* %106
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %107)
br label %109
109: ; preds = %100
%110 = load i32, i32* %7
%111 = add nsw i32 %110, 1
store i32 %111, i32* %7
br label %96
112: ; preds = %96
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %114
114: ; preds = %112
%115 = load i32, i32* %6
%116 = add nsw i32 %115, 1
store i32 %116, i32* %6
br label %91
117: ; preds = %91
store i32 0, i32* %6
br label %118
118: ; preds = %153, %117
%119 = load i32, i32* %6
%120 = load i32, i32* %2
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %156
122: ; preds = %118
store i32 0, i32* %7
br label %123
123: ; preds = %149, %122
%124 = load i32, i32* %7
%125 = load i32, i32* %2
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %152
127: ; preds = %123
%128 = load i32, i32* %6
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %3, i64 0, i64 %129
%131 = load i32, i32* %7
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [10 x i32], [10 x i32]* %130, i64 0, i64 %132
%134 = load i32, i32* %133
%135 = load i32, i32* %6
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %136
%138 = load i32, i32* %7
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [10 x i32], [10 x i32]* %137, i64 0, i64 %139
%141 = load i32, i32* %140
%142 = add nsw i32 %134, %141
%143 = load i32, i32* %6
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %5, i64 0, i64 %144
%146 = load i32, i32* %7
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [10 x i32], [10 x i32]* %145, i64 0, i64 %147
store i32 %142, i32* %148
br label %149
149: ; preds = %127
%150 = load i32, i32* %7
%151 = add nsw i32 %150, 1
store i32 %151, i32* %7
br label %123
152: ; preds = %123
br label %153
153: ; preds = %152
%154 = load i32, i32* %6
%155 = add nsw i32 %154, 1
store i32 %155, i32* %6
br label %118
156: ; preds = %118
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %6
br label %158
158: ; preds = %181, %156
%159 = load i32, i32* %6
%160 = load i32, i32* %2
%161 = icmp slt i32 %159, %160
br i1 %161, label %162, label %184
162: ; preds = %158
store i32 0, i32* %7
br label %163
163: ; preds = %176, %162
%164 = load i32, i32* %7
%165 = load i32, i32* %2
%166 = icmp slt i32 %164, %165
br i1 %166, label %167, label %179
167: ; preds = %163
%168 = load i32, i32* %6
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %5, i64 0, i64 %169
%171 = load i32, i32* %7
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds [10 x i32], [10 x i32]* %170, i64 0, i64 %172
%174 = load i32, i32* %173
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %174)
br label %176
176: ; preds = %167
%177 = load i32, i32* %7
%178 = add nsw i32 %177, 1
store i32 %178, i32* %7
br label %163
179: ; preds = %163
%180 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %181
181: ; preds = %179
%182 = load i32, i32* %6
%183 = add nsw i32 %182, 1
store i32 %183, i32* %6
br label %158
184: ; preds = %158
ret i32 0
}

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