#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*/ acquisisci(int **, int);
int /*<<< orphan*/ calcola(int **, int, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int mat[20][20];
  int N, rmax = 0, cmax = 0;
  printf("Insert the matrix ( NxN ) size : ");
  scanf("%d", &N);
  if (N < 21 && N > 0) {
    acquisisci(mat, N);
    calcola(mat, N, &rmax, &cmax);
    printf("\n   Row with more repetitions : %d \n", rmax);
    printf("Column with more repetitions : %d", cmax);
  } else {
    printf("N is bigger or smaller than max./min. matrix size ( %d )", 20);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x660,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x658(%rbp)
movl   $0x0,-0x65c(%rbp)
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    -0x654(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x15,-0x654(%rbp)
jge    1200 <main+0xc0>
cmpl   $0x0,-0x654(%rbp)
jle    1200 <main+0xc0>
lea    -0x650(%rbp),%rdi
mov    -0x654(%rbp),%esi
call   1030 <acquisisci@plt>
lea    -0x650(%rbp),%rdi
mov    -0x654(%rbp),%esi
lea    -0x658(%rbp),%rdx
lea    -0x65c(%rbp),%rcx
call   1050 <calcola@plt>
mov    -0x658(%rbp),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x65c(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1213 <main+0xd3>
lea    0xe62(%rip),%rdi
mov    $0x14,%esi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x660,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x650,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
lea    -0x1(%rsi),%eax
cmp    $0x13,%eax
ja     11c5 <main+0x85>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <acquisisci@plt>
mov    0xc(%rsp),%esi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
call   1050 <calcola@plt>
mov    0x8(%rsp),%esi
lea    0xe71(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe84(%rip),%rdi
jmp    11d1 <main+0x91>
lea    0xe9d(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x650,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Insert the matrix ( NxN ) size : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0A Row with more repetitions : %d \0A\00"
@.str.3 = [34 x i8] c"Column with more repetitions : %d\00"
@.str.4 = [57 x i8] c"N is bigger or smaller than max./min. matrix size ( %d )\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [20 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 21
br i1 %9, label %10, label %26
10: ; preds = %0
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %2, i64 0, i64 0
%15 = bitcast [20 x i32]* %14 to i32**
%16 = load i32, i32* %3
%17 = call i32 @acquisisci(i32** %15, i32 %16)
%18 = getelementptr inbounds [20 x [20 x i32]], [20 x [20 x i32]]* %2, i64 0, i64 0
%19 = bitcast [20 x i32]* %18 to i32**
%20 = load i32, i32* %3
%21 = call i32 @calcola(i32** %19, i32 %20, i32* %4, i32* %5)
%22 = load i32, i32* %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %5
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %24)
br label %28
26: ; preds = %10, %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i32 20)
br label %28
28: ; preds = %26, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Insert the matrix ( NxN ) size : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"\0A Row with more repetitions : %d \0A\00"
@.str.3 = [34 x i8] c"Column with more repetitions : %d\00"
@.str.4 = [57 x i8] c"N is bigger or smaller than max./min. matrix size ( %d )\00"
define i32 @main() {
%1 = alloca [20 x [20 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [20 x [20 x i32]]* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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* %2)
%11 = load i32, i32* %2
%12 = add i32 %11, -1
%13 = icmp ult i32 %12, 20
br i1 %13, label %14, label %23
14: ; preds = %0
%15 = bitcast [20 x [20 x i32]]* %1 to i32**
%16 = call i32 @acquisisci(i32** %15, i32 %11)
%17 = load i32, i32* %2
%18 = call i32 @calcola(i32** %15, i32 %17, i32* %3, i32* %4)
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %25
23: ; preds = %0
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0), i32 20)
br label %25
25: ; preds = %23, %14
ret i32 0
}