#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*/ printSquare(int **, int);
int /*<<< orphan*/ printf(char *);
void printAnswer(int isItMagicSquare, int square[10][10], int squareSize) {
  printf("\n\n");
  printSquare(square, squareSize);
  if (isItMagicSquare == 1) {
    printf("Is a Magic Square!\n\n");
  } else {
    printf("Is not Magic Square!\n\n");
  }
}


x86 assembly (clang, -O0):
<printAnswer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <printSquare@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1165 <printAnswer+0x45>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <printAnswer+0x51>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAnswer>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <printSquare@plt>
cmp    $0x1,%r14d
lea    0xec9(%rip),%rax
lea    0xeac(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [21 x i8] c"Is a Magic Square!\0A\0A\00"
@.str.2 = [23 x i8] c"Is not Magic Square!\0A\0A\00"
define void @printAnswer(i32 %0, [10 x i32]* %1, i32 %2) {
%4 = alloca i32
%5 = alloca [10 x i32]*
%6 = alloca i32
store i32 %0, i32* %4
store [10 x i32]* %1, [10 x i32]** %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load [10 x i32]*, [10 x i32]** %5
%9 = bitcast [10 x i32]* %8 to i32**
%10 = load i32, i32* %6
%11 = call i32 @printSquare(i32** %9, i32 %10)
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %18
16: ; preds = %3
%17 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
@str.3 = [22 x i8] c"Is not Magic Square!\0A\00"
@str.4 = [20 x i8] c"Is a Magic Square!\0A\00"
define void @printAnswer(i32 %0, [10 x i32]* %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = bitcast [10 x i32]* %1 to i32**
%6 = tail call i32 @printSquare(i32** %5, i32 %2)
%7 = icmp eq i32 %0, 1
%8 = select i1 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0)
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
ret void
}