#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int, int, int);
scalar_t__ scanf(char *, ...);
int main() {
  int n, positive, negative, zero;
  double num;
  while (EOF != scanf("%d", &n) && n != 0) {
    positive = negative = zero = 0;
    while (n--) {
      scanf("%lf", &num);
      if (num > 0) {
        positive++;
      } else if (num < 0) {
        negative++;
      } else {
        zero++;
      }
    }
    printf("%d %d %d\n", negative, zero, positive);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x30(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x21(%rbp)
je     116e <main+0x4e>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    117e <main+0x5e>
jmp    1222 <main+0x102>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1208 <main+0xe8>
lea    0xe55(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11d9 <main+0xb9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1203 <main+0xe3>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11f5 <main+0xd5>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11fe <main+0xde>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1203 <main+0xe3>
jmp    1193 <main+0x73>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
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    $0x18,%rsp
mov    0x2eb3(%rip),%rax
mov    (%rax),%rbx
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %rax,%rbx
je     1230 <main+0x110>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     1230 <main+0x110>
lea    0xe9c(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%eax
mov    %eax,0xc(%rsp)
xor    %ebp,%ebp
xor    %r12d,%r12d
xor    %r15d,%r15d
jmp    11ab <main+0x8b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15d
subl   $0x1,0xc(%rsp)
jb     11f0 <main+0xd0>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     11a0 <main+0x80>
ucomisd %xmm0,%xmm1
jbe    11e0 <main+0xc0>
add    $0x1,%r12d
jmp    11a4 <main+0x84>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
jmp    11a4 <main+0x84>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe10(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
call   1030 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%rbp
lea    0xdeb(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    %rax,%rbp
je     1230 <main+0x110>
mov    0xc(%rsp),%eax
test   %eax,%eax
jne    1180 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 0, i32* %1
br label %7
7: ; preds = %39, %0
%8 = load i64, i64* @EOF
%9 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %11, %7
%15 = phi i1 [ false, %7 ], [ %13, %11 ]
br i1 %15, label %16, label %44
16: ; preds = %14
store i32 0, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
br label %17
17: ; preds = %38, %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
%20 = icmp ne i32 %18, 0
br i1 %20, label %21, label %39
21: ; preds = %17
%22 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%23 = load double, double* %6
%24 = fcmp ogt double %23, 0.000000e+00
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %38
28: ; preds = %21
%29 = load double, double* %6
%30 = fcmp olt double %29, 0.000000e+00
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %37
34: ; preds = %28
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %37
37: ; preds = %34, %31
br label %38
38: ; preds = %37, %25
br label %17
39: ; preds = %17
%40 = load i32, i32* %4
%41 = load i32, i32* %5
%42 = load i32, i32* %3
%43 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %40, i32 %41, i32 %42)
br label %7
44: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = load i64, i64* @EOF
%6 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = icmp ne i64 %5, %6
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %11, label %44
11: ; preds = %0, %36
%12 = phi i32 [ %41, %36 ], [ %8, %0 ]
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
br label %14
14: ; preds = %11, %29
%15 = phi i32 [ 0, %11 ], [ %32, %29 ]
%16 = phi i32 [ 0, %11 ], [ %31, %29 ]
%17 = phi i32 [ 0, %11 ], [ %30, %29 ]
%18 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%19 = load double, double* %2
%20 = fcmp ogt double %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = add nsw i32 %17, 1
br label %29
23: ; preds = %14
%24 = fcmp olt double %19, 0.000000e+00
br i1 %24, label %25, label %27
25: ; preds = %23
%26 = add nsw i32 %16, 1
br label %29
27: ; preds = %23
%28 = add nsw i32 %15, 1
br label %29
29: ; preds = %25, %27, %21
%30 = phi i32 [ %22, %21 ], [ %17, %25 ], [ %17, %27 ]
%31 = phi i32 [ %16, %21 ], [ %26, %25 ], [ %16, %27 ]
%32 = phi i32 [ %15, %21 ], [ %15, %25 ], [ %28, %27 ]
%33 = load i32, i32* %1
%34 = add nsw i32 %33, -1
store i32 %34, i32* %1
%35 = icmp eq i32 %33, 0
br i1 %35, label %36, label %14
36: ; preds = %29
%37 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %31, i32 %32, i32 %30)
%38 = load i64, i64* @EOF
%39 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%40 = icmp ne i64 %38, %39
%41 = load i32, i32* %1
%42 = icmp ne i32 %41, 0
%43 = select i1 %40, i1 %42, i1 false
br i1 %43, label %11, label %44
44: ; preds = %36, %0
ret i32 0
}