// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/utils.h
// Function: hist8e
static inline
double hist8e(unsigned char *in, unsigned int in_size, uint32_t F0[256]) {
    uint32_t F1[256+MAGIC] = {0}, F2[256+MAGIC] = {0}, F3[256+MAGIC] = {0};
    uint32_t F4[256+MAGIC] = {0}, F5[256+MAGIC] = {0}, F6[256+MAGIC] = {0};
    uint32_t F7[256+MAGIC] = {0};

#ifdef __GNUC__
    double e = 0, in_size_r2 = log(1.0/in_size)/log(2);
#else
    double e = 0, in_size_r2 = log(1.0/in_size);
#endif

    unsigned int i, i8 = in_size & ~7;
    for (i = 0; i < i8; i+=8) {
        F0[in[i+0]]++;
        F1[in[i+1]]++;
        F2[in[i+2]]++;
        F3[in[i+3]]++;
        F4[in[i+4]]++;
        F5[in[i+5]]++;
        F6[in[i+6]]++;
        F7[in[i+7]]++;
    }
    while (i < in_size)
        F0[in[i++]]++;

    for (i = 0; i < 256; i++) {
        F0[i] += F1[i] + F2[i] + F3[i] + F4[i] + F5[i] + F6[i] + F7[i];
#ifdef __GNUC__
        e -= F0[i] * (32 - __builtin_clz(F0[i]|1) + in_size_r2);
#else
        e -= F0[i] * (fast_log(F0[i]) + in_size_r2);
#endif
    }

#ifndef __GNUC__
    e /= log(2);
#endif
    return e/in_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d40, %rsp           # imm = 0x1D40
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x440(%rbp), %rdi
xorl %esi, %esi
movl %esi, -0x1d2c(%rbp)
movl $0x420, %edx            # imm = 0x420
movq %rdx, -0x1d28(%rbp)
callq 0x4250
movl -0x1d2c(%rbp), %esi
movq -0x1d28(%rbp), %rdx
leaq -0x860(%rbp), %rdi
callq 0x4250
movl -0x1d2c(%rbp), %esi
movq -0x1d28(%rbp), %rdx
leaq -0xc80(%rbp), %rdi
callq 0x4250
movl -0x1d2c(%rbp), %esi
movq -0x1d28(%rbp), %rdx
leaq -0x10a0(%rbp), %rdi
callq 0x4250
movl -0x1d2c(%rbp), %esi
movq -0x1d28(%rbp), %rdx
leaq -0x14c0(%rbp), %rdi
callq 0x4250
movl -0x1d2c(%rbp), %esi
movq -0x1d28(%rbp), %rdx
leaq -0x18e0(%rbp), %rdi
callq 0x4250
movl -0x1d2c(%rbp), %esi
movq -0x1d28(%rbp), %rdx
leaq -0x1d00(%rbp), %rdi
callq 0x4250
movq $0x0, -0x1d08(%rbp)
movl -0xc(%rbp), %eax
cvtsi2sd %rax, %xmm1
movsd 0x2ddc1(%rip), %xmm0    # 0xed008
divsd %xmm1, %xmm0
callq 0x4380
movsd %xmm0, -0x1d20(%rbp)
movsd 0x362f0(%rip), %xmm0    # 0xf5550
callq 0x4380
movaps %xmm0, %xmm1
movsd -0x1d20(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x1d10(%rbp)
movl -0xc(%rbp), %eax
andl $-0x8, %eax
movl %eax, -0x1d18(%rbp)
movl $0x0, -0x1d14(%rbp)
movl -0x1d14(%rbp), %eax
cmpl -0x1d18(%rbp), %eax
jae 0xbf3d4
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x1d14(%rbp), %edx
addl $0x0, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl -0x1d14(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x440(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x440(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x1d14(%rbp), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x860(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x860(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x1d14(%rbp), %ecx
addl $0x3, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0xc80(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0xc80(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x1d14(%rbp), %ecx
addl $0x4, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x10a0(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x10a0(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x1d14(%rbp), %ecx
addl $0x5, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x14c0(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x14c0(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x1d14(%rbp), %ecx
addl $0x6, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x18e0(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x18e0(%rbp,%rax,4)
movq -0x8(%rbp), %rax
movl -0x1d14(%rbp), %ecx
addl $0x7, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x1d00(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x1d00(%rbp,%rax,4)
movl -0x1d14(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x1d14(%rbp)
jmp 0xbf292
jmp 0xbf3d6
movl -0x1d14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0xbf40b
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x1d14(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x1d14(%rbp)
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0xbf3d6
movl $0x0, -0x1d14(%rbp)
cmpl $0x100, -0x1d14(%rbp)   # imm = 0x100
jae 0xbf4fb
movl -0x1d14(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x1d38(%rbp)
movl -0x440(%rbp,%rcx,4), %esi
movl -0x860(%rbp,%rcx,4), %eax
addl %eax, %esi
movl -0xc80(%rbp,%rcx,4), %eax
addl %eax, %esi
movl -0x10a0(%rbp,%rcx,4), %eax
addl %eax, %esi
movl -0x14c0(%rbp,%rcx,4), %eax
addl %eax, %esi
movl -0x18e0(%rbp,%rcx,4), %eax
addl %eax, %esi
movl -0x1d00(%rbp,%rcx,4), %eax
addl %eax, %esi
movq -0x18(%rbp), %rax
movl (%rax,%rcx,4), %edx
addl %esi, %edx
movl %edx, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
movl -0x1d14(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cvtsi2sd %rax, %xmm0
movq -0x18(%rbp), %rax
movl -0x1d14(%rbp), %ecx
movl (%rax,%rcx,4), %eax
orl $0x1, %eax
bsrl %eax, %ecx
xorl $0x1f, %ecx
movl $0x20, %eax
subl %ecx, %eax
cvtsi2sd %eax, %xmm2
addsd -0x1d10(%rbp), %xmm2
movsd -0x1d08(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x1d08(%rbp)
movl -0x1d14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d14(%rbp)
jmp 0xbf415
movsd -0x1d08(%rbp), %xmm0
movl -0xc(%rbp), %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
addq $0x1d40, %rsp           # imm = 0x1D40
popq %rbp
retq
nopl (%rax,%rax)