#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 ler_acessos(int *);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stats(int *, int, int *, int *, float *);
int main() {
  int tempos[100];
  int numTempos = ler_acessos(tempos);
  int min, max;
  float med;
  stats(tempos, numTempos, &min, &max, &med);
  printf("Numero de acessos: %d\n", numTempos);
  printf("Min: %d | Max: %d | Med: %.2f\n", min, max, med);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1050 <ler_acessos@plt>
mov    %eax,-0x1a4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
lea    -0x1a8(%rbp),%rdx
lea    -0x1ac(%rbp),%rcx
lea    -0x1b0(%rbp),%r8
call   1030 <stats@plt>
mov    -0x1a4(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1a8(%rbp),%esi
mov    -0x1ac(%rbp),%edx
movss  -0x1b0(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xe69(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x1a8,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <ler_acessos@plt>
mov    %eax,%ebp
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <stats@plt>
lea    0xe98(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Numero de acessos: %d\0A\00"
@.str.1 = [31 x i8] c"Min: %d | Max: %d | Med: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 0, i32* %1
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%8 = call i32 @ler_acessos(i32* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @stats(i32* %9, i32 %10, i32* %4, i32* %5, float* %6)
%12 = load i32, i32* %3
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load float, float* %6
%17 = fpext float %16 to double
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15, double %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Numero de acessos: %d\0A\00"
@.str.1 = [31 x i8] c"Min: %d | Max: %d | Med: %.2f\0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [100 x i32]* %1 to i8*
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%7 = call i32 @ler_acessos(i32* %6)
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast float* %4 to i8*
%11 = call i32 @stats(i32* %6, i32 %7, i32* %2, i32* %3, float* %4)
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14, double %16)
ret i32 0
}