#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, double);
void load(FILE *in) {
  int N;
  int p = 0;
  int n = 0;
  int z = 0;
  fscanf(in, "%d\n", &N);
  for (int i = 0; i < N; i++) {
    int a;
    fscanf(in, "%d", &a);
    if (a > 0) {
      p++;
    } else if (a < 0) {
      n++;
    } else {
      z++;
    }
  }
  printf("%.3lf\n", 1.0 * p / N);
  printf("%.3lf\n", 1.0 * n / N);
  printf("%.3lf\n", 1.0 * z / N);
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11cd <load+0xad>
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <fscanf@plt>
cmpl   $0x0,-0x20(%rbp)
jle    1194 <load+0x74>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ba <load+0x9a>
cmpl   $0x0,-0x20(%rbp)
jge    11ac <load+0x8c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b5 <load+0x95>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ba <load+0x9a>
jmp    11bf <load+0x9f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115c <load+0x3c>
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xe26(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xe00(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xdda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xec8(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <fscanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11a4 <load+0x84>
xor    %r12d,%r12d
lea    0xeb0(%rip),%r14
lea    0x14(%rsp),%r15
xor    %r13d,%r13d
movl   $0x0,0x10(%rsp)
xor    %ebp,%ebp
jmp    1180 <load+0x60>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0x1,%r12d
mov    0xc(%rsp),%eax
cmp    %eax,%r12d
jge    11b1 <load+0x91>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <fscanf@plt>
cmpl   $0x0,0x14(%rsp)
jg     1170 <load+0x50>
js     119d <load+0x7d>
add    $0x1,%r13d
jmp    1173 <load+0x53>
addl   $0x1,0x10(%rsp)
jmp    1173 <load+0x53>
xor    %ebp,%ebp
movl   $0x0,0x10(%rsp)
xor    %r13d,%r13d
cvtsi2sd %ebp,%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
lea    0xe43(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rsp),%xmm1
divsd  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0xc(%rsp),%xmm1
divsd  %xmm1,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"%.3lf\0A\00"
define void @load(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%9 = load i32*, i32** %2
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %7
br label %11
11: ; preds = %34, %1
%12 = load i32, i32* %7
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %37
15: ; preds = %11
%16 = load i32*, i32** %2
%17 = call i32 @fscanf(i32* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%18 = load i32, i32* %8
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %33
23: ; preds = %15
%24 = load i32, i32* %8
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %32
29: ; preds = %23
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %32
32: ; preds = %29, %26
br label %33
33: ; preds = %32, %20
br label %34
34: ; preds = %33
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %11
37: ; preds = %11
%38 = load i32, i32* %4
%39 = sitofp i32 %38 to double
%40 = fmul double 1.000000e+00, %39
%41 = load i32, i32* %3
%42 = sitofp i32 %41 to double
%43 = fdiv double %40, %42
%44 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %43)
%45 = load i32, i32* %5
%46 = sitofp i32 %45 to double
%47 = fmul double 1.000000e+00, %46
%48 = load i32, i32* %3
%49 = sitofp i32 %48 to double
%50 = fdiv double %47, %49
%51 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %50)
%52 = load i32, i32* %6
%53 = sitofp i32 %52 to double
%54 = fmul double 1.000000e+00, %53
%55 = load i32, i32* %3
%56 = sitofp i32 %55 to double
%57 = fdiv double %54, %56
%58 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %57)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"%.3lf\0A\00"
define void @load(i32* nocapture %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = bitcast i32* %3 to i8*
br label %29
10: ; preds = %45, %1
%11 = phi i32 [ 0, %1 ], [ %46, %45 ]
%12 = phi i32 [ 0, %1 ], [ %47, %45 ]
%13 = phi i32 [ 0, %1 ], [ %48, %45 ]
%14 = phi i32 [ %6, %1 ], [ %50, %45 ]
%15 = sitofp i32 %11 to double
%16 = sitofp i32 %14 to double
%17 = fdiv double %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %17)
%19 = sitofp i32 %12 to double
%20 = load i32, i32* %2
%21 = sitofp i32 %20 to double
%22 = fdiv double %19, %21
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %22)
%24 = sitofp i32 %13 to double
%25 = load i32, i32* %2
%26 = sitofp i32 %25 to double
%27 = fdiv double %24, %26
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %27)
ret void
29: ; preds = %8, %45
%30 = phi i32 [ 0, %8 ], [ %49, %45 ]
%31 = phi i32 [ 0, %8 ], [ %48, %45 ]
%32 = phi i32 [ 0, %8 ], [ %47, %45 ]
%33 = phi i32 [ 0, %8 ], [ %46, %45 ]
%34 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%35 = load i32, i32* %3
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %29
%38 = add nsw i32 %33, 1
br label %45
39: ; preds = %29
%40 = icmp slt i32 %35, 0
br i1 %40, label %41, label %43
41: ; preds = %39
%42 = add nsw i32 %32, 1
br label %45
43: ; preds = %39
%44 = add nsw i32 %31, 1
br label %45
45: ; preds = %41, %43, %37
%46 = phi i32 [ %38, %37 ], [ %33, %41 ], [ %33, %43 ]
%47 = phi i32 [ %32, %37 ], [ %42, %41 ], [ %32, %43 ]
%48 = phi i32 [ %31, %37 ], [ %31, %41 ], [ %44, %43 ]
%49 = add nuw nsw i32 %30, 1
%50 = load i32, i32* %2
%51 = icmp slt i32 %49, %50
br i1 %51, label %29, label %10
}