// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/t_hash.c
// Function: hashTypeSet
int hashTypeSet(robj *o, robj *field, robj *value) {
    int update = 0;

    if (o->encoding == OBJ_ENCODING_ZIPLIST) {
        unsigned char *zl, *fptr, *vptr;

        field = getDecodedObject(field);
        value = getDecodedObject(value);

        zl = o->ptr;
        fptr = ziplistIndex(zl, ZIPLIST_HEAD);
        if (fptr != NULL) {
            fptr = ziplistFind(fptr, field->ptr, sdslen(field->ptr), 1);
            if (fptr != NULL) {
                /* Grab pointer to the value (fptr points to the field) */
                vptr = ziplistNext(zl, fptr);
                serverAssert(vptr != NULL);
                update = 1;

                /* Delete value */
                zl = ziplistDelete(zl, &vptr);

                /* Insert new value */
                zl = ziplistInsert(zl, vptr, value->ptr, sdslen(value->ptr));
            }
        }

        if (!update) {
            /* Push new field/value pair onto the tail of the ziplist */
            zl = ziplistPush(zl, field->ptr, sdslen(field->ptr), ZIPLIST_TAIL);
            zl = ziplistPush(zl, value->ptr, sdslen(value->ptr), ZIPLIST_TAIL);
        }
        o->ptr = zl;
        decrRefCount(field);
        decrRefCount(value);

        /* Check if the ziplist needs to be converted to a hash table */
        if (hashTypeLength(o) > server.hash_max_ziplist_entries)
            hashTypeConvert(o, OBJ_ENCODING_HT);
    } else if (o->encoding == OBJ_ENCODING_HT) {
        if (dictReplace(o->ptr, field, value)) { /* Insert */
            incrRefCount(field);
        } else { /* Update */
            update = 1;
        }
        incrRefCount(value);
    } else {
        serverPanic("Unknown hash encoding");
    }
    return update;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x4caed
cmpl $0x5, %eax
jne 0x4cba7
movq %r14, %rdi
callq 0x3a57d
movq %rax, %r14
movq %r15, %rdi
callq 0x3a57d
movq %rax, (%rsp)
movq 0x8(%rbx), %r12
xorl %ebp, %ebp
movq %r12, %rdi
xorl %esi, %esi
callq 0x35aca
testq %rax, %rax
je 0x4cb10
movq %rax, %r13
movq 0x8(%r14), %r15
movq %r15, %rdi
callq 0x4c63b
pushq $0x1
popq %rcx
movq %r13, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x35d65
testq %rax, %rax
je 0x4cb10
movq %r14, 0x8(%rsp)
movq %r12, %rdi
movq %rax, %rsi
callq 0x35b60
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x4cbc1
leaq 0x10(%rsp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x35c78
movq %rax, %r12
movq (%r15), %r15
movq (%rsp), %r14
movq 0x8(%r14), %r13
movq %r13, %rdi
callq 0x4c63b
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movl %eax, %ecx
callq 0x35c73
pushq $0x1
popq %rbp
movq 0x8(%rsp), %r13
jmp 0x4cb52
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2a589
testl %eax, %eax
je 0x4cb8b
movq %r14, %rdi
callq 0x39e74
xorl %ebp, %ebp
jmp 0x4cb8e
movq 0x8(%r14), %r15
movq %r15, %rdi
callq 0x4c63b
pushq $0x1
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x35aa8
movq %rax, %r15
movq %r14, %r13
movq (%rsp), %r14
movq 0x8(%r14), %r12
movq %r12, %rdi
callq 0x4c63b
movq %r15, %rdi
movq %r12, %rsi
movl %eax, %edx
pushq $0x1
popq %rcx
callq 0x35aa8
movq %rax, 0x8(%rbx)
movq %r13, %rdi
callq 0x3a265
movq %r14, %rdi
callq 0x3a265
movq %rbx, %rdi
callq 0x4cbe1
leaq 0xacd33(%rip), %rcx     # 0xf98a8
cmpq 0x940(%rcx), %rax
jbe 0x4cb96
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x4c673
jmp 0x4cb96
pushq $0x1
popq %rbp
movq %r15, %rdi
callq 0x39e74
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x67593(%rip), %rdi     # 0xb4141
leaq 0x683cf(%rip), %rsi     # 0xb4f84
movl $0xef, %edx
callq 0x57b45
jmp 0x4cbd9
leaq 0x683c5(%rip), %rdi     # 0xb4f8d
leaq 0x683b5(%rip), %rsi     # 0xb4f84
movl $0xd0, %edx
callq 0x57ac8
pushq $0x1
popq %rdi
callq 0x263c0