#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 GetNumber();
int /*<<< orphan*/ createSquare(int **, int, int *);
int /*<<< orphan*/ getSquareNumbers(int *);
int isItMagic(int **, int, int);
int /*<<< orphan*/ isSquareOutOfBounds(int, int, int);
int /*<<< orphan*/ printAnswer(int, int **, int);
int /*<<< orphan*/ testInputNumber(int *, int);
int main(int argc, char *argv[]) {
  int numberOfSquare, sumOfSquare, isItMagicSquare;
  int square[10][10];
  int squareInputnumbers[100];
  numberOfSquare = GetNumber();
  sumOfSquare =
      (int)(numberOfSquare * ((numberOfSquare * numberOfSquare) + 1)) / 2;
  isSquareOutOfBounds(numberOfSquare, 10, 3);
  getSquareNumbers(squareInputnumbers);
  testInputNumber(squareInputnumbers, numberOfSquare);
  createSquare(square, numberOfSquare, squareInputnumbers);
  isItMagicSquare = isItMagic(square, numberOfSquare, sumOfSquare);
  printAnswer(isItMagicSquare, square, numberOfSquare);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <GetNumber@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    $0xa,%esi
mov    $0x3,%edx
call   1090 <isSquareOutOfBounds@plt>
lea    -0x340(%rbp),%rdi
call   1030 <getSquareNumbers@plt>
lea    -0x340(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <testInputNumber@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x340(%rbp),%rdx
call   1050 <createSquare@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1070 <isItMagic@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x1b0(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1080 <printAnswer@plt>
mov    $0x1,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x328,%rsp
xor    %eax,%eax
call   1040 <GetNumber@plt>
mov    %eax,%ebx
imul   %eax,%eax
add    $0x1,%eax
imul   %ebx,%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    %ebx,%edi
mov    $0xa,%esi
mov    $0x3,%edx
call   1090 <isSquareOutOfBounds@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <getSquareNumbers@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1060 <testInputNumber@plt>
lea    0x190(%rsp),%r15
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
call   1050 <createSquare@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1070 <isItMagic@plt>
mov    %eax,%edi
mov    %r15,%rsi
mov    %ebx,%edx
call   1080 <printAnswer@plt>
mov    $0x1,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [10 x [10 x i32]]
%10 = alloca [100 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (...) @GetNumber()
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = mul nsw i32 %12, %16
%18 = sdiv i32 %17, 2
store i32 %18, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @isSquareOutOfBounds(i32 %19, i32 10, i32 3)
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %10, i64 0, i64 0
%22 = call i32 @getSquareNumbers(i32* %21)
%23 = getelementptr inbounds [100 x i32], [100 x i32]* %10, i64 0, i64 0
%24 = load i32, i32* %6
%25 = call i32 @testInputNumber(i32* %23, i32 %24)
%26 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %9, i64 0, i64 0
%27 = bitcast [10 x i32]* %26 to i32**
%28 = load i32, i32* %6
%29 = getelementptr inbounds [100 x i32], [100 x i32]* %10, i64 0, i64 0
%30 = call i32 @createSquare(i32** %27, i32 %28, i32* %29)
%31 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %9, i64 0, i64 0
%32 = bitcast [10 x i32]* %31 to i32**
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = call i32 @isItMagic(i32** %32, i32 %33, i32 %34)
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %9, i64 0, i64 0
%38 = bitcast [10 x i32]* %37 to i32**
%39 = load i32, i32* %6
%40 = call i32 @printAnswer(i32 %36, i32** %38, i32 %39)
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x [10 x i32]]
%4 = alloca [100 x i32]
%5 = bitcast [10 x [10 x i32]]* %3 to i8*
%6 = bitcast [100 x i32]* %4 to i8*
%7 = tail call i32 (...) @GetNumber()
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, 1
%10 = mul nsw i32 %9, %7
%11 = sdiv i32 %10, 2
%12 = tail call i32 @isSquareOutOfBounds(i32 %7, i32 10, i32 3)
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%14 = call i32 @getSquareNumbers(i32* %13)
%15 = call i32 @testInputNumber(i32* %13, i32 %7)
%16 = bitcast [10 x [10 x i32]]* %3 to i32**
%17 = call i32 @createSquare(i32** %16, i32 %7, i32* %13)
%18 = call i32 @isItMagic(i32** %16, i32 %7, i32 %11)
%19 = call i32 @printAnswer(i32 %18, i32** %16, i32 %7)
ret i32 1
}