// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/rle.c
// Function: rle_find_syms
static void rle_find_syms(uint8_t *data, uint64_t data_len,
                          int64_t *saved, // dim >= 256 
                          uint8_t *rle_syms, int *rle_nsyms) {
    int last = -1, n;
    uint64_t i;

    if (data_len > 256) {
        // 186/450
        // Interleaved buffers to avoid cache collisions
        int64_t saved2[256+MAGIC] = {0};
        int64_t saved3[256+MAGIC] = {0};
        int64_t saved4[256+MAGIC] = {0};
        int64_t len4 = data_len&~3;
        for (i = 0; i < len4; i+=4) {
            int d1 = (data[i+0] == last)     <<1;
            int d2 = (data[i+1] == data[i+0])<<1;
            int d3 = (data[i+2] == data[i+1])<<1;
            int d4 = (data[i+3] == data[i+2])<<1;
            last = data[i+3];
            saved [data[i+0]] += d1-1;
            saved2[data[i+1]] += d2-1;
            saved3[data[i+2]] += d3-1;
            saved4[data[i+3]] += d4-1;
        }
        while (i < data_len) {
            int d = (data[i] == last)<<1;
            saved[data[i]] += d - 1;
            last = data[i];
            i++;
        }
        for (i = 0; i < 256; i++)
            saved[i] += saved2[i] + saved3[i] + saved4[i];
    } else {
        // 163/391
        for (i = 0; i < data_len; i++) {
            if (data[i] == last) {
                saved[data[i]]++;
            } else {
                saved[data[i]]--;
                last = data[i];
            }
        }
    }

    // Map back to a list
    for (i = n = 0; i < 256; i++) {
        if (saved[i] > 0)
            rle_syms[n++] = i;
    }
    *rle_nsyms = n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1920, %rsp           # imm = 0x1920
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
cmpq $0x100, -0x10(%rbp)     # imm = 0x100
jbe 0xc7ef9
leaq -0x880(%rbp), %rdi
xorl %esi, %esi
movl $0x840, %edx            # imm = 0x840
callq 0x4250
leaq -0x10c0(%rbp), %rdi
xorl %esi, %esi
movl $0x840, %edx            # imm = 0x840
callq 0x4250
leaq -0x1900(%rbp), %rdi
xorl %esi, %esi
movl $0x840, %edx            # imm = 0x840
callq 0x4250
movq -0x10(%rbp), %rax
andq $-0x4, %rax
movq %rax, -0x1908(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x1908(%rbp), %rax
jae 0xc7e37
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl -0x2c(%rbp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
shll %eax
movl %eax, -0x190c(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
shll %eax
movl %eax, -0x1910(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl 0x2(%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rdx
movzbl 0x1(%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
shll %eax
movl %eax, -0x1914(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl 0x3(%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rdx
movzbl 0x2(%rcx,%rdx), %ecx
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
shll %eax
movl %eax, -0x1918(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl 0x3(%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movl -0x190c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rsi
movzbl (%rcx,%rsi), %ecx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x1910(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rdx
movzbl 0x1(%rax,%rdx), %eax
addq -0x880(%rbp,%rax,8), %rcx
movq %rcx, -0x880(%rbp,%rax,8)
movl -0x1914(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rdx
movzbl 0x2(%rax,%rdx), %eax
addq -0x10c0(%rbp,%rax,8), %rcx
movq %rcx, -0x10c0(%rbp,%rax,8)
movl -0x1918(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rdx
movzbl 0x3(%rax,%rdx), %eax
addq -0x1900(%rbp,%rax,8), %rcx
movq %rcx, -0x1900(%rbp,%rax,8)
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
jmp 0xc7cc4
jmp 0xc7e39
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0xc7ea3
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl -0x2c(%rbp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
shll %eax
movl %eax, -0x191c(%rbp)
movl -0x191c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rsi
movzbl (%rcx,%rsi), %ecx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xc7e39
movq $0x0, -0x38(%rbp)
cmpq $0x100, -0x38(%rbp)     # imm = 0x100
jae 0xc7ef7
movq -0x38(%rbp), %rax
movq -0x880(%rbp,%rax,8), %rdx
movq -0x38(%rbp), %rax
addq -0x10c0(%rbp,%rax,8), %rdx
movq -0x38(%rbp), %rax
addq -0x1900(%rbp,%rax,8), %rdx
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
addq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xc7eab
jmp 0xc7f77
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0xc7f75
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl -0x2c(%rbp), %eax
jne 0xc7f3a
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0xc7f65
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movq (%rax,%rcx,8), %rdx
addq $-0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
jmp 0xc7f67
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xc7f01
jmp 0xc7f77
movl $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x100, -0x38(%rbp)     # imm = 0x100
jae 0xc7fca
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jle 0xc7fba
movq -0x38(%rbp), %rax
movb %al, %dl
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0xc7fbc
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xc7f86
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
addq $0x1920, %rsp           # imm = 0x1920
popq %rbp
retq
nopl (%rax)