#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 *, float);
void ContadoresEstatisticos(int NumUtentesSistema, int TotalUtentesFila,
                            float TempoOcupacaoAgente1,
                            float TempoOcupacaoAgente2, float TempoTotalEspera,
                            float TempoTotalPermanencia,
                            float TempoTotalSistema) {
  int TaxaOcupacaoAgentes, TaxaOcupacaoAgente1, TaxaOcupacaoAgente2;
  float NumMedioUtentesFila, TempoMedioEsperaUtentes,
      TempoMedioPermanenciaUtentes;
  TaxaOcupacaoAgentes = (TempoOcupacaoAgente1 + TempoOcupacaoAgente2) /
                        (2 * TempoTotalSistema) * 100;
  TaxaOcupacaoAgente1 = TempoOcupacaoAgente1 / TempoTotalSistema * 100;
  TaxaOcupacaoAgente2 = TempoOcupacaoAgente2 / TempoTotalSistema * 100;
  NumMedioUtentesFila = TotalUtentesFila / (float)NumUtentesSistema;
  TempoMedioEsperaUtentes = TempoTotalEspera / NumUtentesSistema;
  TempoMedioPermanenciaUtentes = TempoTotalPermanencia / NumUtentesSistema;
  printf("TaxaOcupacaoAgentes = %d%%\n", TaxaOcupacaoAgentes);
  printf("TaxaOcupacaoAgente1 = %d%%\n", TaxaOcupacaoAgente1);
  printf("TaxaOcupacaoAgente2 = %d%%\n", TaxaOcupacaoAgente2);
  printf("NumMedioUtentesFila = %.3f\n", NumMedioUtentesFila);
  printf("TempoMedioEsperaUtentes = %.3f\n", TempoMedioEsperaUtentes);
  printf("TempoMedioPermanaenciaUtentes = %.3f\n",
         TempoMedioPermanenciaUtentes);
}


x86 assembly (clang, -O0):
<ContadoresEstatisticos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  %xmm4,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  0xebb(%rip),%xmm1
mulss  -0x1c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xea6(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
movss  0xe89(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
movss  0xe6c(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x28(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x18(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
cvtsi2ssl -0x20(%rbp),%xmm0
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x24(%rbp),%xmm0
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x28(%rbp),%xmm0
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x2c(%rbp),%xmm0
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
movss  -0x30(%rbp),%xmm0
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
movss  -0x34(%rbp),%xmm0
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ContadoresEstatisticos>:
sub    $0x38,%rsp
movaps %xmm0,%xmm5
addss  %xmm1,%xmm5
divss  %xmm4,%xmm0
divss  %xmm4,%xmm1
addss  %xmm4,%xmm4
divss  %xmm4,%xmm5
movss  0xecd(%rip),%xmm4
mulss  %xmm4,%xmm5
mulss  %xmm4,%xmm0
movaps %xmm0,0x10(%rsp)
mulss  %xmm4,%xmm1
movaps %xmm1,0x20(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %edi,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
divss  %xmm1,%xmm2
movss  %xmm2,0x8(%rsp)
divss  %xmm1,%xmm3
movss  %xmm3,0xc(%rsp)
cvttps2dq %xmm5,%xmm0
cvtdq2ps %xmm0,%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
cvttps2dq 0x10(%rsp),%xmm0
cvtdq2ps %xmm0,%xmm0
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
cvttps2dq 0x20(%rsp),%xmm0
cvtdq2ps %xmm0,%xmm0
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
movss  0x4(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
movss  0x8(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
movss  0xc(%rsp),%xmm0
add    $0x38,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"TaxaOcupacaoAgentes = %d%%\0A\00"
@.str.1 = [28 x i8] c"TaxaOcupacaoAgente1 = %d%%\0A\00"
@.str.2 = [28 x i8] c"TaxaOcupacaoAgente2 = %d%%\0A\00"
@.str.3 = [28 x i8] c"NumMedioUtentesFila = %.3f\0A\00"
@.str.4 = [32 x i8] c"TempoMedioEsperaUtentes = %.3f\0A\00"
@.str.5 = [38 x i8] c"TempoMedioPermanaenciaUtentes = %.3f\0A\00"
define void @ContadoresEstatisticos(i32 %0, i32 %1, float %2, float %3, float %4, float %5, float %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca float
%19 = alloca float
%20 = alloca float
store i32 %0, i32* %8
store i32 %1, i32* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
store float %6, float* %14
%21 = load float, float* %10
%22 = load float, float* %11
%23 = fadd float %21, %22
%24 = load float, float* %14
%25 = fmul float 2.000000e+00, %24
%26 = fdiv float %23, %25
%27 = fmul float %26, 1.000000e+02
%28 = fptosi float %27 to i32
store i32 %28, i32* %15
%29 = load float, float* %10
%30 = load float, float* %14
%31 = fdiv float %29, %30
%32 = fmul float %31, 1.000000e+02
%33 = fptosi float %32 to i32
store i32 %33, i32* %16
%34 = load float, float* %11
%35 = load float, float* %14
%36 = fdiv float %34, %35
%37 = fmul float %36, 1.000000e+02
%38 = fptosi float %37 to i32
store i32 %38, i32* %17
%39 = load i32, i32* %9
%40 = sitofp i32 %39 to float
%41 = load i32, i32* %8
%42 = sitofp i32 %41 to float
%43 = fdiv float %40, %42
store float %43, float* %18
%44 = load float, float* %12
%45 = load i32, i32* %8
%46 = sitofp i32 %45 to float
%47 = fdiv float %44, %46
store float %47, float* %19
%48 = load float, float* %13
%49 = load i32, i32* %8
%50 = sitofp i32 %49 to float
%51 = fdiv float %48, %50
store float %51, float* %20
%52 = load i32, i32* %15
%53 = sitofp i32 %52 to float
%54 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float %53)
%55 = load i32, i32* %16
%56 = sitofp i32 %55 to float
%57 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), float %56)
%58 = load i32, i32* %17
%59 = sitofp i32 %58 to float
%60 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), float %59)
%61 = load float, float* %18
%62 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), float %61)
%63 = load float, float* %19
%64 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), float %63)
%65 = load float, float* %20
%66 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), float %65)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"TaxaOcupacaoAgentes = %d%%\0A\00"
@.str.1 = [28 x i8] c"TaxaOcupacaoAgente1 = %d%%\0A\00"
@.str.2 = [28 x i8] c"TaxaOcupacaoAgente2 = %d%%\0A\00"
@.str.3 = [28 x i8] c"NumMedioUtentesFila = %.3f\0A\00"
@.str.4 = [32 x i8] c"TempoMedioEsperaUtentes = %.3f\0A\00"
@.str.5 = [38 x i8] c"TempoMedioPermanaenciaUtentes = %.3f\0A\00"
define void @ContadoresEstatisticos(i32 %0, i32 %1, float %2, float %3, float %4, float %5, float %6) {
%8 = fadd float %2, %3
%9 = fmul float %6, 2.000000e+00
%10 = fdiv float %8, %9
%11 = fmul float %10, 1.000000e+02
%12 = fptosi float %11 to i32
%13 = fdiv float %2, %6
%14 = fmul float %13, 1.000000e+02
%15 = fptosi float %14 to i32
%16 = fdiv float %3, %6
%17 = fmul float %16, 1.000000e+02
%18 = fptosi float %17 to i32
%19 = sitofp i32 %1 to float
%20 = sitofp i32 %0 to float
%21 = fdiv float %19, %20
%22 = fdiv float %4, %20
%23 = fdiv float %5, %20
%24 = sitofp i32 %12 to float
%25 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float %24)
%26 = sitofp i32 %15 to float
%27 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), float %26)
%28 = sitofp i32 %18 to float
%29 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), float %28)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), float %21)
%31 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), float %22)
%32 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), float %23)
ret void
}