// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/debug.c
// Function: computeDatasetDigest
void computeDatasetDigest(unsigned char *final) {
    unsigned char digest[20];
    char buf[128];
    dictIterator *di = NULL;
    dictEntry *de;
    int j;
    uint32_t aux;

    memset(final,0,20); /* Start with a clean result */

    for (j = 0; j < server.dbnum; j++) {
        redisDb *db = server.db+j;

        if (dictSize(db->dict) == 0) continue;
        di = dictGetSafeIterator(db->dict);

        /* hash the DB id, so the same dataset moved in a different
         * DB will lead to a different digest */
        aux = htonl(j);
        mixDigest(final,&aux,sizeof(aux));

        /* Iterate this DB writing every entry */
        while((de = dictNext(di)) != NULL) {
            sds key;
            robj *keyobj, *o;
            long long expiretime;

            memset(digest,0,20); /* This key-val digest */
            key = dictGetKey(de);
            keyobj = createStringObject(key,sdslen(key));

            mixDigest(digest,key,sdslen(key));

            o = dictGetVal(de);

            aux = htonl(o->type);
            mixDigest(digest,&aux,sizeof(aux));
            expiretime = getExpire(db,keyobj);

            /* Save the key and associated value */
            if (o->type == OBJ_STRING) {
                mixObjectDigest(digest,o);
            } else if (o->type == OBJ_LIST) {
                listTypeIterator *li = listTypeInitIterator(o,0,LIST_TAIL);
                listTypeEntry entry;
                while(listTypeNext(li,&entry)) {
                    robj *eleobj = listTypeGet(&entry);
                    mixObjectDigest(digest,eleobj);
                    decrRefCount(eleobj);
                }
                listTypeReleaseIterator(li);
            } else if (o->type == OBJ_SET) {
                setTypeIterator *si = setTypeInitIterator(o);
                robj *ele;
                while((ele = setTypeNextObject(si)) != NULL) {
                    xorObjectDigest(digest,ele);
                    decrRefCount(ele);
                }
                setTypeReleaseIterator(si);
            } else if (o->type == OBJ_ZSET) {
                unsigned char eledigest[20];

                if (o->encoding == OBJ_ENCODING_ZIPLIST) {
                    unsigned char *zl = o->ptr;
                    unsigned char *eptr, *sptr;
                    unsigned char *vstr;
                    unsigned int vlen;
                    long long vll;
                    double score;

                    eptr = ziplistIndex(zl,0);
                    serverAssert(eptr != NULL);
                    sptr = ziplistNext(zl,eptr);
                    serverAssert(sptr != NULL);

                    while (eptr != NULL) {
                        serverAssert(ziplistGet(eptr,&vstr,&vlen,&vll));
                        score = zzlGetScore(sptr);

                        memset(eledigest,0,20);
                        if (vstr != NULL) {
                            mixDigest(eledigest,vstr,vlen);
                        } else {
                            ll2string(buf,sizeof(buf),vll);
                            mixDigest(eledigest,buf,strlen(buf));
                        }

                        snprintf(buf,sizeof(buf),"%.17g",score);
                        mixDigest(eledigest,buf,strlen(buf));
                        xorDigest(digest,eledigest,20);
                        zzlNext(zl,&eptr,&sptr);
                    }
                } else if (o->encoding == OBJ_ENCODING_SKIPLIST) {
                    zset *zs = o->ptr;
                    dictIterator *di = dictGetIterator(zs->dict);
                    dictEntry *de;

                    while((de = dictNext(di)) != NULL) {
                        robj *eleobj = dictGetKey(de);
                        double *score = dictGetVal(de);

                        snprintf(buf,sizeof(buf),"%.17g",*score);
                        memset(eledigest,0,20);
                        mixObjectDigest(eledigest,eleobj);
                        mixDigest(eledigest,buf,strlen(buf));
                        xorDigest(digest,eledigest,20);
                    }
                    dictReleaseIterator(di);
                } else {
                    serverPanic("Unknown sorted set encoding");
                }
            } else if (o->type == OBJ_HASH) {
                hashTypeIterator *hi;
                robj *obj;

                hi = hashTypeInitIterator(o);
                while (hashTypeNext(hi) != C_ERR) {
                    unsigned char eledigest[20];

                    memset(eledigest,0,20);
                    obj = hashTypeCurrentObject(hi,OBJ_HASH_KEY);
                    mixObjectDigest(eledigest,obj);
                    decrRefCount(obj);
                    obj = hashTypeCurrentObject(hi,OBJ_HASH_VALUE);
                    mixObjectDigest(eledigest,obj);
                    decrRefCount(obj);
                    xorDigest(digest,eledigest,20);
                }
                hashTypeReleaseIterator(hi);
            } else {
                serverPanic("Unknown object type");
            }
            /* If the key has an expire, add it to the mix */
            if (expiretime != -1) xorDigest(digest,"!!expire!!",10);
            /* We can finally xor the key-val digest to the final digest */
            xorDigest(final,digest,20);
            decrRefCount(keyobj);
        }
        dictReleaseIterator(di);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq $0x0, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x26110
movl $0x0, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
leaq 0x101cd7(%rip), %rcx    # 0x1781d8
cmpl 0x610(%rcx), %eax
jge 0x76cd7
leaq 0x101cc4(%rip), %rax    # 0x1781d8
movq 0x28(%rax), %rax
movslq -0xb4(%rbp), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq (%rax), %rax
movq 0x28(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rcx), %rcx
addq 0x48(%rcx), %rax
cmpq $0x0, %rax
jne 0x76554
jmp 0x76cc3
movq -0xc0(%rbp), %rax
movq (%rax), %rdi
callq 0x2e470
movq %rax, -0xa8(%rbp)
movl -0xb4(%rbp), %edi
callq 0x26b20
movl %eax, -0xb8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl $0x4, %edx
callq 0x763f0
movq -0xa8(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0x76cb7
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x26110
movq -0xb0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x76360
movq -0x1f8(%rbp), %rdi
movq %rax, %rsi
callq 0x486a0
movq %rax, -0xd0(%rbp)
leaq -0x20(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x76360
movq -0x1f0(%rbp), %rdi
movq -0x1e8(%rbp), %rsi
movq %rax, %rdx
callq 0x763f0
movq -0xb0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movl (%rax), %edi
andl $0xf, %edi
callq 0x26b20
movl %eax, -0xb8(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl $0x4, %edx
callq 0x763f0
movq -0xc0(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x4c430
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x766b7
leaq -0x20(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x76460
jmp 0x76c75
movq -0xd8(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x7673e
movq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x591a0
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x592a0
cmpl $0x0, %eax
je 0x7672d
leaq -0x120(%rbp), %rdi
callq 0x59350
movq %rax, -0x128(%rbp)
leaq -0x20(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0x76460
movq -0x128(%rbp), %rdi
callq 0x48f70
jmp 0x766e4
movq -0xe8(%rbp), %rdi
callq 0x59270
jmp 0x76c73
movq -0xd8(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x2, %eax
jne 0x767aa
movq -0xd8(%rbp), %rdi
callq 0x5bbf0
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
callq 0x5bdc0
movq %rax, -0x138(%rbp)
cmpq $0x0, %rax
je 0x76799
leaq -0x20(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x76300
movq -0x138(%rbp), %rdi
callq 0x48f70
jmp 0x76762
movq -0x130(%rbp), %rdi
callq 0x5bca0
jmp 0x76c71
movq -0xd8(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x3, %eax
jne 0x76b65
movq -0xd8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
jne 0x76a0b
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rdi
xorl %esi, %esi
callq 0x41120
movq %rax, -0x160(%rbp)
cmpq $0x0, -0x160(%rbp)
je 0x7680a
jmp 0x7682c
leaq 0xc749a(%rip), %rdi     # 0x13dcab
leaq 0xc9a8c(%rip), %rsi     # 0x1402a4
movl $0xba, %edx
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x158(%rbp), %rdi
movq -0x160(%rbp), %rsi
callq 0x412e0
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x76852
jmp 0x76874
leaq 0xc7779(%rip), %rdi     # 0x13dfd2
leaq 0xc9a44(%rip), %rsi     # 0x1402a4
movl $0xbc, %edx
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
jmp 0x76876
cmpq $0x0, -0x160(%rbp)
je 0x76a06
movq -0x160(%rbp), %rdi
leaq -0x170(%rbp), %rsi
leaq -0x174(%rbp), %rdx
leaq -0x180(%rbp), %rcx
callq 0x41470
cmpl $0x0, %eax
je 0x768ac
jmp 0x768ce
leaq 0xc92ad(%rip), %rdi     # 0x13fb60
leaq 0xc99ea(%rip), %rsi     # 0x1402a4
movl $0xbf, %edx
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x168(%rbp), %rdi
callq 0x5fe60
movsd %xmm0, -0x188(%rbp)
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x26110
cmpq $0x0, -0x170(%rbp)
je 0x7691c
leaq -0x150(%rbp), %rdi
movq -0x170(%rbp), %rsi
movl -0x174(%rbp), %eax
movl %eax, %edx
callq 0x763f0
jmp 0x76972
leaq -0xa0(%rbp), %rdi
movq -0x180(%rbp), %rdx
movl $0x80, %esi
callq 0x477e0
leaq -0x150(%rbp), %rax
movq %rax, -0x208(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x264f0
movq -0x208(%rbp), %rdi
movq -0x200(%rbp), %rsi
movq %rax, %rdx
callq 0x763f0
leaq -0xa0(%rbp), %rdi
movsd -0x188(%rbp), %xmm0
movl $0x80, %esi
leaq 0xc4102(%rip), %rdx     # 0x13aa8f
movb $0x1, %al
callq 0x26120
leaq -0x150(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x264f0
movq -0x218(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq %rax, %rdx
callq 0x763f0
leaq -0x20(%rbp), %rdi
leaq -0x150(%rbp), %rsi
movl $0x14, %edx
callq 0x76250
movq -0x158(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x168(%rbp), %rdx
callq 0x600e0
jmp 0x76876
jmp 0x76b60
movq -0xd8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x7, %eax
jne 0x76b3c
movq -0xd8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
movq (%rax), %rdi
callq 0x2e400
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x1a0(%rbp)
cmpq $0x0, %rax
je 0x76b2e
movq -0x1a0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1b0(%rbp)
leaq -0xa0(%rbp), %rdi
movq -0x1b0(%rbp), %rax
movsd (%rax), %xmm0
movl $0x80, %esi
leaq 0xc3fe6(%rip), %rdx     # 0x13aa8f
movb $0x1, %al
callq 0x26120
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x26110
leaq -0x150(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
callq 0x76460
leaq -0x150(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x220(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x264f0
movq -0x228(%rbp), %rdi
movq -0x220(%rbp), %rsi
movq %rax, %rdx
callq 0x763f0
leaq -0x20(%rbp), %rdi
leaq -0x150(%rbp), %rsi
movl $0x14, %edx
callq 0x76250
jmp 0x76a4b
movq -0x198(%rbp), %rdi
callq 0x2e600
jmp 0x76b5e
leaq 0xc4ba7(%rip), %rdi     # 0x13b6ea
leaq 0xc975a(%rip), %rsi     # 0x1402a4
movl $0xe0, %edx
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x76b60
jmp 0x76c6f
movq -0xd8(%rbp), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x4, %eax
jne 0x76c4b
movq -0xd8(%rbp), %rdi
callq 0x66e10
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rdi
callq 0x66f00
cmpl $-0x1, %eax
je 0x76c3d
leaq -0x1e0(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x26110
movq -0x1b8(%rbp), %rdi
movl $0x1, %esi
callq 0x67200
movq %rax, -0x1c0(%rbp)
leaq -0x1e0(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
callq 0x76460
movq -0x1c0(%rbp), %rdi
callq 0x48f70
movq -0x1b8(%rbp), %rdi
movl $0x2, %esi
callq 0x67200
movq %rax, -0x1c0(%rbp)
leaq -0x1e0(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
callq 0x76460
movq -0x1c0(%rbp), %rdi
callq 0x48f70
leaq -0x20(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
movl $0x14, %edx
callq 0x76250
jmp 0x76b8d
movq -0x1b8(%rbp), %rdi
callq 0x66ec0
jmp 0x76c6d
leaq 0xc4af8(%rip), %rdi     # 0x13b74a
leaq 0xc964b(%rip), %rsi     # 0x1402a4
movl $0xf5, %edx
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x76c6f
jmp 0x76c71
jmp 0x76c73
jmp 0x76c75
cmpq $-0x1, -0xe0(%rbp)
je 0x76c94
leaq -0x20(%rbp), %rdi
leaq 0xc9622(%rip), %rsi     # 0x1402ac
movl $0xa, %edx
callq 0x76250
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x14, %edx
callq 0x76250
movq -0xd0(%rbp), %rdi
callq 0x48f70
jmp 0x76590
movq -0xa8(%rbp), %rdi
callq 0x2e600
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x764f4
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq