#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 a[100][100], n, i, j, simetrichna = 1;
  printf("Vnesete dimenzija na kvadratna matrica: \n");
  scanf("%d", &n);
  printf("Vnesete gi elementite: \n");
  for (i = 0; i < n; ++i)
    for (j = 0; j < n; ++j)
      scanf("%d", &a[i][j]);
  for (i = 0; i < n - 1; ++i) {
    for (j = i + 1; j < n; ++j)
      if (a[i][j] != a[j][i]) {
        simetrichna = 0;
        break;
      }
    if (!simetrichna)
      break;
  }
  if (simetrichna)
    printf("Matricata e SIMETRICHNA vo odnos na glavnata dijagonala\n");
  else
    printf("Matricata ne e SIMETRICHNA vo odnos na glavnata dijagonala\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x9c60(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x9c54(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    11fe <main+0xde>
movl   $0x0,-0x9c5c(%rbp)
mov    -0x9c5c(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    11e5 <main+0xc5>
movslq -0x9c58(%rbp),%rax
lea    -0x9c50(%rbp),%rsi
imul   $0x190,%rax,%rax
add    %rax,%rsi
movslq -0x9c5c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    118d <main+0x6d>
jmp    11ea <main+0xca>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    1171 <main+0x51>
movl   $0x0,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%eax
mov    -0x9c54(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12dd <main+0x1bd>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
mov    -0x9c5c(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    12b2 <main+0x192>
movslq -0x9c58(%rbp),%rcx
lea    -0x9c50(%rbp),%rax
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c5c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x9c5c(%rbp),%rdx
lea    -0x9c50(%rbp),%rcx
imul   $0x190,%rdx,%rdx
add    %rdx,%rcx
movslq -0x9c58(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     1299 <main+0x179>
movl   $0x0,-0x9c60(%rbp)
jmp    12b2 <main+0x192>
jmp    129e <main+0x17e>
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    122e <main+0x10e>
cmpl   $0x0,-0x9c60(%rbp)
jne    12c4 <main+0x1a4>
jmp    12dd <main+0x1bd>
jmp    12c9 <main+0x1a9>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    1208 <main+0xe8>
cmpl   $0x0,-0x9c60(%rbp)
je     12fb <main+0x1db>
lea    0xd55(%rip),%rdi
call   1030 <printf@plt>
jmp    1307 <main+0x1e7>
lea    0xd7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c58,%rsp
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
lea    0xf1a(%rip),%r14
test   %eax,%eax
jle    123c <main+0x11c>
lea    0x10(%rsp),%r12
xor    %r13d,%r13d
lea    0xe84(%rip),%r15
jmp    1193 <main+0x73>
xchg   %ax,%ax
movslq %eax,%rcx
add    $0x1,%r13
add    $0x190,%r12
cmp    %rcx,%r13
jge    11bf <main+0x9f>
test   %eax,%eax
jle    1180 <main+0x60>
mov    %r12,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11a0 <main+0x80>
jmp    1180 <main+0x60>
cmp    $0x2,%eax
jl     123c <main+0x11c>
mov    %eax,%r9d
add    $0xffffffff,%eax
lea    0x14(%rsp),%rdx
lea    0x1a0(%rsp),%rbp
lea    -0x1(%r9),%rdi
xor    %r10d,%r10d
lea    0xe5f(%rip),%r8
jmp    1207 <main+0xe7>
nopw   0x0(%rax,%rax,1)
add    $0x194,%rdx
add    $0x194,%rbp
add    $0xffffffffffffffff,%rdi
cmp    %rax,%r10
je     123c <main+0x11c>
add    $0x1,%r10
cmp    %r9,%r10
jae    11f0 <main+0xd0>
mov    %rbp,%rsi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rdx,%rcx,4),%ebx
cmp    (%rsi),%ebx
jne    1239 <main+0x119>
add    $0x1,%rcx
add    $0x190,%rsi
cmp    %rcx,%rdi
jne    1220 <main+0x100>
jmp    11f0 <main+0xd0>
mov    %r8,%r14
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x9c58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Vnesete dimenzija na kvadratna matrica: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Vnesete gi elementite: \0A\00"
@.str.3 = [57 x i8] c"Matricata e SIMETRICHNA vo odnos na glavnata dijagonala\0A\00"
@.str.4 = [60 x i8] c"Matricata ne e SIMETRICHNA vo odnos na glavnata dijagonala\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [100 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %10
10: ; preds = %31, %0
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %34
14: ; preds = %10
store i32 0, i32* %5
br label %15
15: ; preds = %27, %14
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 %21
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i32], [100 x i32]* %22, i64 0, i64 %24
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %25)
br label %27
27: ; preds = %19
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %15
30: ; preds = %15
br label %31
31: ; preds = %30
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %10
34: ; preds = %10
store i32 0, i32* %4
br label %35
35: ; preds = %73, %34
%36 = load i32, i32* %4
%37 = load i32, i32* %3
%38 = sub nsw i32 %37, 1
%39 = icmp slt i32 %36, %38
br i1 %39, label %40, label %76
40: ; preds = %35
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %43
43: ; preds = %65, %40
%44 = load i32, i32* %5
%45 = load i32, i32* %3
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %68
47: ; preds = %43
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 %49
%51 = load i32, i32* %5
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [100 x i32], [100 x i32]* %50, i64 0, i64 %52
%54 = load i32, i32* %53
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %2, i64 0, i64 %56
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [100 x i32], [100 x i32]* %57, i64 0, i64 %59
%61 = load i32, i32* %60
%62 = icmp ne i32 %54, %61
br i1 %62, label %63, label %64
63: ; preds = %47
store i32 0, i32* %6
br label %68
64: ; preds = %47
br label %65
65: ; preds = %64
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
store i32 %67, i32* %5
br label %43
68: ; preds = %63, %43
%69 = load i32, i32* %6
%70 = icmp ne i32 %69, 0
br i1 %70, label %72, label %71
71: ; preds = %68
br label %76
72: ; preds = %68
br label %73
73: ; preds = %72
%74 = load i32, i32* %4
%75 = add nsw i32 %74, 1
store i32 %75, i32* %4
br label %35
76: ; preds = %71, %35
%77 = load i32, i32* %6
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
br label %83
81: ; preds = %76
%82 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
br label %83
83: ; preds = %81, %79
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [41 x i8] c"Vnesete dimenzija na kvadratna matrica: \00"
@str.5 = [24 x i8] c"Vnesete gi elementite: \00"
@str.6 = [59 x i8] c"Matricata ne e SIMETRICHNA vo odnos na glavnata dijagonala\00"
@str.7 = [56 x i8] c"Matricata e SIMETRICHNA vo odnos na glavnata dijagonala\00"
define i32 @main() {
%1 = alloca [100 x [100 x i32]]
%2 = alloca i32
%3 = bitcast [100 x [100 x i32]]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 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* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %52
10: ; preds = %0, %29
%11 = phi i32 [ %30, %29 ], [ %8, %0 ]
%12 = phi i64 [ %32, %29 ], [ 0, %0 ]
%13 = icmp sgt i32 %11, 0
br i1 %13, label %21, label %29
14: ; preds = %29
%15 = icmp sgt i32 %30, 1
br i1 %15, label %16, label %52
16: ; preds = %14
%17 = add nsw i32 %30, -1
%18 = zext i32 %30 to i64
%19 = zext i32 %17 to i64
%20 = zext i32 %30 to i64
br label %37
21: ; preds = %10, %21
%22 = phi i64 [ %25, %21 ], [ 0, %10 ]
%23 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %12, i64 %22
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %23)
%25 = add nuw nsw i64 %22, 1
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %21, label %29
29: ; preds = %21, %10
%30 = phi i32 [ %11, %10 ], [ %26, %21 ]
%31 = sext i32 %30 to i64
%32 = add nuw nsw i64 %12, 1
%33 = icmp slt i64 %32, %31
br i1 %33, label %10, label %14
34: ; preds = %42, %37
%35 = add nuw nsw i64 %39, 1
%36 = icmp eq i64 %40, %19
br i1 %36, label %52, label %37
37: ; preds = %16, %34
%38 = phi i64 [ 0, %16 ], [ %40, %34 ]
%39 = phi i64 [ 1, %16 ], [ %35, %34 ]
%40 = add nuw nsw i64 %38, 1
%41 = icmp ult i64 %40, %18
br i1 %41, label %44, label %34
42: ; preds = %44
%43 = icmp eq i64 %51, %20
br i1 %43, label %34, label %44
44: ; preds = %37, %42
%45 = phi i64 [ %51, %42 ], [ %39, %37 ]
%46 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %38, i64 %45
%47 = load i32, i32* %46
%48 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %1, i64 0, i64 %45, i64 %38
%49 = load i32, i32* %48
%50 = icmp eq i32 %47, %49
%51 = add nuw nsw i64 %45, 1
br i1 %50, label %42, label %52
52: ; preds = %34, %44, %14, %0
%53 = phi i8* [ getelementptr inbounds ([56 x i8], [56 x i8]* @str.7, i64 0, i64 0), %0 ], [ getelementptr inbounds ([56 x i8], [56 x i8]* @str.7, i64 0, i64 0), %14 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @str.6, i64 0, i64 0), %44 ], [ getelementptr inbounds ([56 x i8], [56 x i8]* @str.7, i64 0, i64 0), %34 ]
%54 = call i32 @puts(i8* dereferenceable(1) %53)
ret i32 0
}