#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 EOF;
float *calloc(int, int);
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
float *BITE() {
  float *BRAIN = calloc(sizeof(float), 1 << 17);
  int TOE = getc(stdin), EYE, SKULL = 0;
  while ((EYE = getc(stdin)) != EOF) {
    ++BRAIN[(TOE << 8) + EYE];
    ++SKULL;
    TOE = EYE;
  }
  if (SKULL)
    for (TOE = 0; TOE < 8 << 13; ++TOE)
      BRAIN[TOE] /= SKULL;
  return BRAIN;
}


x86 assembly (clang, -O0):
<BITE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
mov    $0x20000,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%eax
je     11a9 <BITE+0x89>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movss  0xe75(%rip),%xmm0
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <BITE+0x33>
cmpl   $0x0,-0x14(%rbp)
je     11f5 <BITE+0xd5>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10000,-0xc(%rbp)
jge    11f0 <BITE+0xd0>
cvtsi2ssl -0x14(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ba <BITE+0x9a>
jmp    11f5 <BITE+0xd5>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BITE>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x4,%edi
mov    $0x20000,%esi
call   1030 <calloc@plt>
mov    %rax,%r12
mov    0x2ea4(%rip),%r14
mov    (%r14),%edi
call   1040 <getc@plt>
mov    %eax,%ebp
mov    (%r14),%edi
call   1040 <getc@plt>
mov    0x2e83(%rip),%r15
cmp    (%r15),%eax
je     11d8 <BITE+0xb8>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%r13d
shl    $0x8,%ebp
add    %eax,%ebp
movslq %ebp,%rax
movss  (%r12,%rax,4),%xmm0
addss  0xe77(%rip),%xmm0
movss  %xmm0,(%r12,%rax,4)
add    $0x1,%ebx
mov    (%r14),%edi
call   1040 <getc@plt>
mov    %r13d,%ebp
cmp    (%r15),%eax
jne    1170 <BITE+0x50>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
shufps $0x0,%xmm0,%xmm0
xor    %eax,%eax
nop
movups (%r12,%rax,4),%xmm1
movups 0x10(%r12,%rax,4),%xmm2
divps  %xmm0,%xmm1
movups %xmm1,(%r12,%rax,4)
divps  %xmm0,%xmm2
movups %xmm2,0x10(%r12,%rax,4)
add    $0x8,%rax
cmp    $0x10000,%rax
jne    11b0 <BITE+0x90>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define float* @BITE() {
%1 = alloca float*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call float* @calloc(i32 4, i32 131072)
store float* %5, float** %1
%6 = load i32, i32* @stdin
%7 = call i32 @getc(i32 %6)
store i32 %7, i32* %2
store i32 0, i32* %4
br label %8
8: ; preds = %13, %0
%9 = load i32, i32* @stdin
%10 = call i32 @getc(i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %8
%14 = load float*, float** %1
%15 = load i32, i32* %2
%16 = shl i32 %15, 8
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %14, i64 %19
%21 = load float, float* %20
%22 = fadd float %21, 1.000000e+00
store float %22, float* %20
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
%25 = load i32, i32* %3
store i32 %25, i32* %2
br label %8
26: ; preds = %8
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %46
29: ; preds = %26
store i32 0, i32* %2
br label %30
30: ; preds = %42, %29
%31 = load i32, i32* %2
%32 = icmp slt i32 %31, 65536
br i1 %32, label %33, label %45
33: ; preds = %30
%34 = load i32, i32* %4
%35 = sitofp i32 %34 to float
%36 = load float*, float** %1
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds float, float* %36, i64 %38
%40 = load float, float* %39
%41 = fdiv float %40, %35
store float %41, float* %39
br label %42
42: ; preds = %33
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %30
45: ; preds = %30
br label %46
46: ; preds = %45, %26
%47 = load float*, float** %1
ret float* %47
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define noalias float* @BITE() {
%1 = tail call float* @calloc(i32 4, i32 131072)
%2 = load i32, i32* @stdin
%3 = tail call i32 @getc(i32 %2)
%4 = load i32, i32* @stdin
%5 = tail call i32 @getc(i32 %4)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %42, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %20, %8 ], [ %5, %0 ]
%10 = phi i32 [ %18, %8 ], [ 0, %0 ]
%11 = phi i32 [ %9, %8 ], [ %3, %0 ]
%12 = shl i32 %11, 8
%13 = add nsw i32 %9, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds float, float* %1, i64 %14
%16 = load float, float* %15
%17 = fadd float %16, 1.000000e+00
store float %17, float* %15
%18 = add nuw nsw i32 %10, 1
%19 = load i32, i32* @stdin
%20 = tail call i32 @getc(i32 %19)
%21 = load i32, i32* @EOF
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %8
23: ; preds = %8
%24 = sitofp i32 %18 to float
%25 = insertelement <4 x float> poison, float %24, i64 0
%26 = shufflevector <4 x float> %25, <4 x float> poison, <4 x i32> zeroinitializer
br label %27
27: ; preds = %27, %23
%28 = phi i64 [ 0, %23 ], [ %40, %27 ]
%29 = getelementptr inbounds float, float* %1, i64 %28
%30 = bitcast float* %29 to <4 x float>*
%31 = load <4 x float>, <4 x float>* %30
%32 = fdiv <4 x float> %31, %26
%33 = bitcast float* %29 to <4 x float>*
store <4 x float> %32, <4 x float>* %33
%34 = or i64 %28, 4
%35 = getelementptr inbounds float, float* %1, i64 %34
%36 = bitcast float* %35 to <4 x float>*
%37 = load <4 x float>, <4 x float>* %36
%38 = fdiv <4 x float> %37, %26
%39 = bitcast float* %35 to <4 x float>*
store <4 x float> %38, <4 x float>* %39
%40 = add nuw nsw i64 %28, 8
%41 = icmp eq i64 %40, 65536
br i1 %41, label %42, label %27
42: ; preds = %27, %0
ret float* %1
}