// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/utils.h
// Function: hist8
static inline
int hist8(unsigned char *in, unsigned int in_size, uint32_t F0[256]) {
    if (in_size > 500000) {
        uint32_t *f0 = htscodecs_tls_calloc((65536+37)*3, sizeof(*f0));
        if (f0 == NULL)
            return -1;
        uint32_t *f1 = f0 + 65536+37;
        uint32_t *f2 = f1 + 65536+37;

        uint32_t i, i8 = in_size & ~15;

        for (i = 0; i < i8; i+=16) {
            uint16_t i16a[4], i16b[4];
            memcpy(i16a, in+i, 8);
            f0[i16a[0]]++;
            f1[i16a[1]]++;
            f2[i16a[2]]++;
            f0[i16a[3]]++;

            memcpy(i16b, in+i+8, 8);
            f1[i16b[0]]++;
            f0[i16b[1]]++;
            f1[i16b[2]]++;
            f2[i16b[3]]++;
        }

        while (i < in_size)
            F0[in[i++]]++;

        for (i = 0; i < 65536; i++) {
            F0[i & 0xff] += f0[i] + f1[i] + f2[i];
            F0[i >> 8  ] += f0[i] + f1[i] + f2[i];
        }
        htscodecs_tls_free(f0);
    } else {
        uint32_t F1[256+MAGIC] = {0}, F2[256+MAGIC] = {0}, F3[256+MAGIC] = {0};
        uint32_t 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]]++;
            F0[in[i+4]]++;
            F1[in[i+5]]++;
            F2[in[i+6]]++;
            F3[in[i+7]]++;
        }

        while (i < in_size)
            F0[in[i++]]++;

        for (i = 0; i < 256; i++)
            F0[i] += F1[i] + F2[i] + F3[i];
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xcc0, %rsp            # imm = 0xCC0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x7a120, -0x14(%rbp)   # imm = 0x7A120
jbe 0x8eb9c
movl $0x3006f, %edi          # imm = 0x3006F
movl $0x4, %esi
callq 0xce8a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x8e9e9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8edc7
movq -0x28(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
addq $0x94, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x40000, %rax          # imm = 0x40000
addq $0x94, %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
andl $-0x10, %eax
movl %eax, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jae 0x8eae2
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movq (%rax,%rcx), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movzwl -0x48(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
movzwl -0x46(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
movzwl -0x44(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movzwl -0x42(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movl -0x3c(%rbp), %ecx
movq 0x8(%rax,%rcx), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movzwl -0x50(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movzwl -0x4e(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
movzwl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rbp), %rax
movzwl -0x4a(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x3c(%rbp)
jmp 0x8ea21
jmp 0x8eae4
movl -0x3c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x8eb10
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x3c(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x3c(%rbp)
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x8eae4
movl $0x0, -0x3c(%rbp)
cmpl $0x10000, -0x3c(%rbp)   # imm = 0x10000
jae 0x8eb8e
movq -0x28(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movl -0x3c(%rbp), %ecx
andl $0xff, %ecx
movl %ecx, %ecx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movq -0x38(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movl -0x3c(%rbp), %ecx
shrl $0x8, %ecx
movl %ecx, %ecx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x8eb17
movq -0x28(%rbp), %rdi
callq 0xce8f0
jmp 0x8edc0
leaq -0x470(%rbp), %rdi
xorl %esi, %esi
movl $0x420, %edx            # imm = 0x420
callq 0x4250
leaq -0x890(%rbp), %rdi
xorl %esi, %esi
movl $0x420, %edx            # imm = 0x420
callq 0x4250
leaq -0xcb0(%rbp), %rdi
xorl %esi, %esi
movl $0x420, %edx            # imm = 0x420
callq 0x4250
movl -0x14(%rbp), %eax
andl $-0x8, %eax
movl %eax, -0xcb8(%rbp)
movl $0x0, -0xcb4(%rbp)
movl -0xcb4(%rbp), %eax
cmpl -0xcb8(%rbp), %eax
jae 0x8ed29
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0xcb4(%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 -0x10(%rbp), %rax
movl -0xcb4(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x470(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x470(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl -0xcb4(%rbp), %ecx
addl $0x2, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x890(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x890(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl -0xcb4(%rbp), %ecx
addl $0x3, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0xcb0(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0xcb0(%rbp,%rax,4)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0xcb4(%rbp), %edx
addl $0x4, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movl -0xcb4(%rbp), %ecx
addl $0x5, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x470(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x470(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl -0xcb4(%rbp), %ecx
addl $0x6, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0x890(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x890(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl -0xcb4(%rbp), %ecx
addl $0x7, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl -0xcb0(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0xcb0(%rbp,%rax,4)
movl -0xcb4(%rbp), %eax
addl $0x8, %eax
movl %eax, -0xcb4(%rbp)
jmp 0x8ebeb
jmp 0x8ed2b
movl -0xcb4(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x8ed60
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0xcb4(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0xcb4(%rbp)
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x8ed2b
movl $0x0, -0xcb4(%rbp)
cmpl $0x100, -0xcb4(%rbp)    # imm = 0x100
jae 0x8edbe
movl -0xcb4(%rbp), %eax
movl -0x470(%rbp,%rax,4), %edx
movl -0xcb4(%rbp), %eax
addl -0x890(%rbp,%rax,4), %edx
movl -0xcb4(%rbp), %eax
addl -0xcb0(%rbp,%rax,4), %edx
movq -0x20(%rbp), %rax
movl -0xcb4(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0xcb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcb4(%rbp)
jmp 0x8ed6a
jmp 0x8edc0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xcc0, %rsp            # imm = 0xCC0
popq %rbp
retq
nopw %cs:(%rax,%rax)