#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() {
  float peso = 0, salario = 0, mediapeso = 0, media = 0, contp = 0, conts = 0,
        mediasal = 0, medias = 0;
  int sexo, i;
  for (i = 1; i < 11; i++) {
    printf("\nDigite o seu sexo: 1 para feminino e 2 para masculino.\n");
    scanf("%d", &sexo);
    printf("\nDigite o seu peso:\n");
    scanf("%f", &peso);
    if (sexo == 1 && peso > 50) {
      contp = contp + 1;
      mediapeso = mediapeso + peso;
      media = mediapeso / contp;
    }
    printf("\nDigite o seu salario:\n");
    scanf("%f", &salario);
    if (sexo == 2 && salario >= 1000 && salario <= 3000) {
      conts = conts + 1;
      mediasal = mediasal + salario;
      medias = mediasal / conts;
    }
  }
  if (contp == 1) {
    printf("\nA Media do Peso das Mulheres acima de 50kg é %.2fkg, e temos "
           "%.0f pessoa.\n",
           media, contp);
  } else {
    printf("\nA Media do Peso das Mulheres acima de 50kg é %.2fkg, e temos "
           "%.0f pessoas.\n",
           media, contp);
  }
  if (conts == 1) {
    printf("\nA Media Salarial dos Homens que ganham entre 1000.00 reais e "
           "3000.00 reais é %.2f reais, e temos %.0f pessoa.\n",
           medias, conts);
  } else {
    printf("\nA Media Salarial dos Homens que ganham entre 1000.00 reais e "
           "3000.00 reais é %.2f reais, e temos %.0f pessoas.\n",
           medias, conts);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-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)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x1,-0x2c(%rbp)
cmpl   $0xb,-0x2c(%rbp)
jge    12a5 <main+0x185>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x1,-0x28(%rbp)
jne    1210 <main+0xf0>
movss  -0x8(%rbp),%xmm0
movss  0xe2d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1210 <main+0xf0>
movss  0xe18(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3c(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x2,-0x28(%rbp)
jne    1292 <main+0x172>
movss  -0xc(%rbp),%xmm0
movss  0xdc1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1292 <main+0x172>
movss  0xdb4(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     1292 <main+0x172>
movss  0xd96(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    1297 <main+0x177>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1176 <main+0x56>
movss  -0x18(%rbp),%xmm0
movss  0xd4e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    12e6 <main+0x1c6>
jp     12e6 <main+0x1c6>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xda2(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1306 <main+0x1e6>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdca(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
movss  0xced(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1347 <main+0x227>
jp     1347 <main+0x227>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xddc(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1367 <main+0x247>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe28(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%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    $0x28,%rsp
movl   $0x0,0x24(%rsp)
movl   $0x0,0x20(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
mov    $0xa,%r12d
lea    0x1070(%rip),%r13
lea    0xeb0(%rip),%rbx
lea    0x24(%rsp),%rbp
lea    0x1071(%rip),%r14
lea    0x20(%rsp),%r15
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rsp)
xorps  %xmm1,%xmm1
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
jmp    11ba <main+0x8a>
movss  0x4(%rsp),%xmm1
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%r12d
je     12ac <main+0x17c>
movss  %xmm1,0x4(%rsp)
lea    0xfd5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe45(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x1,0x1c(%rsp)
jne    1238 <main+0x108>
movss  0x24(%rsp),%xmm0
ucomiss 0xdf8(%rip),%xmm0
jbe    1238 <main+0x108>
movss  0x8(%rsp),%xmm1
addss  0xdec(%rip),%xmm1
movss  0x14(%rsp),%xmm2
addss  %xmm0,%xmm2
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x8(%rsp)
divss  %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x2,0x1c(%rsp)
jne    11a5 <main+0x75>
movss  0x20(%rsp),%xmm0
ucomiss 0xda3(%rip),%xmm0
movss  0x4(%rsp),%xmm1
jb     11b0 <main+0x80>
movss  0xd93(%rip),%xmm2
ucomiss %xmm0,%xmm2
jb     11b0 <main+0x80>
addss  0xd7a(%rip),%xmm1
movss  0x18(%rsp),%xmm2
addss  %xmm0,%xmm2
movss  %xmm2,0x18(%rsp)
movaps %xmm2,%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x10(%rsp)
jmp    11b0 <main+0x80>
movss  %xmm1,0x4(%rsp)
movss  0x8(%rsp),%xmm1
ucomiss 0xd45(%rip),%xmm1
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
jne    12de <main+0x1ae>
jp     12de <main+0x1ae>
lea    0xd4a(%rip),%rdi
movsd  0xd34(%rip),%xmm1
jmp    12e9 <main+0x1b9>
cvtss2sd %xmm1,%xmm1
lea    0xd82(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm1
ucomiss 0xd07(%rip),%xmm1
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
jne    131c <main+0x1ec>
jp     131c <main+0x1ec>
lea    0xda7(%rip),%rdi
movsd  0xcf6(%rip),%xmm1
jmp    1327 <main+0x1f7>
cvtss2sd %xmm1,%xmm1
lea    0xe03(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [57 x i8] c"\0ADigite o seu sexo: 1 para feminino e 2 para masculino.\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"\0ADigite o seu peso:\0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [24 x i8] c"\0ADigite o seu salario:\0A\00"
@.str.5 = [77 x i8] c"\0AA Media do Peso das Mulheres acima de 50kg \C3\A9 %.2fkg, e temos %.0f pessoa.\0A\00"
@.str.6 = [78 x i8] c"\0AA Media do Peso das Mulheres acima de 50kg \C3\A9 %.2fkg, e temos %.0f pessoas.\0A\00"
@.str.7 = [113 x i8] c"\0AA Media Salarial dos Homens que ganham entre 1000.00 reais e 3000.00 reais \C3\A9 %.2f reais, e temos %.0f pessoa.\0A\00"
@.str.8 = [114 x i8] c"\0AA Media Salarial dos Homens que ganham entre 1000.00 reais e 3000.00 reais \C3\A9 %.2f reais, e temos %.0f pessoas.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %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 float 0.000000e+00, float* %9
store i32 1, i32* %11
br label %12
12: ; preds = %55, %0
%13 = load i32, i32* %11
%14 = icmp slt i32 %13, 11
br i1 %14, label %15, label %58
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, 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* %2)
%20 = load i32, i32* %10
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %34
22: ; preds = %15
%23 = load float, float* %2
%24 = fcmp ogt float %23, 5.000000e+01
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load float, float* %6
%27 = fadd float %26, 1.000000e+00
store float %27, float* %6
%28 = load float, float* %4
%29 = load float, float* %2
%30 = fadd float %28, %29
store float %30, float* %4
%31 = load float, float* %4
%32 = load float, float* %6
%33 = fdiv float %31, %32
store float %33, float* %5
br label %34
34: ; preds = %25, %22, %15
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%37 = load i32, i32* %10
%38 = icmp eq i32 %37, 2
br i1 %38, label %39, label %54
39: ; preds = %34
%40 = load float, float* %3
%41 = fcmp oge float %40, 1.000000e+03
br i1 %41, label %42, label %54
42: ; preds = %39
%43 = load float, float* %3
%44 = fcmp ole float %43, 3.000000e+03
br i1 %44, label %45, label %54
45: ; preds = %42
%46 = load float, float* %7
%47 = fadd float %46, 1.000000e+00
store float %47, float* %7
%48 = load float, float* %8
%49 = load float, float* %3
%50 = fadd float %48, %49
store float %50, float* %8
%51 = load float, float* %8
%52 = load float, float* %7
%53 = fdiv float %51, %52
store float %53, float* %9
br label %54
54: ; preds = %45, %42, %39, %34
br label %55
55: ; preds = %54
%56 = load i32, i32* %11
%57 = add nsw i32 %56, 1
store i32 %57, i32* %11
br label %12
58: ; preds = %12
%59 = load float, float* %6
%60 = fcmp oeq float %59, 1.000000e+00
br i1 %60, label %61, label %67
61: ; preds = %58
%62 = load float, float* %5
%63 = fpext float %62 to double
%64 = load float, float* %6
%65 = fpext float %64 to double
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.5, i64 0, i64 0), double %63, double %65)
br label %73
67: ; preds = %58
%68 = load float, float* %5
%69 = fpext float %68 to double
%70 = load float, float* %6
%71 = fpext float %70 to double
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0), double %69, double %71)
br label %73
73: ; preds = %67, %61
%74 = load float, float* %7
%75 = fcmp oeq float %74, 1.000000e+00
br i1 %75, label %76, label %82
76: ; preds = %73
%77 = load float, float* %9
%78 = fpext float %77 to double
%79 = load float, float* %7
%80 = fpext float %79 to double
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.7, i64 0, i64 0), double %78, double %80)
br label %88
82: ; preds = %73
%83 = load float, float* %9
%84 = fpext float %83 to double
%85 = load float, float* %7
%86 = fpext float %85 to double
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.8, i64 0, i64 0), double %84, double %86)
br label %88
88: ; preds = %82, %76
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.5 = [77 x i8] c"\0AA Media do Peso das Mulheres acima de 50kg \C3\A9 %.2fkg, e temos %.0f pessoa.\0A\00"
@.str.6 = [78 x i8] c"\0AA Media do Peso das Mulheres acima de 50kg \C3\A9 %.2fkg, e temos %.0f pessoas.\0A\00"
@.str.7 = [113 x i8] c"\0AA Media Salarial dos Homens que ganham entre 1000.00 reais e 3000.00 reais \C3\A9 %.2f reais, e temos %.0f pessoa.\0A\00"
@.str.8 = [114 x i8] c"\0AA Media Salarial dos Homens que ganham entre 1000.00 reais e 3000.00 reais \C3\A9 %.2f reais, e temos %.0f pessoas.\0A\00"
@str = [56 x i8] c"\0ADigite o seu sexo: 1 para feminino e 2 para masculino.\00"
@str.9 = [20 x i8] c"\0ADigite o seu peso:\00"
@str.10 = [23 x i8] c"\0ADigite o seu salario:\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%5 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%6 = bitcast i32* %3 to i8*
br label %7
7: ; preds = %0, %45
%8 = phi i32 [ 1, %0 ], [ %49, %45 ]
%9 = phi float [ 0.000000e+00, %0 ], [ %48, %45 ]
%10 = phi float [ 0.000000e+00, %0 ], [ %47, %45 ]
%11 = phi float [ 0.000000e+00, %0 ], [ %46, %45 ]
%12 = phi float [ 0.000000e+00, %0 ], [ %31, %45 ]
%13 = phi float [ 0.000000e+00, %0 ], [ %30, %45 ]
%14 = phi float [ 0.000000e+00, %0 ], [ %29, %45 ]
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 1
%21 = load float, float* %1
%22 = fcmp ogt float %21, 5.000000e+01
%23 = select i1 %20, i1 %22, i1 false
br i1 %23, label %24, label %28
24: ; preds = %7
%25 = fadd float %12, 1.000000e+00
%26 = fadd float %14, %21
%27 = fdiv float %26, %25
br label %28
28: ; preds = %24, %7
%29 = phi float [ %26, %24 ], [ %14, %7 ]
%30 = phi float [ %27, %24 ], [ %13, %7 ]
%31 = phi float [ %25, %24 ], [ %12, %7 ]
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.10, i64 0, i64 0))
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 2
%36 = load float, float* %2
%37 = fcmp oge float %36, 1.000000e+03
%38 = select i1 %35, i1 %37, i1 false
%39 = fcmp ole float %36, 3.000000e+03
%40 = select i1 %38, i1 %39, i1 false
br i1 %40, label %41, label %45
41: ; preds = %28
%42 = fadd float %11, 1.000000e+00
%43 = fadd float %10, %36
%44 = fdiv float %43, %42
br label %45
45: ; preds = %28, %41
%46 = phi float [ %42, %41 ], [ %11, %28 ]
%47 = phi float [ %43, %41 ], [ %10, %28 ]
%48 = phi float [ %44, %41 ], [ %9, %28 ]
%49 = add nuw nsw i32 %8, 1
%50 = icmp eq i32 %49, 11
br i1 %50, label %51, label %7
51: ; preds = %45
%52 = fcmp oeq float %31, 1.000000e+00
%53 = fpext float %30 to double
br i1 %52, label %54, label %56
54: ; preds = %51
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.5, i64 0, i64 0), double %53, double 1.000000e+00)
br label %59
56: ; preds = %51
%57 = fpext float %31 to double
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.6, i64 0, i64 0), double %53, double %57)
br label %59
59: ; preds = %56, %54
%60 = fcmp oeq float %46, 1.000000e+00
%61 = fpext float %48 to double
br i1 %60, label %62, label %64
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @.str.7, i64 0, i64 0), double %61, double 1.000000e+00)
br label %67
64: ; preds = %59
%65 = fpext float %46 to double
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @.str.8, i64 0, i64 0), double %61, double %65)
br label %67
67: ; preds = %64, %62
ret i32 0
}