#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 *, float *);
int main(void) {
  float matrix[4][4];
  int i, j;
  for (i = 0; i < 3; ++i) {
    for (j = 0; j < 3; ++j) {
      scanf("%f", &matrix[i][j]);
    }
  }
  if (matrix[0][0] == matrix[1][1] && matrix[1][1] == matrix[2][2]) {
    printf("This is a scalar matrix\n");
  } else {
    printf("This is not a scalar matrix\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    1198 <main+0x78>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jge    1185 <main+0x65>
movslq -0x54(%rbp),%rax
lea    -0x50(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
movslq -0x58(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe8e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1147 <main+0x27>
jmp    118a <main+0x6a>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1136 <main+0x16>
movss  -0x50(%rbp),%xmm0
ucomiss -0x3c(%rbp),%xmm0
jne    11d3 <main+0xb3>
jp     11d3 <main+0xb3>
movss  -0x3c(%rbp),%xmm0
ucomiss -0x28(%rbp),%xmm0
jne    11d3 <main+0xb3>
jp     11d3 <main+0xb3>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
jmp    11df <main+0xbf>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xed4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  (%rsp),%xmm0
movss  0x14(%rsp),%xmm1
ucomiss 0x28(%rsp),%xmm1
lea    0xe4d(%rip),%rax
lea    0xe62(%rip),%rdi
cmovne %rax,%rdi
cmovp  %rax,%rdi
ucomiss %xmm1,%xmm0
cmovne %rax,%rdi
cmovp  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [25 x i8] c"This is a scalar matrix\0A\00"
@.str.2 = [29 x i8] c"This is not a scalar matrix\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x float]]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %24, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %27
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 %14
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x float], [4 x float]* %15, i64 0, i64 %17
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 0
%29 = getelementptr inbounds [4 x float], [4 x float]* %28, i64 0, i64 0
%30 = load float, float* %29
%31 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 1
%32 = getelementptr inbounds [4 x float], [4 x float]* %31, i64 0, i64 1
%33 = load float, float* %32
%34 = fcmp oeq float %30, %33
br i1 %34, label %35, label %45
35: ; preds = %27
%36 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 1
%37 = getelementptr inbounds [4 x float], [4 x float]* %36, i64 0, i64 1
%38 = load float, float* %37
%39 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %2, i64 0, i64 2
%40 = getelementptr inbounds [4 x float], [4 x float]* %39, i64 0, i64 2
%41 = load float, float* %40
%42 = fcmp oeq float %38, %41
br i1 %42, label %43, label %45
43: ; preds = %35
%44 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %47
45: ; preds = %35, %27
%46 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@str = [28 x i8] c"This is not a scalar matrix\00"
@str.3 = [24 x i8] c"This is a scalar matrix\00"
define i32 @main() {
%1 = alloca [4 x [4 x float]]
%2 = bitcast [4 x [4 x float]]* %1 to i8*
%3 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %5)
%7 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%9 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 1, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %9)
%11 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 1, i64 1
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %11)
%13 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 1, i64 2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %13)
%15 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 2, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %15)
%17 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 2, i64 1
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %17)
%19 = getelementptr inbounds [4 x [4 x float]], [4 x [4 x float]]* %1, i64 0, i64 2, i64 2
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %19)
%21 = load float, float* %3
%22 = load float, float* %11
%23 = fcmp oeq float %21, %22
%24 = load float, float* %19
%25 = fcmp oeq float %22, %24
%26 = select i1 %23, i1 %25, i1 false
%27 = select i1 %26, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0)
%28 = call i32 @puts(i8* dereferenceable(1) %27)
ret i32 0
}