#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 */
double maior_valor_matriz(float **, int, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float M[100][100];
  int i, j, m, n;
  scanf("%d %d", &m, &n);
  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      scanf("%f", &M[i][j]);
  printf("Maior Valor da Matriz: %f", maior_valor_matriz(M, m, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x9c5c(%rbp),%rsi
lea    -0x9c60(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x9c5c(%rbp),%eax
jge    11f7 <main+0xc7>
movl   $0x0,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%eax
cmp    -0x9c60(%rbp),%eax
jge    11de <main+0xae>
movslq -0x9c54(%rbp),%rax
lea    -0x9c50(%rbp),%rsi
imul   $0x190,%rax,%rax
add    %rax,%rsi
movslq -0x9c58(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    1184 <main+0x54>
jmp    11e3 <main+0xb3>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1168 <main+0x38>
lea    -0x9c50(%rbp),%rdi
mov    -0x9c5c(%rbp),%esi
mov    -0x9c60(%rbp),%edx
call   1040 <maior_valor_matriz@plt>
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c50,%rsp
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
test   %esi,%esi
jle    11c5 <main+0x95>
lea    0x10(%rsp),%r15
lea    0xead(%rip),%r14
xor    %r12d,%r12d
jmp    1193 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r12
movslq %esi,%rax
add    $0x190,%r15
cmp    %rax,%r12
jge    11c5 <main+0x95>
test   %edx,%edx
jle    1180 <main+0x50>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rdx
add    $0x4,%r13
cmp    %rdx,%rbx
jl     11a0 <main+0x70>
mov    0xc(%rsp),%esi
jmp    1180 <main+0x50>
lea    0x10(%rsp),%rdi
call   1040 <maior_valor_matriz@plt>
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x9c50,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"Maior Valor da Matriz: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [100 x float]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
store i32 0, i32* %3
br label %8
8: ; preds = %29, %0
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %32
12: ; preds = %8
store i32 0, i32* %4
br label %13
13: ; preds = %25, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %2, i64 0, i64 %19
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x float], [100 x float]* %20, i64 0, i64 %22
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %23)
br label %25
25: ; preds = %17
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %13
28: ; preds = %13
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %8
32: ; preds = %8
%33 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %2, i64 0, i64 0
%34 = bitcast [100 x float]* %33 to float**
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = call double @maior_valor_matriz(float** %34, i32 %35, i32 %36)
%38 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"Maior Valor da Matriz: %f\00"
define i32 @main() {
%1 = alloca [100 x [100 x float]]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [100 x [100 x float]]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
%10 = load i32, i32* %3
br i1 %9, label %11, label %32
11: ; preds = %0, %26
%12 = phi i32 [ %27, %26 ], [ %8, %0 ]
%13 = phi i32 [ %28, %26 ], [ %10, %0 ]
%14 = phi i64 [ %29, %26 ], [ 0, %0 ]
%15 = icmp sgt i32 %13, 0
br i1 %15, label %16, label %26
16: ; preds = %11, %16
%17 = phi i64 [ %20, %16 ], [ 0, %11 ]
%18 = getelementptr inbounds [100 x [100 x float]], [100 x [100 x float]]* %1, i64 0, i64 %14, i64 %17
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %18)
%20 = add nuw nsw i64 %17, 1
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %20, %22
br i1 %23, label %16, label %24
24: ; preds = %16
%25 = load i32, i32* %2
br label %26
26: ; preds = %24, %11
%27 = phi i32 [ %25, %24 ], [ %12, %11 ]
%28 = phi i32 [ %21, %24 ], [ %13, %11 ]
%29 = add nuw nsw i64 %14, 1
%30 = sext i32 %27 to i64
%31 = icmp slt i64 %29, %30
br i1 %31, label %11, label %32
32: ; preds = %26, %0
%33 = phi i32 [ %10, %0 ], [ %28, %26 ]
%34 = phi i32 [ %8, %0 ], [ %27, %26 ]
%35 = bitcast [100 x [100 x float]]* %1 to float**
%36 = call double @maior_valor_matriz(float** %35, i32 %34, i32 %33)
%37 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %36)
ret i32 0
}