#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 *, float *);
int main() {
  float array[10];
  float addition;
  int count;
  int i;
  count = 0;
  for (i = 0; i < 10; i++) {
    printf("Please, insert a value: ");
    scanf("%f", &array[i]);
    if (array[i] >= 0) {
      addition = addition + array[i];
    } else if (array[i]) {
      count = count + 1;
    }
  }
  printf("\nThe quantity of negative number is: %d", count);
  printf("\nThe sum of positive number is: %2.f\n", addition);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    11e1 <main+0xc1>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x3c(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeae(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x3c(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     119f <main+0x7f>
movss  -0x34(%rbp),%xmm0
movslq -0x3c(%rbp),%rax
addss  -0x30(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    11ce <main+0xae>
movslq -0x3c(%rbp),%rax
movss  -0x30(%rbp,%rax,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11c0 <main+0xa0>
jp     11c0 <main+0xa0>
jmp    11c9 <main+0xa9>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11ce <main+0xae>
jmp    11d3 <main+0xb3>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    113d <main+0x1d>
mov    -0x38(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe42(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xed3(%rip),%r14
lea    0xee5(%rip),%r15
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    115a <main+0x3a>
xchg   %ax,%ax
movss  0xc(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
add    $0x4,%rbx
cmp    $0x28,%rbx
je     118c <main+0x6c>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%rsp,%rbx,1),%rsi
add    $0x10,%rsi
mov    %r15,%rdi
call   1040 <scanf@plt>
movss  0x10(%rsp,%rbx,1),%xmm0
ucomiss 0xe7f(%rip),%xmm0
jae    1140 <main+0x20>
jne    1187 <main+0x67>
jnp    1150 <main+0x30>
add    $0x1,%ebp
jmp    1150 <main+0x30>
lea    0xe8d(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please, insert a value: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"\0AThe quantity of negative number is: %d\00"
@.str.3 = [38 x i8] c"\0AThe sum of positive number is: %2.f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %38, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %41
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %13)
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %16
%18 = load float, float* %17
%19 = fcmp oge float %18, 0.000000e+00
br i1 %19, label %20, label %27
20: ; preds = %9
%21 = load float, float* %3
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %23
%25 = load float, float* %24
%26 = fadd float %21, %25
store float %26, float* %3
br label %37
27: ; preds = %9
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 %29
%31 = load float, float* %30
%32 = fcmp une float %31, 0.000000e+00
br i1 %32, label %33, label %36
33: ; preds = %27
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %36
36: ; preds = %33, %27
br label %37
37: ; preds = %36, %20
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %6
41: ; preds = %6
%42 = load i32, i32* %4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = load float, float* %3
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %45)
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please, insert a value: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [40 x i8] c"\0AThe quantity of negative number is: %d\00"
@.str.3 = [38 x i8] c"\0AThe sum of positive number is: %2.f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
br label %3
3: ; preds = %0, %18
%4 = phi i64 [ 0, %0 ], [ %21, %18 ]
%5 = phi i32 [ 0, %0 ], [ %20, %18 ]
%6 = phi float [ undef, %0 ], [ %19, %18 ]
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 %4
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%10 = load float, float* %8
%11 = fcmp ult float %10, 0.000000e+00
br i1 %11, label %14, label %12
12: ; preds = %3
%13 = fadd float %6, %10
br label %18
14: ; preds = %3
%15 = fcmp une float %10, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %14
%17 = add nsw i32 %5, 1
br label %18
18: ; preds = %12, %16, %14
%19 = phi float [ %13, %12 ], [ %6, %16 ], [ %6, %14 ]
%20 = phi i32 [ %5, %12 ], [ %17, %16 ], [ %5, %14 ]
%21 = add nuw nsw i64 %4, 1
%22 = icmp eq i64 %21, 10
br i1 %22, label %23, label %3
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%25 = fpext float %19 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %25)
ret i32 0
}