#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*/ imprime_matriz(float **);
int /*<<< orphan*/ normaliza_matriz(float **, float);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  int i, j;
  float maiorValor = -1000000.0;
  float mat[3][3];
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      printf("\nInforme o valor para A[%d][%d] na matriz: ", i, j);
      scanf("%f", &mat[i][j]);
      if (mat[i][j] > maiorValor) {
        maiorValor = mat[i][j];
      }
    }
  }
  normaliza_matriz(mat, maiorValor);
  imprime_matriz(mat);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xea9(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    121b <main+0xdb>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1208 <main+0xc8>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x40(%rbp),%rsi
imul   $0xc,%rax,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe7f(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11f5 <main+0xb5>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11fa <main+0xba>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1174 <main+0x34>
jmp    120d <main+0xcd>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <main+0x23>
lea    -0x40(%rbp),%rdi
movss  -0x10(%rbp),%xmm0
call   1060 <normaliza_matriz@plt>
lea    -0x40(%rbp),%rdi
call   1040 <imprime_matriz@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xeb4(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0xecd(%rip),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
maxss  0xe7f(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x18(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x1c(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x20(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x24(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x28(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x2c(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0x30(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
mov    %r14,%rdi
call   1060 <normaliza_matriz@plt>
mov    %r14,%rdi
call   1040 <imprime_matriz@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0AInforme o valor para A[%d][%d] na matriz: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca [3 x [3 x float]]
store i32 0, i32* %1
store float -1.000000e+06, float* %4
store i32 0, i32* %2
br label %6
6: ; preds = %46, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %49
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %42, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %45
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 %18
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [3 x float], [3 x float]* %19, i64 0, i64 %21
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %22)
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 %25
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [3 x float], [3 x float]* %26, i64 0, i64 %28
%30 = load float, float* %29
%31 = load float, float* %4
%32 = fcmp ogt float %30, %31
br i1 %32, label %33, label %41
33: ; preds = %13
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 %35
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [3 x float], [3 x float]* %36, i64 0, i64 %38
%40 = load float, float* %39
store float %40, float* %4
br label %41
41: ; preds = %33, %13
br label %42
42: ; preds = %41
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %10
45: ; preds = %10
br label %46
46: ; preds = %45
%47 = load i32, i32* %2
%48 = add nsw i32 %47, 1
store i32 %48, i32* %2
br label %6
49: ; preds = %6
%50 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 0
%51 = bitcast [3 x float]* %50 to float**
%52 = load float, float* %4
%53 = call i32 @normaliza_matriz(float** %51, float %52)
%54 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %5, i64 0, i64 0
%55 = bitcast [3 x float]* %54 to float**
%56 = call i32 @imprime_matriz(float** %55)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"\0AInforme o valor para A[%d][%d] na matriz: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca [3 x [3 x float]]
%2 = bitcast [3 x [3 x float]]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%4 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%6 = load float, float* %4
%7 = fcmp ogt float %6, -1.000000e+06
%8 = select i1 %7, float %6, float -1.000000e+06
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%10 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %10)
%12 = load float, float* %10
%13 = fcmp ogt float %12, %8
%14 = select i1 %13, float %12, float %8
%15 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 0, i32 2)
%16 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 0, i64 2
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %16)
%18 = load float, float* %16
%19 = fcmp ogt float %18, %14
%20 = select i1 %19, float %18, float %14
%21 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%22 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 1, i64 0
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %22)
%24 = load float, float* %22
%25 = fcmp ogt float %24, %20
%26 = select i1 %25, float %24, float %20
%27 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%28 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 1, i64 1
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %28)
%30 = load float, float* %28
%31 = fcmp ogt float %30, %26
%32 = select i1 %31, float %30, float %26
%33 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%34 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 1, i64 2
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %34)
%36 = load float, float* %34
%37 = fcmp ogt float %36, %32
%38 = select i1 %37, float %36, float %32
%39 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
%40 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 2, i64 0
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %40)
%42 = load float, float* %40
%43 = fcmp ogt float %42, %38
%44 = select i1 %43, float %42, float %38
%45 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 2, i32 1)
%46 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 2, i64 1
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %46)
%48 = load float, float* %46
%49 = fcmp ogt float %48, %44
%50 = select i1 %49, float %48, float %44
%51 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 2, i32 2)
%52 = getelementptr inbounds [3 x [3 x float]], [3 x [3 x float]]* %1, i64 0, i64 2, i64 2
%53 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %52)
%54 = load float, float* %52
%55 = fcmp ogt float %54, %50
%56 = select i1 %55, float %54, float %50
%57 = bitcast [3 x [3 x float]]* %1 to float**
%58 = call i32 @normaliza_matriz(float** %57, float %56)
%59 = call i32 @imprime_matriz(float** %57)
ret i32 0
}