// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/utils.h
// Function: hist1_4
static inline
int hist1_4(unsigned char *in, unsigned int in_size,
            uint32_t F0[256][256], uint32_t *T0) {
    unsigned char l = 0, c;
    unsigned char *in_end = in + in_size;

    unsigned char cc[5] = {0};
    if (in_size > 500000) {
        uint32_t (*F1)[259] = htscodecs_tls_calloc(256, sizeof(*F1));
        if (F1 == NULL)
            return -1;
        while (in < in_end-8) {
            memcpy(cc, in, 4); in += 4;
            F0[cc[4]][cc[0]]++;
            F1[cc[0]][cc[1]]++;
            F0[cc[1]][cc[2]]++;
            F1[cc[2]][cc[3]]++;
            cc[4] = cc[3];

            memcpy(cc, in, 4); in += 4;
            F0[cc[4]][cc[0]]++;
            F1[cc[0]][cc[1]]++;
            F0[cc[1]][cc[2]]++;
            F1[cc[2]][cc[3]]++;
            cc[4] = cc[3];
        }
        l = cc[3];

        while (in < in_end) {
            F0[l][c = *in++]++;
            l = c;
        }
        T0[l]++;

        int i, j;
        for (i = 0; i < 256; i++) {
            int tt = 0;
            for (j = 0; j < 256; j++) {
                F0[i][j] += F1[i][j];
                tt += F0[i][j];
            }
            T0[i]+=tt;
        }
        htscodecs_tls_free(F1);
    } else {
        while (in < in_end-8) {
            memcpy(cc, in, 4); in += 4;
            F0[cc[4]][cc[0]]++;
            F0[cc[0]][cc[1]]++;
            F0[cc[1]][cc[2]]++;
            F0[cc[2]][cc[3]]++;
            cc[4] = cc[3];

            memcpy(cc, in, 4); in += 4;
            F0[cc[4]][cc[0]]++;
            F0[cc[0]][cc[1]]++;
            F0[cc[1]][cc[2]]++;
            F0[cc[2]][cc[3]]++;
            cc[4] = cc[3];
        }
        l = cc[3];

        while (in < in_end) {
            F0[l][c = *in++]++;
            l = c;
        }
        T0[l]++;

        int i, j;
        for (i = 0; i < 256; i++) {
            int tt = 0;
            for (j = 0; j < 256; j++)
                tt += F0[i][j];
            T0[i]+=tt;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
leaq -0x3d(%rbp), %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0x4250
cmpl $0x7a120, -0x14(%rbp)   # imm = 0x7A120
jbe 0x93b83
movl $0x100, %edi            # imm = 0x100
movl $0x40c, %esi            # imm = 0x40C
callq 0xce8a0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x9393c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x93d80
jmp 0x9393e
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
jae 0x93a7a
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3d(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x39(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3d(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movzbl -0x3d(%rbp), %ecx
imulq $0x40c, %rcx, %rcx      # imm = 0x40C
addq %rcx, %rax
movzbl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3c(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3b(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movzbl -0x3b(%rbp), %ecx
imulq $0x40c, %rcx, %rcx      # imm = 0x40C
addq %rcx, %rax
movzbl -0x3a(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3d(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x39(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3d(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movzbl -0x3d(%rbp), %ecx
imulq $0x40c, %rcx, %rcx      # imm = 0x40C
addq %rcx, %rax
movzbl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3c(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3b(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movzbl -0x3b(%rbp), %ecx
imulq $0x40c, %rcx, %rcx      # imm = 0x40C
addq %rcx, %rax
movzbl -0x3a(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
jmp 0x9393e
movb -0x3a(%rbp), %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x93ac1
movq -0x20(%rbp), %rax
movzbl -0x29(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb (%rcx), %cl
movb %cl, -0x2a(%rbp)
movzbl %cl, %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movb -0x2a(%rbp), %al
movb %al, -0x29(%rbp)
jmp 0x93a80
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x4c(%rbp)
cmpl $0x100, -0x4c(%rbp)     # imm = 0x100
jge 0x93b75
movl $0x0, -0x54(%rbp)
movl $0x0, -0x50(%rbp)
cmpl $0x100, -0x50(%rbp)     # imm = 0x100
jge 0x93b56
movq -0x48(%rbp), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x40c, %rcx, %rcx      # imm = 0x40C
addq %rcx, %rax
movslq -0x50(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x50(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movslq -0x4c(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x93af4
movl -0x54(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x4c(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x93ad9
movq -0x48(%rbp), %rdi
callq 0xce8f0
jmp 0x93d79
jmp 0x93b85
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
jae 0x93cb5
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3d(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x39(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3d(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3d(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3c(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3b(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3b(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3a(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3d(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x39(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3d(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3d(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3c(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3c(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3b(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movzbl -0x3b(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movzbl -0x3a(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
jmp 0x93b85
movb -0x3a(%rbp), %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x93cfc
movq -0x20(%rbp), %rax
movzbl -0x29(%rbp), %ecx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb (%rcx), %cl
movb %cl, -0x2a(%rbp)
movzbl %cl, %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movb -0x2a(%rbp), %al
movb %al, -0x29(%rbp)
jmp 0x93cbb
movq -0x28(%rbp), %rax
movzbl -0x29(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x58(%rbp)
cmpl $0x100, -0x58(%rbp)     # imm = 0x100
jge 0x93d77
movl $0x0, -0x60(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x100, -0x5c(%rbp)     # imm = 0x100
jge 0x93d5b
movq -0x20(%rbp), %rax
movslq -0x58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x5c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x93d2b
movl -0x60(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x58(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x93d14
jmp 0x93d79
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)