#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() {
  float numeros[10];
  int qtd_neg = 0;
  float sum_pos = 0.0;
  int i;
  for (i = 0; i < 10; i++) {
    scanf("%f", &numeros[i]);
    if (numeros[i] < 0.0)
      qtd_neg++;
    else
      sum_pos += numeros[i];
  }
  printf("A quantidade de números negativos: %d\n", qtd_neg);
  printf("\nA soma dos números positivos: %0.2f", sum_pos);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    11ba <main+0x9a>
movslq -0x3c(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9b(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x3c(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1193 <main+0x73>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a7 <main+0x87>
movslq -0x3c(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
addss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
jmp    11ac <main+0x8c>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1145 <main+0x25>
cvtsi2ssl -0x34(%rbp),%xmm0
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
movss  -0x38(%rbp),%xmm0
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xed9(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  (%rsp),%xmm1
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
movaps %xmm1,0xc0(%rsp)
cmpless %xmm2,%xmm1
andnps %xmm0,%xmm1
movaps %xmm1,0x30(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
movaps %xmm0,0xb0(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
movaps %xmm0,0xa0(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x10(%rsp),%xmm0
movaps %xmm0,0x90(%rsp)
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
movaps %xmm0,0x80(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x18(%rsp),%xmm0
movaps %xmm0,0x70(%rsp)
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x1c(%rsp),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x40(%rsp),%xmm2
movaps %xmm2,%xmm1
cmpless 0xde1(%rip),%xmm1
movss  0xdd5(%rip),%xmm3
movaps %xmm1,%xmm0
andps  %xmm3,%xmm0
andnps %xmm2,%xmm1
orps   %xmm0,%xmm1
addss  0x30(%rsp),%xmm1
movaps %xmm1,0x30(%rsp)
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x20(%rsp),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movaps 0x50(%rsp),%xmm13
movaps 0x60(%rsp),%xmm12
movaps 0x80(%rsp),%xmm4
movaps 0x70(%rsp),%xmm0
movaps 0xa0(%rsp),%xmm11
xorps  %xmm9,%xmm9
movaps 0xb0(%rsp),%xmm7
movaps 0x90(%rsp),%xmm6
movss  0xd5b(%rip),%xmm5
movss  0x24(%rsp),%xmm10
movaps %xmm12,%xmm1
unpcklps %xmm0,%xmm1
movaps %xmm10,%xmm2
unpcklps %xmm13,%xmm2
movlhps %xmm1,%xmm2
movaps %xmm11,%xmm1
unpcklps %xmm7,%xmm1
movaps %xmm4,%xmm3
unpcklps %xmm6,%xmm3
movlhps %xmm1,%xmm3
cmpleps %xmm9,%xmm3
cmpleps %xmm9,%xmm2
packssdw %xmm3,%xmm2
packsswb %xmm2,%xmm2
pmovmskb %xmm2,%eax
movaps %xmm5,%xmm1
test   $0x80,%al
jne    12ee <main+0x1ce>
movaps %xmm7,%xmm1
movaps 0x30(%rsp),%xmm3
addss  %xmm1,%xmm3
movaps %xmm5,%xmm1
test   $0x40,%al
jne    1302 <main+0x1e2>
movaps %xmm11,%xmm1
addss  %xmm1,%xmm3
movaps %xmm5,%xmm1
test   $0x20,%al
movaps 0xc0(%rsp),%xmm2
xorps  %xmm8,%xmm8
jne    131c <main+0x1fc>
movaps %xmm6,%xmm1
addss  %xmm1,%xmm3
movaps %xmm5,%xmm1
test   $0x10,%al
jne    132a <main+0x20a>
movaps %xmm4,%xmm1
addss  %xmm1,%xmm3
movaps %xmm5,%xmm1
test   $0x8,%al
jne    1338 <main+0x218>
movaps %xmm0,%xmm1
addss  %xmm1,%xmm3
unpcklps %xmm4,%xmm6
unpcklps %xmm12,%xmm0
unpcklps 0x40(%rsp),%xmm2
unpcklps %xmm11,%xmm7
movaps %xmm5,%xmm1
test   $0x4,%al
jne    1357 <main+0x237>
movaps %xmm12,%xmm1
addss  %xmm1,%xmm3
movlhps %xmm0,%xmm6
xor    %ecx,%ecx
ucomiss %xmm13,%xmm8
movlhps %xmm7,%xmm2
seta   %cl
movaps %xmm5,%xmm1
test   $0x2,%al
jne    1375 <main+0x255>
movaps %xmm13,%xmm1
xor    %edx,%edx
ucomiss %xmm10,%xmm8
seta   %dl
addss  %xmm1,%xmm3
cmpltps %xmm9,%xmm2
cmpltps %xmm9,%xmm6
packssdw %xmm6,%xmm2
packsswb %xmm2,%xmm2
pmovmskb %xmm2,%esi
mov    %esi,%ebx
shr    %bl
and    $0x55,%bl
sub    %bl,%sil
mov    %esi,%ebx
and    $0x33,%bl
shr    $0x2,%sil
and    $0x33,%sil
add    %bl,%sil
mov    %esi,%ebx
shr    $0x4,%bl
add    %sil,%bl
and    $0xf,%bl
movzbl %bl,%esi
add    %ecx,%esi
add    %edx,%esi
test   $0x1,%al
jne    13cc <main+0x2ac>
movaps %xmm10,%xmm5
addss  %xmm5,%xmm3
movaps %xmm3,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
lea    0xc28(%rip),%rdi
call   1030 <printf@plt>
lea    0xc44(%rip),%rdi
movaps 0x30(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [40 x i8] c"A quantidade de n\C3\BAmeros negativos: %d\0A\00"
@.str.2 = [38 x i8] c"\0AA soma dos n\C3\BAmeros positivos: %0.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store float 0.000000e+00, float* %4
store i32 0, i32* %5
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %34
9: ; preds = %6
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %11
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %12)
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %15
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = fcmp olt double %18, 0.000000e+00
br i1 %19, label %20, label %23
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %30
23: ; preds = %9
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %25
%27 = load float, float* %26
%28 = load float, float* %4
%29 = fadd float %28, %27
store float %29, float* %4
br label %30
30: ; preds = %23, %20
br label %31
31: ; preds = %30
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %6
34: ; preds = %6
%35 = load i32, i32* %3
%36 = sitofp i32 %35 to float
%37 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), float %36)
%38 = load float, float* %4
%39 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), float %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [40 x i8] c"A quantidade de n\C3\BAmeros negativos: %d\0A\00"
@.str.2 = [38 x i8] c"\0AA soma dos n\C3\BAmeros positivos: %0.2f\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = load float, float* %3
%6 = fcmp ole float %5, 0.000000e+00
%7 = fadd float %5, 0.000000e+00
%8 = select i1 %6, float 0.000000e+00, float %7
%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, i64 0, i64 0), float* %9)
%11 = load float, float* %9
%12 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 2
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %12)
%14 = load float, float* %12
%15 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 3
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %15)
%17 = load float, float* %15
%18 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 4
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %18)
%20 = load float, float* %18
%21 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 5
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %21)
%23 = load float, float* %21
%24 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 6
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %24)
%26 = load float, float* %24
%27 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 7
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %27)
%29 = load float, float* %27
%30 = insertelement <8 x float> poison, float %5, i64 0
%31 = insertelement <8 x float> %30, float %11, i64 1
%32 = insertelement <8 x float> %31, float %14, i64 2
%33 = insertelement <8 x float> %32, float %17, i64 3
%34 = insertelement <8 x float> %33, float %20, i64 4
%35 = insertelement <8 x float> %34, float %23, i64 5
%36 = insertelement <8 x float> %35, float %26, i64 6
%37 = insertelement <8 x float> %36, float %29, i64 7
%38 = fcmp olt <8 x float> %37, zeroinitializer
%39 = fcmp ole float %11, 0.000000e+00
%40 = select i1 %39, float -0.000000e+00, float %11
%41 = fadd float %8, %40
%42 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 8
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %42)
%44 = load float, float* %42
%45 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 9
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %45)
%47 = load float, float* %45
%48 = insertelement <8 x float> poison, float %47, i64 0
%49 = insertelement <8 x float> %48, float %44, i64 1
%50 = insertelement <8 x float> %49, float %29, i64 2
%51 = insertelement <8 x float> %50, float %26, i64 3
%52 = insertelement <8 x float> %51, float %23, i64 4
%53 = insertelement <8 x float> %52, float %20, i64 5
%54 = insertelement <8 x float> %53, float %17, i64 6
%55 = insertelement <8 x float> %54, float %14, i64 7
%56 = fcmp ole <8 x float> %55, zeroinitializer
%57 = extractelement <8 x i1> %56, i64 7
%58 = select i1 %57, float -0.000000e+00, float %14
%59 = fadd float %41, %58
%60 = extractelement <8 x i1> %56, i64 6
%61 = select i1 %60, float -0.000000e+00, float %17
%62 = fadd float %59, %61
%63 = extractelement <8 x i1> %56, i64 5
%64 = select i1 %63, float -0.000000e+00, float %20
%65 = fadd float %62, %64
%66 = extractelement <8 x i1> %56, i64 4
%67 = select i1 %66, float -0.000000e+00, float %23
%68 = fadd float %65, %67
%69 = extractelement <8 x i1> %56, i64 3
%70 = select i1 %69, float -0.000000e+00, float %26
%71 = fadd float %68, %70
%72 = extractelement <8 x i1> %56, i64 2
%73 = select i1 %72, float -0.000000e+00, float %29
%74 = fadd float %71, %73
%75 = fcmp olt float %44, 0.000000e+00
%76 = zext i1 %75 to i32
%77 = extractelement <8 x i1> %56, i64 1
%78 = select i1 %77, float -0.000000e+00, float %44
%79 = fadd float %74, %78
%80 = fcmp olt float %47, 0.000000e+00
%81 = zext i1 %80 to i32
%82 = bitcast <8 x i1> %38 to i8
%83 = call i8 @llvm.ctpop.i8(i8 %82)
%84 = zext i8 %83 to i32
%85 = add nuw nsw i32 %84, %76
%86 = add nuw nsw i32 %85, %81
%87 = extractelement <8 x i1> %56, i64 0
%88 = select i1 %87, float -0.000000e+00, float %47
%89 = fadd float %79, %88
%90 = sitofp i32 %86 to float
%91 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), float %90)
%92 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), float %89)
ret i32 0
}