#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float mat[100][100];
  int mySize, i, j;
  printf("Entre com o tamanho da matriz quadrada:\n");
  scanf("%d", &mySize);
  if (mySize > 100) {
    printf("Não é possível alocar essa matriz.\n");
    exit(0);
  }
  for (i = 0; i < mySize; i++) {
    for (j = 0; j < mySize; j++) {
      printf("Informe um valor para a matriz [%d][%d] \n", i + 1, j + 1);
      scanf("%f", &mat[i][j]);
    }
  }
  printf("A matriz formada \n");
  for (i = 0; i < mySize; i++) {
    for (j = 0; j < mySize; j++) {
      printf("\t%.2f", mat[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x9c54(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x64,-0x9c54(%rbp)
jle    1187 <main+0x57>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
movl   $0x0,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    1240 <main+0x110>
movl   $0x0,-0x9c5c(%rbp)
mov    -0x9c5c(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    1227 <main+0xf7>
mov    -0x9c58(%rbp),%esi
add    $0x1,%esi
mov    -0x9c5c(%rbp),%edx
add    $0x1,%edx
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x9c58(%rbp),%rax
lea    -0x9c50(%rbp),%rsi
imul   $0x190,%rax,%rax
add    %rax,%rsi
movslq -0x9c5c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    11ad <main+0x7d>
jmp    122c <main+0xfc>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    1191 <main+0x61>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    12f2 <main+0x1c2>
movl   $0x0,-0x9c5c(%rbp)
mov    -0x9c5c(%rbp),%eax
cmp    -0x9c54(%rbp),%eax
jge    12d0 <main+0x1a0>
movslq -0x9c58(%rbp),%rcx
lea    -0x9c50(%rbp),%rax
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdde(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x9c5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c5c(%rbp)
jmp    1274 <main+0x144>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    1258 <main+0x128>
mov    -0x4(%rbp),%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c58,%rsp
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x64,%eax
jg     1298 <main+0x148>
test   %eax,%eax
jle    1200 <main+0xb0>
lea    0x10(%rsp),%rbp
lea    0xe66(%rip),%r14
lea    0xe89(%rip),%r15
xor    %r12d,%r12d
jmp    11bf <main+0x6f>
nopl   0x0(%rax)
movslq %eax,%rcx
add    $0x190,%rbp
cmp    %rcx,%r12
jge    1200 <main+0xb0>
add    $0x1,%r12
test   %eax,%eax
jle    11b0 <main+0x60>
mov    %rbp,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     11d0 <main+0x80>
jmp    11b0 <main+0x60>
lea    0xe57(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1284 <main+0x134>
lea    0x10(%rsp),%rbp
xor    %r14d,%r14d
lea    0xe0d(%rip),%r15
jmp    124f <main+0xff>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
movslq 0xc(%rsp),%rax
add    $0x190,%rbp
cmp    %rax,%r14
jge    1284 <main+0x134>
test   %eax,%eax
jle    1230 <main+0xe0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0x0(%rbp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1260 <main+0x110>
jmp    1230 <main+0xe0>
xor    %eax,%eax
add    $0x9c58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdd1(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Entre com o tamanho da matriz quadrada:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [39 x i8] c"N\C3\A3o \C3\A9 poss\C3\ADvel alocar essa matriz.\0A\00"
@.str.3 = [42 x i8] c"Informe um valor para a matriz [%d][%d] \0A\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [19 x i8] c"A matriz formada \0A\00"
@.str.6 = [6 x i8] c"\09%.2f\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [100 x float]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @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 sgt i32 %8, 100
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %0
store i32 0, i32* %4
br label %14
14: ; preds = %40, %13
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %43
18: ; preds = %14
store i32 0, i32* %5
br label %19
19: ; preds = %36, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %3
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %39
23: ; preds = %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %25, i32 %27)
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %2, i64 0, i64 %30
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x float], [100 x float]* %31, i64 0, i64 %33
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %34)
br label %36
36: ; preds = %23
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %19
39: ; preds = %19
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %14
43: ; preds = %14
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %4
br label %45
45: ; preds = %69, %43
%46 = load i32, i32* %4
%47 = load i32, i32* %3
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %72
49: ; preds = %45
store i32 0, i32* %5
br label %50
50: ; preds = %64, %49
%51 = load i32, i32* %5
%52 = load i32, i32* %3
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %67
54: ; preds = %50
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %2, i64 0, i64 %56
%58 = load i32, i32* %5
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [100 x float], [100 x float]* %57, i64 0, i64 %59
%61 = load float, float* %60
%62 = fpext float %61 to double
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %62)
br label %64
64: ; preds = %54
%65 = load i32, i32* %5
%66 = add nsw i32 %65, 1
store i32 %66, i32* %5
br label %50
67: ; preds = %50
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %69
69: ; preds = %67
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %45
72: ; preds = %45
%73 = load i32, i32* %1
ret i32 %73
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [42 x i8] c"Informe um valor para a matriz [%d][%d] \0A\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.6 = [6 x i8] c"\09%.2f\00"
@str = [40 x i8] c"Entre com o tamanho da matriz quadrada:\00"
@str.8 = [18 x i8] c"A matriz formada \00"
@str.9 = [38 x i8] c"N\C3\A3o \C3\A9 poss\C3\ADvel alocar essa matriz.\00"
define i32 @main() {
%1 = alloca [100 x [100 x float]]
%2 = alloca i32
%3 = bitcast [100 x [100 x float]]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 100
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = icmp sgt i32 %7, 0
br i1 %10, label %14, label %35
11: ; preds = %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.9, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %9, %31
%15 = phi i32 [ %32, %31 ], [ %7, %9 ]
%16 = phi i64 [ %18, %31 ], [ 0, %9 ]
%17 = icmp sgt i32 %15, 0
%18 = add nuw nsw i64 %16, 1
br i1 %17, label %19, label %31
19: ; preds = %14
%20 = trunc i64 %18 to i32
br label %21
21: ; preds = %19, %21
%22 = phi i64 [ 0, %19 ], [ %23, %21 ]
%23 = add nuw nsw i64 %22, 1
%24 = trunc i64 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %20, i32 %24)
%26 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %1, i64 0, i64 %16, i64 %22
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %26)
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = icmp slt i64 %23, %29
br i1 %30, label %21, label %31
31: ; preds = %21, %14
%32 = phi i32 [ %15, %14 ], [ %28, %21 ]
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %18, %33
br i1 %34, label %14, label %35
35: ; preds = %31, %9
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
%37 = load i32, i32* %2
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %59
39: ; preds = %35, %53
%40 = phi i32 [ %56, %53 ], [ %37, %35 ]
%41 = phi i64 [ %55, %53 ], [ 0, %35 ]
%42 = icmp sgt i32 %40, 0
br i1 %42, label %43, label %53
43: ; preds = %39, %43
%44 = phi i64 [ %49, %43 ], [ 0, %39 ]
%45 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %1, i64 0, i64 %41, i64 %44
%46 = load float, float* %45
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %47)
%49 = add nuw nsw i64 %44, 1
%50 = load i32, i32* %2
%51 = sext i32 %50 to i64
%52 = icmp slt i64 %49, %51
br i1 %52, label %43, label %53
53: ; preds = %43, %39
%54 = call i32 @putchar(i32 10)
%55 = add nuw nsw i64 %41, 1
%56 = load i32, i32* %2
%57 = sext i32 %56 to i64
%58 = icmp slt i64 %55, %57
br i1 %58, label %39, label %59
59: ; preds = %53, %35
ret i32 0
}