#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 *, double *);
int main(int argc, char const *argv[]) {
  double a = -99, v = 0, x = 0, y = 0, z = 0, w = 0;
  do {
    scanf("%lf", &a);
    if (a != -1) {
      v++;
      if (a == 83) {
        x++;
      } else if (a == 93) {
        y++;
      } else if (a == 0) {
        z++;
      }
    }
  } while (a != -1);
  printf("%d\n%d\n%d\n%d\n", (int)x, (int)y, (int)z, (int)(v - (x + y + z)));
  y >= x ? printf("93\n") : printf("83\n");
  printf("%.2lf\n%.2lf\n", (x * 100) / (x + y + z), (y * 100) / (x + y + z));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    0xebe(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    119d <main+0x7d>
jp     119d <main+0x7d>
jmp    1250 <main+0x130>
movsd  0xe73(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe54(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11e3 <main+0xc3>
jp     11e3 <main+0xc3>
movsd  0xe44(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    124b <main+0x12b>
movsd  -0x18(%rbp),%xmm0
movsd  0xe30(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1217 <main+0xf7>
jp     1217 <main+0xf7>
movsd  0xe10(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1246 <main+0x126>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1241 <main+0x121>
jp     1241 <main+0x121>
movsd  0xde1(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1246 <main+0x126>
jmp    124b <main+0x12b>
jmp    1250 <main+0x130>
jmp    1255 <main+0x135>
movsd  -0x18(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    116b <main+0x4b>
jp     116b <main+0x4b>
cvttsd2si -0x28(%rbp),%esi
cvttsd2si -0x30(%rbp),%edx
cvttsd2si -0x38(%rbp),%ecx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
addsd  -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%r8d
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     12cf <main+0x1af>
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12dd <main+0x1bd>
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xd43(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
addsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd23(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
addsd  -0x30(%rbp),%xmm2
addsd  -0x38(%rbp),%xmm2
divsd  %xmm2,%xmm1
lea    0xd25(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movabs $0xc058c00000000000,%rax
c0 58 c0
mov    %rax,0x18(%rsp)
lea    0xee3(%rip),%rdi
lea    0x18(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm0
ucomisd 0xe9b(%rip),%xmm0
jne    116d <main+0x3d>
jnp    123b <main+0x10b>
movsd  0xe93(%rip),%xmm3
lea    0xeb4(%rip),%r14
lea    0x18(%rsp),%rbx
xorpd  %xmm2,%xmm2
xorps  %xmm1,%xmm1
movsd  %xmm1,0x10(%rsp)
xorps  %xmm1,%xmm1
movsd  %xmm1,(%rsp)
xorps  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
jmp    11eb <main+0xbb>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm0
ucomisd 0xe27(%rip),%xmm0
movsd  0x20(%rsp),%xmm2
movsd  0xe21(%rip),%xmm3
jne    11eb <main+0xbb>
jnp    125c <main+0x12c>
addsd  %xmm3,%xmm2
ucomisd 0xe19(%rip),%xmm0
movsd  %xmm2,0x20(%rsp)
jne    1201 <main+0xd1>
jnp    11b0 <main+0x80>
ucomisd 0xe0f(%rip),%xmm0
jne    121d <main+0xed>
jp     121d <main+0xed>
movsd  (%rsp),%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,(%rsp)
jmp    11c0 <main+0x90>
ucomisd 0xe03(%rip),%xmm0
jne    11c0 <main+0x90>
jp     11c0 <main+0x90>
movsd  0x10(%rsp),%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,0x10(%rsp)
jmp    11c0 <main+0x90>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%esi
movsd  (%rsp),%xmm3
cvttsd2si %xmm3,%edx
movsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%ecx
addsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
subsd  %xmm1,%xmm2
cvttsd2si %xmm2,%r8d
lea    0xd9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
lea    0xd9e(%rip),%rax
lea    0xd9a(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
movsd  0xd58(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
mulsd  %xmm2,%xmm0
movsd  0x20(%rsp),%xmm3
divsd  %xmm3,%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
lea    0xd51(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [13 x i8] c"%d\0A%d\0A%d\0A%d\0A\00"
@.str.2 = [4 x i8] c"93\0A\00"
@.str.3 = [4 x i8] c"83\0A\00"
@.str.4 = [13 x i8] c"%.2lf\0A%.2lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double -9.900000e+01, double* %6
store double 0.000000e+00, double* %7
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
br label %12
12: ; preds = %40, %2
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%14 = load double, double* %6
%15 = fcmp une double %14, -1.000000e+00
br i1 %15, label %16, label %39
16: ; preds = %12
%17 = load double, double* %7
%18 = fadd double %17, 1.000000e+00
store double %18, double* %7
%19 = load double, double* %6
%20 = fcmp oeq double %19, 8.300000e+01
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load double, double* %8
%23 = fadd double %22, 1.000000e+00
store double %23, double* %8
br label %38
24: ; preds = %16
%25 = load double, double* %6
%26 = fcmp oeq double %25, 9.300000e+01
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load double, double* %9
%29 = fadd double %28, 1.000000e+00
store double %29, double* %9
br label %37
30: ; preds = %24
%31 = load double, double* %6
%32 = fcmp oeq double %31, 0.000000e+00
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load double, double* %10
%35 = fadd double %34, 1.000000e+00
store double %35, double* %10
br label %36
36: ; preds = %33, %30
br label %37
37: ; preds = %36, %27
br label %38
38: ; preds = %37, %21
br label %39
39: ; preds = %38, %12
br label %40
40: ; preds = %39
%41 = load double, double* %6
%42 = fcmp une double %41, -1.000000e+00
br i1 %42, label %12, label %43
43: ; preds = %40
%44 = load double, double* %8
%45 = fptosi double %44 to i32
%46 = load double, double* %9
%47 = fptosi double %46 to i32
%48 = load double, double* %10
%49 = fptosi double %48 to i32
%50 = load double, double* %7
%51 = load double, double* %8
%52 = load double, double* %9
%53 = fadd double %51, %52
%54 = load double, double* %10
%55 = fadd double %53, %54
%56 = fsub double %50, %55
%57 = fptosi double %56 to i32
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %45, i32 %47, i32 %49, i32 %57)
%59 = load double, double* %9
%60 = load double, double* %8
%61 = fcmp oge double %59, %60
br i1 %61, label %62, label %64
62: ; preds = %43
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %66
64: ; preds = %43
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %66
66: ; preds = %64, %62
%67 = phi i32 [ %63, %62 ], [ %65, %64 ]
%68 = load double, double* %8
%69 = fmul double %68, 1.000000e+02
%70 = load double, double* %8
%71 = load double, double* %9
%72 = fadd double %70, %71
%73 = load double, double* %10
%74 = fadd double %72, %73
%75 = fdiv double %69, %74
%76 = load double, double* %9
%77 = fmul double %76, 1.000000e+02
%78 = load double, double* %8
%79 = load double, double* %9
%80 = fadd double %78, %79
%81 = load double, double* %10
%82 = fadd double %80, %81
%83 = fdiv double %77, %82
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %75, double %83)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [13 x i8] c"%d\0A%d\0A%d\0A%d\0A\00"
@.str.4 = [13 x i8] c"%.2lf\0A%.2lf\0A\00"
@str = [3 x i8] c"83\00"
@str.5 = [3 x i8] c"93\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double -9.900000e+01, double* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = fcmp une double %6, -1.000000e+00
br i1 %7, label %8, label %33
8: ; preds = %2, %26
%9 = phi double [ %31, %26 ], [ %6, %2 ]
%10 = phi double [ %14, %26 ], [ 0.000000e+00, %2 ]
%11 = phi double [ %29, %26 ], [ 0.000000e+00, %2 ]
%12 = phi double [ %28, %26 ], [ 0.000000e+00, %2 ]
%13 = phi double [ %27, %26 ], [ 0.000000e+00, %2 ]
%14 = fadd double %10, 1.000000e+00
%15 = fcmp oeq double %9, 8.300000e+01
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = fadd double %13, 1.000000e+00
br label %26
18: ; preds = %8
%19 = fcmp oeq double %9, 9.300000e+01
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = fadd double %12, 1.000000e+00
br label %26
22: ; preds = %18
%23 = fcmp oeq double %9, 0.000000e+00
br i1 %23, label %24, label %26
24: ; preds = %22
%25 = fadd double %11, 1.000000e+00
br label %26
26: ; preds = %20, %24, %22, %16
%27 = phi double [ %17, %16 ], [ %13, %20 ], [ %13, %24 ], [ %13, %22 ]
%28 = phi double [ %12, %16 ], [ %21, %20 ], [ %12, %24 ], [ %12, %22 ]
%29 = phi double [ %11, %16 ], [ %11, %20 ], [ %25, %24 ], [ %11, %22 ]
%30 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%31 = load double, double* %3
%32 = fcmp une double %31, -1.000000e+00
br i1 %32, label %8, label %33
33: ; preds = %26, %2
%34 = phi double [ 0.000000e+00, %2 ], [ %27, %26 ]
%35 = phi double [ 0.000000e+00, %2 ], [ %28, %26 ]
%36 = phi double [ 0.000000e+00, %2 ], [ %29, %26 ]
%37 = phi double [ 0.000000e+00, %2 ], [ %14, %26 ]
%38 = fptosi double %34 to i32
%39 = fptosi double %35 to i32
%40 = fptosi double %36 to i32
%41 = fadd double %34, %35
%42 = fadd double %41, %36
%43 = fsub double %37, %42
%44 = fptosi double %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %39, i32 %40, i32 %44)
%46 = fcmp ult double %35, %34
%47 = select i1 %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0)
%48 = call i32 @puts(i8* dereferenceable(1) %47)
%49 = fmul double %34, 1.000000e+02
%50 = fdiv double %49, %42
%51 = fmul double %35, 1.000000e+02
%52 = fdiv double %51, %42
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %50, double %52)
ret i32 0
}