#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 *, ...);
int main() {
  int idade = 0, cont50 = 0, espantalho = 0;
  float peso = 0.0, altura = 0.0, md = 0.0, mdpeso = 0.0;
  for (int i = 1; i < 3; i++) {
    printf("\nDigite a sua idade :");
    scanf("%d", &idade);
    printf("Digite a sua altura :");
    scanf("%f", &altura);
    printf("Digite seu peso :");
    scanf("%f", &peso);
    if (idade > 50)
      cont50++;
    if (idade >= 10 && idade <= 20)
      md += altura / 2;
    if (peso < 40)
      espantalho++;
    mdpeso = (espantalho / 2.0) * 100;
  }
  printf("\nO total de pessoas com idade superior a 50 e %d", cont50);
  printf("\nA media das alturas de pessoas com idade entre 10 e 20 anos e %.1f",
         md);
  printf("\nA porcentagem de pessoas com peso inferior a 40 kg e %f porcento",
         mdpeso);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    1266 <main+0x146>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x32,-0x8(%rbp)
jle    11e8 <main+0xc8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1217 <main+0xf7>
cmpl   $0x14,-0x8(%rbp)
jg     1217 <main+0xf7>
movss  -0x18(%rbp),%xmm0
movss  0xdf7(%rip),%xmm1
divss  %xmm1,%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xde5(%rip),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    1232 <main+0x112>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xdd1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdbd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116b <main+0x4b>
mov    -0xc(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe03(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe30(%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
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf34(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeba(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%r13
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ebx,%ebx
cmp    $0x33,%eax
setge  %bl
add    $0xfffffff6,%eax
cmp    $0xb,%eax
jb     11cf <main+0xaf>
xorps  %xmm0,%xmm0
movss  %xmm0,(%rsp)
jmp    11e9 <main+0xc9>
xorps  %xmm1,%xmm1
movss  0x8(%rsp),%xmm0
mulss  0xe20(%rip),%xmm0
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0xe13(%rip),%xmm0
xor    %ebp,%ebp
ucomiss 0xc(%rsp),%xmm0
seta   %bpl
lea    0xe1d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe12(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ecx,%ecx
cmp    $0x33,%eax
setge  %cl
add    %ecx,%ebx
add    $0xfffffff6,%eax
cmp    $0xb,%eax
jb     126f <main+0x14f>
movss  0xd9b(%rip),%xmm1
jmp    127d <main+0x15d>
movss  0xd89(%rip),%xmm1
mulss  0x8(%rsp),%xmm1
xor    %eax,%eax
movss  0xd7d(%rip),%xmm0
ucomiss 0xc(%rsp),%xmm0
seta   %al
add    %eax,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xd70(%rip),%xmm0
mulsd  0xd70(%rip),%xmm0
movss  (%rsp),%xmm2
addss  %xmm1,%xmm2
movss  %xmm2,(%rsp)
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xd96(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xde4(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0ADigite a sua idade :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Digite a sua altura :\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [18 x i8] c"Digite seu peso :\00"
@.str.5 = [49 x i8] c"\0AO total de pessoas com idade superior a 50 e %d\00"
@.str.6 = [68 x i8] c"\0AA media das alturas de pessoas com idade entre 10 e 20 anos e %.1f\00"
@.str.7 = [66 x i8] c"\0AA porcentagem de pessoas com peso inferior a 40 kg e %f porcento\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %8
store i32 1, i32* %9
br label %10
10: ; preds = %48, %0
%11 = load i32, i32* %9
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %51
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %6)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%20 = load i32, i32* %2
%21 = icmp sgt i32 %20, 50
br i1 %21, label %22, label %25
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %25
25: ; preds = %22, %13
%26 = load i32, i32* %2
%27 = icmp sge i32 %26, 10
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = load i32, i32* %2
%30 = icmp sle i32 %29, 20
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load float, float* %6
%33 = fdiv float %32, 2.000000e+00
%34 = load float, float* %7
%35 = fadd float %34, %33
store float %35, float* %7
br label %36
36: ; preds = %31, %28, %25
%37 = load float, float* %5
%38 = fcmp olt float %37, 4.000000e+01
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %42
42: ; preds = %39, %36
%43 = load i32, i32* %4
%44 = sitofp i32 %43 to double
%45 = fdiv double %44, 2.000000e+00
%46 = fmul double %45, 1.000000e+02
%47 = fptrunc double %46 to float
store float %47, float* %8
br label %48
48: ; preds = %42
%49 = load i32, i32* %9
%50 = add nsw i32 %49, 1
store i32 %50, i32* %9
br label %10
51: ; preds = %10
%52 = load i32, i32* %3
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %52)
%54 = load float, float* %7
%55 = fpext float %54 to double
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0), double %55)
%57 = load float, float* %8
%58 = fpext float %57 to double
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0), double %58)
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0ADigite a sua idade :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Digite a sua altura :\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [18 x i8] c"Digite seu peso :\00"
@.str.5 = [49 x i8] c"\0AO total de pessoas com idade superior a 50 e %d\00"
@.str.6 = [68 x i8] c"\0AA media das alturas de pessoas com idade entre 10 e 20 anos e %.1f\00"
@.str.7 = [66 x i8] c"\0AA porcentagem de pessoas com peso inferior a 40 kg e %f porcento\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%6 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%13 = load i32, i32* %1
%14 = icmp sgt i32 %13, 50
%15 = zext i1 %14 to i32
%16 = add i32 %13, -10
%17 = icmp ult i32 %16, 11
%18 = load float, float* %3
%19 = fmul float %18, 5.000000e-01
%20 = fadd float %19, 0.000000e+00
%21 = select i1 %17, float %20, float 0.000000e+00
%22 = load float, float* %2
%23 = fcmp olt float %22, 4.000000e+01
%24 = zext i1 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%31 = load i32, i32* %1
%32 = icmp sgt i32 %31, 50
%33 = zext i1 %32 to i32
%34 = add nuw nsw i32 %15, %33
%35 = add i32 %31, -10
%36 = icmp ult i32 %35, 11
%37 = load float, float* %3
%38 = fmul float %37, 5.000000e-01
%39 = select i1 %36, float %38, float -0.000000e+00
%40 = fadd float %21, %39
%41 = load float, float* %2
%42 = fcmp olt float %41, 4.000000e+01
%43 = zext i1 %42 to i32
%44 = add nuw nsw i32 %24, %43
%45 = sitofp i32 %44 to double
%46 = fmul double %45, 5.000000e-01
%47 = fmul double %46, 1.000000e+02
%48 = fptrunc double %47 to float
%49 = fpext float %48 to double
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), i32 %34)
%51 = fpext float %40 to double
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0), double %51)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0), double %49)
ret i32 0
}