// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x5, %eax
jne 0x66b8c
movq -0x10(%rbp), %rdi
callq 0x494f0
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rdi
callq 0x494f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x41120
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x66acd
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x66320
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl %eax, %edx
movl $0x1, %ecx
callq 0x41710
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x66acb
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x412e0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x66a51
jmp 0x66a73
leaq 0xd762d(%rip), %rdi     # 0x13e085
leaq 0xd761d(%rip), %rsi     # 0x13e07c
movl $0xd0, %edx
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movl $0x1, -0x1c(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x41570
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x66320
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl %eax, %ecx
callq 0x41530
movq %rax, -0x28(%rbp)
jmp 0x66acd
cmpl $0x0, -0x1c(%rbp)
jne 0x66b45
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x66320
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movl %eax, %edx
movl $0x1, %ecx
callq 0x410b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x66320
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl %eax, %edx
movl $0x1, %ecx
callq 0x410b0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x48f70
movq -0x18(%rbp), %rdi
callq 0x48f70
movq -0x8(%rbp), %rdi
callq 0x66c10
leaq 0x111665(%rip), %rcx    # 0x1781d8
cmpq 0x940(%rcx), %rax
jbe 0x66b8a
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x663b0
jmp 0x66bf8
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
jne 0x66bd4
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2dbd0
cmpl $0x0, %eax
je 0x66bc2
movq -0x10(%rbp), %rdi
callq 0x487b0
jmp 0x66bc9
movl $0x1, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x487b0
jmp 0x66bf6
leaq 0xd6639(%rip), %rdi     # 0x13d214
leaq 0xd749a(%rip), %rsi     # 0x13e07c
movl $0xef, %edx
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x66bf8
movl -0x1c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)