// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/dict.c
// Function: dictGetStatsHt
size_t _dictGetStatsHt(char *buf, size_t bufsize, dictht *ht, int tableid) {
    unsigned long i, slots = 0, chainlen, maxchainlen = 0;
    unsigned long totchainlen = 0;
    unsigned long clvector[DICT_STATS_VECTLEN];
    size_t l = 0;

    if (ht->used == 0) {
        return snprintf(buf,bufsize,
            "No stats available for empty dictionaries\n");
    }

    /* Compute stats. */
    for (i = 0; i < DICT_STATS_VECTLEN; i++) clvector[i] = 0;
    for (i = 0; i < ht->size; i++) {
        dictEntry *he;

        if (ht->table[i] == NULL) {
            clvector[0]++;
            continue;
        }
        slots++;
        /* For each hash entry on this slot... */
        chainlen = 0;
        he = ht->table[i];
        while(he) {
            chainlen++;
            he = he->next;
        }
        clvector[(chainlen < DICT_STATS_VECTLEN) ? chainlen : (DICT_STATS_VECTLEN-1)]++;
        if (chainlen > maxchainlen) maxchainlen = chainlen;
        totchainlen += chainlen;
    }

    /* Generate human readable stats. */
    l += snprintf(buf+l,bufsize-l,
        "Hash table %d stats (%s):\n"
        " table size: %ld\n"
        " number of elements: %ld\n"
        " different slots: %ld\n"
        " max chain length: %ld\n"
        " avg chain length (counted): %.02f\n"
        " avg chain length (computed): %.02f\n"
        " Chain length distribution:\n",
        tableid, (tableid == 0) ? "main hash table" : "rehashing target",
        ht->size, ht->used, slots, maxchainlen,
        (float)totchainlen/slots, (float)ht->used/slots);

    for (i = 0; i < DICT_STATS_VECTLEN-1; i++) {
        if (clvector[i] == 0) continue;
        if (l >= bufsize) break;
        l += snprintf(buf+l,bufsize-l,
            "   %s%ld: %ld (%.02f%%)\n",
            (i == DICT_STATS_VECTLEN-1)?">= ":"",
            i, clvector[i], ((float)clvector[i]/ht->size)*100);
    }

    /* Unlike snprintf(), teturn the number of characters actually written. */
    if (bufsize) buf[bufsize-1] = '\0';
    return strlen(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x1e8(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2ee29
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x108417(%rip), %rdx    # 0x13722e
movb $0x0, %al
callq 0x26120
cltq
movq %rax, -0x8(%rbp)
jmp 0x2f32a
movq $0x0, -0x30(%rbp)
cmpq $0x32, -0x30(%rbp)
jae 0x2ee56
movq -0x30(%rbp), %rax
movq $0x0, -0x1e0(%rbp,%rax,8)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2ee31
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2ef59
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x2ee99
movq -0x1e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1e0(%rbp)
jmp 0x2ef48
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x1f0(%rbp)
cmpq $0x0, -0x1f0(%rbp)
je 0x2eeed
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x1f0(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x1f0(%rbp)
jmp 0x2eec3
cmpq $0x32, -0x40(%rbp)
jae 0x2ef01
movq -0x40(%rbp), %rax
movq %rax, -0x1f8(%rbp)
jmp 0x2ef0f
movl $0x31, %eax
movq %rax, -0x1f8(%rbp)
jmp 0x2ef0f
movq -0x1f8(%rbp), %rax
movq -0x1e0(%rbp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, -0x1e0(%rbp,%rax,8)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
jbe 0x2ef3c
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2ee5e
movq -0x10(%rbp), %rax
movq -0x1e8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x240(%rbp)
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x238(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x22c(%rbp)
testl %eax, %eax
leaq 0x1083a0(%rip), %rcx    # 0x13732e
leaq 0x1083a9(%rip), %rax    # 0x13733e
cmoveq %rcx, %rax
movq %rax, -0x228(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x220(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x218(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x208(%rbp)
movq -0x50(%rbp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x200(%rbp)
testq %rax, %rax
movss %xmm0, -0x1fc(%rbp)
js 0x2f015
movss -0x200(%rbp), %xmm0
movss %xmm0, -0x1fc(%rbp)
movq -0x210(%rbp), %rax
movss -0x1fc(%rbp), %xmm0
movss %xmm0, -0x24c(%rbp)
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x248(%rbp)
testq %rax, %rax
movss %xmm0, -0x244(%rbp)
js 0x2f06d
movss -0x248(%rbp), %xmm0
movss %xmm0, -0x244(%rbp)
movq -0x218(%rbp), %rax
movss -0x24c(%rbp), %xmm0
movss -0x244(%rbp), %xmm1
movss %xmm1, -0x264(%rbp)
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x260(%rbp)
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x254(%rbp)
testq %rax, %rax
movss %xmm0, -0x250(%rbp)
js 0x2f0dd
movss -0x254(%rbp), %xmm0
movss %xmm0, -0x250(%rbp)
movsd -0x260(%rbp), %xmm0
movq -0x208(%rbp), %rax
movq -0x210(%rbp), %r10
movq -0x218(%rbp), %r11
movq -0x220(%rbp), %r9
movq -0x228(%rbp), %r8
movl -0x22c(%rbp), %ecx
movq -0x238(%rbp), %rsi
movq -0x240(%rbp), %rdi
movss -0x264(%rbp), %xmm2
movss -0x250(%rbp), %xmm1
divss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x10811e(%rip), %rdx    # 0x137259
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x2, %al
callq 0x26120
cltq
addq -0x1e8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x31, -0x30(%rbp)
jae 0x2f306
movq -0x30(%rbp), %rax
cmpq $0x0, -0x1e0(%rbp,%rax,8)
jne 0x2f187
jmp 0x2f2f5
movq -0x1e8(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x2f199
jmp 0x2f306
movq -0x10(%rbp), %rax
movq -0x1e8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x298(%rbp)
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x290(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x288(%rbp)
movq %rax, %rcx
subq $0x31, %rcx
leaq 0x108193(%rip), %rdx    # 0x137368
leaq 0x10c436(%rip), %rcx    # 0x13b612
cmoveq %rdx, %rcx
movq %rcx, -0x280(%rbp)
movq -0x1e0(%rbp,%rax,8), %rax
movq %rax, -0x278(%rbp)
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x26c(%rbp)
testq %rax, %rax
movss %xmm0, -0x268(%rbp)
js 0x2f237
movss -0x26c(%rbp), %xmm0
movss %xmm0, -0x268(%rbp)
movss -0x268(%rbp), %xmm0
movss %xmm0, -0x2a4(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x2a0(%rbp)
testq %rax, %rax
movss %xmm0, -0x29c(%rbp)
js 0x2f290
movss -0x2a0(%rbp), %xmm0
movss %xmm0, -0x29c(%rbp)
movq -0x278(%rbp), %r9
movq -0x288(%rbp), %r8
movq -0x280(%rbp), %rcx
movq -0x290(%rbp), %rsi
movq -0x298(%rbp), %rdi
movss -0x2a4(%rbp), %xmm0
movss -0x29c(%rbp), %xmm1
divss %xmm1, %xmm0
movss 0x107f01(%rip), %xmm1   # 0x1371d0
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x108071(%rip), %rdx    # 0x13734f
movb $0x1, %al
callq 0x26120
cltq
addq -0x1e8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2f168
cmpq $0x0, -0x18(%rbp)
je 0x2f31d
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rdi
callq 0x264f0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
nopw (%rax,%rax)