#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, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  int i;
  float num[4], media = 0;
  for (i = 0; i < 4; i++) {
    printf("entre com o %dº numero: ", i + 1);
    scanf("%f", &num[i]);
    media = media + num[i];
  }
  media = media / i;
  for (i = 0; i < 4; i++) {
    if (num[i] > media)
      printf("%.2f > %.2f = media\n", num[i], media);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    119d <main+0x7d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1040 <scanf@plt>
movss  -0x24(%rbp),%xmm0
movslq -0x8(%rbp),%rax
addss  -0x20(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x1e>
movss  -0x24(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1209 <main+0xe9>
movslq -0x8(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
ucomiss -0x24(%rbp),%xmm0
jbe    11f6 <main+0xd6>
movslq -0x8(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe2e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    11fb <main+0xdb>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b7 <main+0x97>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xee6(%rip),%r14
movss  0xeca(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xe99(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xe6c(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
addss  0x18(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xe3f(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm1
addss  0x1c(%rsp),%xmm1
mulss  0xe18(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movss  0x10(%rsp),%xmm0
movss  %xmm1,0xc(%rsp)
ucomiss %xmm1,%xmm0
jbe    122a <main+0x10a>
lea    0xe14(%rip),%rdi
movsd  0x20(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
ucomiss 0xc(%rsp),%xmm0
jbe    124b <main+0x12b>
lea    0xdf3(%rip),%rdi
movsd  0x20(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x18(%rsp),%xmm0
ucomiss 0xc(%rsp),%xmm0
jbe    126c <main+0x14c>
lea    0xdd2(%rip),%rdi
movsd  0x20(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x1c(%rsp),%xmm0
ucomiss 0xc(%rsp),%xmm0
jbe    128d <main+0x16d>
lea    0xdb1(%rip),%rdi
movsd  0x20(%rsp),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"entre com o %d\C2\BA numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"%.2f > %.2f = media\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x float]
%4 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store i32 0, i32* %2
br label %5
5: ; preds = %23, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to float
%12 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float %11)
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x float], [4 x float]* %3, 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* %4
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 %19
%21 = load float, float* %20
%22 = fadd float %17, %21
store float %22, float* %4
br label %23
23: ; preds = %8
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %5
26: ; preds = %5
%27 = load float, float* %4
%28 = load i32, i32* %2
%29 = sitofp i32 %28 to float
%30 = fdiv float %27, %29
store float %30, float* %4
store i32 0, i32* %2
br label %31
31: ; preds = %50, %26
%32 = load i32, i32* %2
%33 = icmp slt i32 %32, 4
br i1 %33, label %34, label %53
34: ; preds = %31
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 %36
%38 = load float, float* %37
%39 = load float, float* %4
%40 = fcmp ogt float %38, %39
br i1 %40, label %41, label %49
41: ; preds = %34
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 %43
%45 = load float, float* %44
%46 = load float, float* %4
%47 = fpext float %46 to double
%48 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), float %45, double %47)
br label %49
49: ; preds = %41, %34
br label %50
50: ; preds = %49
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %31
53: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"entre com o %d\C2\BA numero: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"%.2f > %.2f = media\0A\00"
define i32 @main() {
%1 = alloca [4 x float]
%2 = bitcast [4 x float]* %1 to i8*
%3 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float 1.000000e+00)
%4 = getelementptr inbounds [4 x float], [4 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*, float, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float 2.000000e+00)
%9 = getelementptr inbounds [4 x float], [4 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*, float, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float 3.000000e+00)
%14 = getelementptr inbounds [4 x float], [4 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*, float, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), float 4.000000e+00)
%19 = getelementptr inbounds [4 x float], [4 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 = fmul float %22, 2.500000e-01
%24 = fpext float %23 to double
%25 = load float, float* %4
%26 = fcmp ogt float %25, %23
br i1 %26, label %27, label %29
27: ; preds = %0
%28 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), float %25, double %24)
br label %29
29: ; preds = %0, %27
%30 = load float, float* %9
%31 = fcmp ogt float %30, %23
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), float %30, double %24)
br label %34
34: ; preds = %32, %29
%35 = load float, float* %14
%36 = fcmp ogt float %35, %23
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), float %35, double %24)
br label %39
39: ; preds = %37, %34
%40 = load float, float* %19
%41 = fcmp ogt float %40, %23
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), float %40, double %24)
br label %44
44: ; preds = %42, %39
ret i32 0
}