#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() {
  int i, y[3] = {0, 0, 0};
  float x;
  char z[] = "*";
  for (i = 0; i < 10; i++) {
    scanf("%f", &x);
    x = (int)x;
    while (0 == x) {
      y[0]++;
      break;
    }
    while (1 == x) {
      y[1]++;
      break;
    }
    while (2 == x) {
      y[2]++;
      break;
    }
  }
  printf("Interval | Frequency\n");
  printf("---------+----------\n");
  printf("[0, 1)   | ");
  for (i = 1; i <= y[0]; i++) {
    printf("%s", z);
  }
  printf("\n");
  printf("[0, 2)   | ");
  for (i = 1; i <= y[1]; i++) {
    printf("%s", z);
  }
  printf("\n");
  printf("[0, 3)   | ");
  for (i = 1; i <= y[2]; i++) {
    printf("%s", z);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
mov    0xeb2(%rip),%ax
mov    %ax,-0x1a(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1204 <main+0xd4>
lea    0xe98(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
cvttss2si -0x18(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x18(%rbp),%xmm0
jne    11a5 <main+0x75>
jp     11a5 <main+0x75>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11aa <main+0x7a>
movss  0xe4e(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jne    11cb <main+0x9b>
jp     11cb <main+0x9b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11d0 <main+0xa0>
movss  0xe2c(%rip),%xmm0
ucomiss -0x18(%rbp),%xmm0
jne    11f1 <main+0xc1>
jp     11f1 <main+0xc1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11f6 <main+0xc6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x31>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1261 <main+0x131>
lea    -0x1a(%rbp),%rsi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1235 <main+0x105>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     12b0 <main+0x180>
lea    -0x1a(%rbp),%rsi
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1284 <main+0x154>
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     12ff <main+0x1cf>
lea    -0x1a(%rbp),%rsi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d3 <main+0x1a3>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movw   $0x2a,0xe(%rsp)
xor    %ebp,%ebp
mov    $0xa,%r13d
xor    %ebx,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15d,0x14(%rsp)
mov    %ebx,%r12d
mov    %ebp,%r14d
lea    0xe7e(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1060 <scanf@plt>
movss  0x10(%rsp),%xmm0
cvttss2si %xmm0,%eax
cmp    $0x1,%eax
adc    $0x0,%r15d
xor    %ebx,%ebx
cmp    $0x1,%eax
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
sete   %bl
add    %r12d,%ebx
xor    %ebp,%ebp
cmp    $0x2,%eax
sete   %bpl
add    %r14d,%ebp
add    $0xffffffff,%r13d
jne    1170 <main+0x30>
mov    %eax,%r13d
lea    0xe59(%rip),%rdi
call   1040 <puts@plt>
lea    0xe62(%rip),%rdi
call   1040 <puts@plt>
lea    0xe1a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15d,%r15d
mov    0x14(%rsp),%r15d
je     1229 <main+0xe9>
cmp    $0x1,%r13d
adc    $0x0,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xdf8(%rip),%rdi
lea    0xe(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%r15d
jne    1210 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdd8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
je     1273 <main+0x133>
xor    %eax,%eax
cmp    $0x1,%r13d
sete   %al
add    %eax,%r12d
lea    0xdb7(%rip),%rbx
lea    0xe(%rsp),%r15
nopl   (%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%r12d
jne    1260 <main+0x120>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd9a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
je     12c2 <main+0x182>
mov    %r14d,%ebx
xor    %eax,%eax
cmp    $0x2,%r13d
sete   %al
add    %eax,%ebx
lea    0xd6b(%rip),%r14
lea    0xe(%rsp),%rbp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%ebx
jne    12b0 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.z = [2 x i8] c"*\00"
@.str = [3 x i8] c"%f\00"
@.str.1 = [22 x i8] c"Interval | Frequency\0A\00"
@.str.2 = [22 x i8] c"---------+----------\0A\00"
@.str.3 = [12 x i8] c"[0, 1) | \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [12 x i8] c"[0, 2) | \00"
@.str.7 = [12 x i8] c"[0, 3) | \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = alloca float
%5 = alloca [2 x i8]
store i32 0, i32* %1
%6 = bitcast [3 x i32]* %3 to i8*
%7 = bitcast [2 x i8]* %5 to i8*
store i32 0, i32* %2
br label %8
8: ; preds = %40, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %43
11: ; preds = %8
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%13 = load float, float* %4
%14 = fptosi float %13 to i32
%15 = sitofp i32 %14 to float
store float %15, float* %4
br label %16
16: ; preds = %11
%17 = load float, float* %4
%18 = fcmp oeq float 0.000000e+00, %17
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
br label %23
23: ; preds = %19, %16
br label %24
24: ; preds = %23
%25 = load float, float* %4
%26 = fcmp oeq float 1.000000e+00, %25
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
store i32 %30, i32* %28
br label %31
31: ; preds = %27, %24
br label %32
32: ; preds = %31
%33 = load float, float* %4
%34 = fcmp oeq float 2.000000e+00, %33
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%37 = load i32, i32* %36
%38 = add nsw i32 %37, 1
store i32 %38, i32* %36
br label %39
39: ; preds = %35, %32
br label %40
40: ; preds = %39
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %8
43: ; preds = %8
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %47
47: ; preds = %55, %43
%48 = load i32, i32* %2
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%50 = load i32, i32* %49
%51 = icmp sle i32 %48, %50
br i1 %51, label %52, label %58
52: ; preds = %47
%53 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %53)
br label %55
55: ; preds = %52
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %47
58: ; preds = %47
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %2
br label %61
61: ; preds = %69, %58
%62 = load i32, i32* %2
%63 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%64 = load i32, i32* %63
%65 = icmp sle i32 %62, %64
br i1 %65, label %66, label %72
66: ; preds = %61
%67 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %67)
br label %69
69: ; preds = %66
%70 = load i32, i32* %2
%71 = add nsw i32 %70, 1
store i32 %71, i32* %2
br label %61
72: ; preds = %61
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %2
br label %75
75: ; preds = %83, %72
%76 = load i32, i32* %2
%77 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%78 = load i32, i32* %77
%79 = icmp sle i32 %76, %78
br i1 %79, label %80, label %86
80: ; preds = %75
%81 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %81)
br label %83
83: ; preds = %80
%84 = load i32, i32* %2
%85 = add nsw i32 %84, 1
store i32 %85, i32* %2
br label %75
86: ; preds = %75
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.3 = [12 x i8] c"[0, 1) | \00"
@.str.4 = [3 x i8] c"%s\00"
@.str.6 = [12 x i8] c"[0, 2) | \00"
@.str.7 = [12 x i8] c"[0, 3) | \00"
@str = [21 x i8] c"Interval | Frequency\00"
@str.8 = [21 x i8] c"---------+----------\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i16
%3 = bitcast float* %1 to i8*
%4 = bitcast i16* %2 to i8*
store i16 42, i16* %2
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %22, %5 ]
%7 = phi i32 [ 0, %0 ], [ %19, %5 ]
%8 = phi i32 [ 0, %0 ], [ %16, %5 ]
%9 = phi i32 [ 0, %0 ], [ %23, %5 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%11 = load float, float* %1
%12 = fptosi float %11 to i32
%13 = sitofp i32 %12 to float
store float %13, float* %1
%14 = icmp eq i32 %12, 0
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %8, %15
%17 = icmp eq i32 %12, 1
%18 = zext i1 %17 to i32
%19 = add nuw nsw i32 %7, %18
%20 = icmp eq i32 %12, 2
%21 = zext i1 %20 to i32
%22 = add nuw nsw i32 %6, %21
%23 = add nuw nsw i32 %9, 1
%24 = icmp eq i32 %23, 10
br i1 %24, label %25, label %5
25: ; preds = %5
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i32 %16, 0
br i1 %29, label %35, label %30
30: ; preds = %25, %30
%31 = phi i32 [ %33, %30 ], [ 1, %25 ]
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i16* %2)
%33 = add nuw i32 %31, 1
%34 = icmp eq i32 %31, %16
br i1 %34, label %35, label %30
35: ; preds = %30, %25
%36 = call i32 @putchar(i32 10)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp eq i32 %19, 0
br i1 %38, label %44, label %39
39: ; preds = %35, %39
%40 = phi i32 [ %42, %39 ], [ 1, %35 ]
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i16* %2)
%42 = add nuw i32 %40, 1
%43 = icmp eq i32 %40, %19
br i1 %43, label %44, label %39
44: ; preds = %39, %35
%45 = call i32 @putchar(i32 10)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%47 = icmp eq i32 %22, 0
br i1 %47, label %53, label %48
48: ; preds = %44, %48
%49 = phi i32 [ %51, %48 ], [ 1, %44 ]
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i16* %2)
%51 = add nuw i32 %49, 1
%52 = icmp eq i32 %49, %22
br i1 %52, label %53, label %48
53: ; preds = %48, %44
%54 = call i32 @putchar(i32 10)
ret i32 0
}