#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*/ LC_ALL;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "Portuguese");
  int idade, sup50 = 0, peso40 = 0, jovens = 0;
  float altura, peso, alturas;
  for (int i = 0; i < 25; i++) {
    printf("DIGITE A IDADE DA %d PESSOA: ", i + 1);
    scanf("%d", &idade);
    printf("DIGITE A ALTURA DA %d PESSOA: ", i + 1);
    scanf("%f", &altura);
    printf("DIGITE O PESO DA %d PESSOA: ", i + 1);
    scanf("%f", &peso);
    printf("\n");
    if (idade > 50)
      sup50++;
    if (idade >= 10 && idade <= 20) {
      jovens++;
      alturas += altura;
    }
    if (peso < 40)
      peso40++;
  }
  printf("\n\nA QUANTIDADE DE PESSOAS COM IDADE SUPERIOR Á 50 É %d\n\n", sup50);
  printf("A MÉDIA DAS ALTURAS DE PESSOAS ENTRE 10 E 20 ANO É %.2f\n\n",
         alturas / jovens);
  printf("A PORCENTAGEM DE PESSOAS COM PESO INFERIOR Á 40 KG É %.2f%%\n\n",
         peso40 * 4.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1040 <setlocale@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x19,-0x24(%rbp)
jge    1267 <main+0x137>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x32,-0x8(%rbp)
jle    120d <main+0xdd>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1239 <main+0x109>
cmpl   $0x14,-0x8(%rbp)
jg     1239 <main+0x109>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xdc7(%rip),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1254 <main+0x124>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1259 <main+0x129>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1170 <main+0x40>
mov    -0xc(%rbp),%esi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe21(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xd5b(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe3e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1050 <setlocale@plt>
mov    $0x1,%ebx
lea    0xeec(%rip),%rbp
lea    0xc(%rsp),%r12
xor    %r15d,%r15d
xor    %r14d,%r14d
xor    %r13d,%r13d
jmp    11c4 <main+0x84>
nop
movss  0xe78(%rip),%xmm0
movss  0x8(%rsp),%xmm1
xor    %ecx,%ecx
cmp    $0x33,%eax
setge  %cl
add    %ecx,%r13d
xor    %eax,%eax
movss  0xe61(%rip),%xmm2
ucomiss 0xc(%rsp),%xmm2
seta   %al
addss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
add    %eax,%r14d
add    $0x1,%ebx
cmp    $0x1a,%ebx
je     124f <main+0x10f>
lea    0xe50(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe5e(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe4e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe51(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x14(%rsp),%eax
lea    -0xa(%rax),%ecx
cmp    $0xb,%ecx
adc    $0x0,%r15d
cmp    $0xb,%ecx
jae    1180 <main+0x40>
movss  0x10(%rsp),%xmm0
jmp    1188 <main+0x48>
lea    0xe25(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r15d,%xmm0
movss  0x8(%rsp),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe36(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
mulsd  0xd71(%rip),%xmm0
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [30 x i8] c"DIGITE A IDADE DA %d PESSOA: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [31 x i8] c"DIGITE A ALTURA DA %d PESSOA: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [29 x i8] c"DIGITE O PESO DA %d PESSOA: \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [59 x i8] c"\0A\0AA QUANTIDADE DE PESSOAS COM IDADE SUPERIOR \C3\81 50 \C3\89 %d\0A\0A\00"
@.str.8 = [60 x i8] c"A M\C3\89DIA DAS ALTURAS DE PESSOAS ENTRE 10 E 20 ANO \C3\89 %.2f\0A\0A\00"
@.str.9 = [64 x i8] c"A PORCENTAGEM DE PESSOAS COM PESO INFERIOR \C3\81 40 KG \C3\89 %.2f%%\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i32 0, i32* %1
%10 = load i32, i32* @LC_ALL
%11 = call i32 @setlocale(i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %9
br label %12
12: ; preds = %53, %0
%13 = load i32, i32* %9
%14 = icmp slt i32 %13, 25
br i1 %14, label %15, label %56
15: ; preds = %12
%16 = load i32, i32* %9
%17 = add nsw i32 %16, 1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%20 = load i32, i32* %9
%21 = add nsw i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %6)
%24 = load i32, i32* %9
%25 = add nsw i32 %24, 1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %25)
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %7)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%29 = load i32, i32* %2
%30 = icmp sgt i32 %29, 50
br i1 %30, label %31, label %34
31: ; preds = %15
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %34
34: ; preds = %31, %15
%35 = load i32, i32* %2
%36 = icmp sge i32 %35, 10
br i1 %36, label %37, label %46
37: ; preds = %34
%38 = load i32, i32* %2
%39 = icmp sle i32 %38, 20
br i1 %39, label %40, label %46
40: ; preds = %37
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
%43 = load float, float* %6
%44 = load float, float* %8
%45 = fadd float %44, %43
store float %45, float* %8
br label %46
46: ; preds = %40, %37, %34
%47 = load float, float* %7
%48 = fcmp olt float %47, 4.000000e+01
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %52
52: ; preds = %49, %46
br label %53
53: ; preds = %52
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 1
store i32 %55, i32* %9
br label %12
56: ; preds = %12
%57 = load i32, i32* %3
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.7, i64 0, i64 0), i32 %57)
%59 = load float, float* %8
%60 = load i32, i32* %5
%61 = sitofp i32 %60 to float
%62 = fdiv float %59, %61
%63 = fpext float %62 to double
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), double %63)
%65 = load i32, i32* %4
%66 = sitofp i32 %65 to double
%67 = fmul double %66, 4.000000e+00
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.9, i64 0, i64 0), double %67)
%69 = load i32, i32* %1
ret i32 %69
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [30 x i8] c"DIGITE A IDADE DA %d PESSOA: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [31 x i8] c"DIGITE A ALTURA DA %d PESSOA: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [29 x i8] c"DIGITE O PESO DA %d PESSOA: \00"
@.str.7 = [59 x i8] c"\0A\0AA QUANTIDADE DE PESSOAS COM IDADE SUPERIOR \C3\81 50 \C3\89 %d\0A\0A\00"
@.str.8 = [60 x i8] c"A M\C3\89DIA DAS ALTURAS DE PESSOAS ENTRE 10 E 20 ANO \C3\89 %.2f\0A\0A\00"
@.str.9 = [64 x i8] c"A PORCENTAGEM DE PESSOAS COM PESO INFERIOR \C3\81 40 KG \C3\89 %.2f%%\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = load i32, i32* @LC_ALL
%5 = tail call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = bitcast i32* %1 to i8*
%7 = bitcast float* %2 to i8*
%8 = bitcast float* %3 to i8*
br label %18
9: ; preds = %18
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.7, i64 0, i64 0), i32 %35)
%11 = sitofp i32 %40 to float
%12 = fdiv float %42, %11
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0), double %13)
%15 = sitofp i32 %46 to double
%16 = fmul double %15, 4.000000e+00
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.9, i64 0, i64 0), double %16)
ret i32 0
18: ; preds = %0, %18
%19 = phi i32 [ 0, %0 ], [ %24, %18 ]
%20 = phi float [ undef, %0 ], [ %42, %18 ]
%21 = phi i32 [ 0, %0 ], [ %40, %18 ]
%22 = phi i32 [ 0, %0 ], [ %46, %18 ]
%23 = phi i32 [ 0, %0 ], [ %35, %18 ]
%24 = add nuw nsw i32 %19, 1
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%31 = call i32 @putchar(i32 10)
%32 = load i32, i32* %1
%33 = icmp sgt i32 %32, 50
%34 = zext i1 %33 to i32
%35 = add nuw nsw i32 %23, %34
%36 = add i32 %32, -10
%37 = icmp ult i32 %36, 11
%38 = load float, float* %2
%39 = zext i1 %37 to i32
%40 = add nuw nsw i32 %21, %39
%41 = select i1 %37, float %38, float -0.000000e+00
%42 = fadd float %20, %41
%43 = load float, float* %3
%44 = fcmp olt float %43, 4.000000e+01
%45 = zext i1 %44 to i32
%46 = add nuw nsw i32 %22, %45
%47 = icmp eq i32 %24, 25
br i1 %47, label %9, label %18
}