#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float sal[10], cont = 0, media = 0, porcentagem = 0;
  int i, porcent = 0;
  for (i = 0; i <= 9; i++) {
    printf("Digite o salario:");
    scanf("%f", &sal[i]);
    cont = cont + sal[i];
  }
  media = cont / 10;
  printf("%.2f\n", media);
  if (sal[i] > media) {
    porcent++;
  }
  porcentagem = ((float)porcent * 10) / 100;
  printf("%.2f%% recebem acima da media", porcentagem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0x9,-0x40(%rbp)
jg     11aa <main+0x8a>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x40(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe97(%rip),%rdi
call   1040 <scanf@plt>
movss  -0x34(%rbp),%xmm0
movslq -0x40(%rbp),%rax
addss  -0x30(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1155 <main+0x35>
movss  -0x34(%rbp),%xmm0
movss  0xe49(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe4d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq -0x40(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
ucomiss -0x38(%rbp),%xmm0
jbe    11f4 <main+0xd4>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
cvtsi2ssl -0x44(%rbp),%xmm0
movss  0xdff(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xdf7(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xeda(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
addss  0x10(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x1c(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x20(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x24(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x28(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x2c(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x30(%rsp),%xmm0
movaps %xmm0,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps (%rsp),%xmm0
addss  0x34(%rsp),%xmm0
divss  0xd56(%rip),%xmm0
movaps %xmm0,(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xd64(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movaps (%rsp),%xmm1
cmpltss 0x38(%rsp),%xmm1
movss  0xd31(%rip),%xmm0
andps  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd42(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Digite o salario:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%.2f\0A\00"
@.str.3 = [30 x i8] c"%.2f%% recebem acima da media\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store i32 0, i32* %7
store i32 0, i32* %6
br label %8
8: ; preds = %23, %0
%9 = load i32, i32* %6
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %14
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %15)
%17 = load float, float* %3
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %19
%21 = load float, float* %20
%22 = fadd float %17, %21
store float %22, float* %3
br label %23
23: ; preds = %11
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %8
26: ; preds = %8
%27 = load float, float* %3
%28 = fdiv float %27, 1.000000e+01
store float %28, float* %4
%29 = load float, float* %4
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %30)
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %33
%35 = load float, float* %34
%36 = load float, float* %4
%37 = fcmp ogt float %35, %36
br i1 %37, label %38, label %41
38: ; preds = %26
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
br label %41
41: ; preds = %38, %26
%42 = load i32, i32* %7
%43 = sitofp i32 %42 to float
%44 = fmul float %43, 1.000000e+01
%45 = fdiv float %44, 1.000000e+02
store float %45, float* %5
%46 = load float, float* %5
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Digite o salario:\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"%.2f\0A\00"
@.str.3 = [30 x i8] c"%.2f%% recebem acima da media\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x float], [10 x float]* %1, 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 = fadd float %6, 0.000000e+00
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
%11 = load float, float* %9
%12 = fadd float %7, %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 2
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %14)
%16 = load float, float* %14
%17 = fadd float %12, %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%19 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 3
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %19)
%21 = load float, float* %19
%22 = fadd float %17, %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%24 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 4
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %24)
%26 = load float, float* %24
%27 = fadd float %22, %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%29 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 5
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %29)
%31 = load float, float* %29
%32 = fadd float %27, %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%34 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 6
%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 = fadd float %32, %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%39 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 7
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %39)
%41 = load float, float* %39
%42 = fadd float %37, %41
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%44 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 8
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %44)
%46 = load float, float* %44
%47 = fadd float %42, %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%49 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 9
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %49)
%51 = load float, float* %49
%52 = fadd float %47, %51
%53 = fdiv float %52, 1.000000e+01
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %54)
%56 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 10
%57 = load float, float* %56
%58 = fcmp ogt float %57, %53
%59 = select i1 %58, float 0x3FB99999A0000000, float 0.000000e+00
%60 = fpext float %59 to double
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %60)
ret i32 0
}