#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*/ fnColSum(int **, int, int);
int /*<<< orphan*/ fnGetMatrix(int **, int, int);
int /*<<< orphan*/ fnRowSum(int **, int, int);
int /*<<< orphan*/ fnShowMatrix(int **, int, int);
int /*<<< orphan*/ fnSumAll(int **, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int iaMatrix[10][10], iRow, iCol;
  printf("\nEnter the number of rows and columns\n");
  scanf("%d%d", &iRow, &iCol);
  fnGetMatrix(iaMatrix, iRow, iCol);
  fnShowMatrix(iaMatrix, iRow, iCol);
  fnRowSum(iaMatrix, iRow, iCol);
  fnColSum(iaMatrix, iRow, iCol);
  fnSumAll(iaMatrix, iRow, iCol);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x1a4(%rbp),%rsi
lea    -0x1a8(%rbp),%rdx
call   1060 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
mov    -0x1a8(%rbp),%edx
call   1090 <fnGetMatrix@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
mov    -0x1a8(%rbp),%edx
call   1050 <fnShowMatrix@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
mov    -0x1a8(%rbp),%edx
call   1080 <fnRowSum@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
mov    -0x1a8(%rbp),%edx
call   1040 <fnColSum@plt>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
mov    -0x1a8(%rbp),%edx
call   1070 <fnSumAll@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1a0,%rsp
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
lea    0xe75(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <fnGetMatrix@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1050 <fnShowMatrix@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1080 <fnRowSum@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1040 <fnColSum@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1070 <fnSumAll@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\0AEnter the number of rows and columns\0A\00"
@.str.1 = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i32]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%7 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%8 = bitcast [10 x i32]* %7 to i32**
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @fnGetMatrix(i32** %8, i32 %9, i32 %10)
%12 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%13 = bitcast [10 x i32]* %12 to i32**
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @fnShowMatrix(i32** %13, i32 %14, i32 %15)
%17 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%18 = bitcast [10 x i32]* %17 to i32**
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = call i32 @fnRowSum(i32** %18, i32 %19, i32 %20)
%22 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%23 = bitcast [10 x i32]* %22 to i32**
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = call i32 @fnColSum(i32** %23, i32 %24, i32 %25)
%27 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %2, i64 0, i64 0
%28 = bitcast [10 x i32]* %27 to i32**
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = call i32 @fnSumAll(i32** %28, i32 %29, i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@str = [38 x i8] c"\0AEnter the number of rows and columns\00"
define i32 @main() {
%1 = alloca [10 x [10 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [10 x [10 x i32]]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%9 = bitcast [10 x [10 x i32]]* %1 to i32**
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @fnGetMatrix(i32** %9, i32 %10, i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @fnShowMatrix(i32** %9, i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @fnRowSum(i32** %9, i32 %16, i32 %17)
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @fnColSum(i32** %9, i32 %19, i32 %20)
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = call i32 @fnSumAll(i32** %9, i32 %22, i32 %23)
ret i32 0
}