// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x558f5
cmpl $0x5, %eax
jne 0x55abe
movq %r14, %rdi
callq 0x41026
movq %rax, %r14
movq %r15, %rdi
callq 0x41026
movq %rax, %r15
movq 0x8(%rbx), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x3b680
testq %rax, %rax
je 0x559ae
movq 0x8(%r14), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x5593f
leaq 0x6e211(%rip), %rdi     # 0xc3af8
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x55941
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2eb58
testl %eax, %eax
je 0x55915
movq %r14, %rdi
callq 0x407a8
xorl %r12d, %r12d
jmp 0x5591b
movl $0x1, %r12d
movq %r15, %rdi
callq 0x407a8
jmp 0x55aad
movq -0x11(%rsi), %rdx
jmp 0x55941
movzwl -0x5(%rsi), %edx
jmp 0x55941
movl -0x9(%rsi), %edx
jmp 0x55941
movzbl -0x3(%rsi), %edx
jmp 0x55941
xorl %edx, %edx
movq %rax, %rdi
movl $0x1, %ecx
callq 0x3b97b
testq %rax, %rax
je 0x559ae
movq %r12, %rdi
movq %rax, %rsi
callq 0x3b745
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x55ad8
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x3b88c
movq (%r13), %rsi
movq 0x8(%r15), %rdx
movzbl -0x1(%rdx), %ecx
movl %ecx, %edi
andl $0x7, %edi
cmpl $0x4, %edi
ja 0x55a64
leaq 0x6e16f(%rip), %r8      # 0xc3b0c
movslq (%r8,%rdi,4), %rdi
addq %r8, %rdi
jmpq *%rdi
shrl $0x3, %ecx
jmp 0x55a66
movq 0x8(%r14), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x559ec
leaq 0x6e159(%rip), %rcx     # 0xc3b20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x559ee
movq -0x11(%rsi), %rdx
jmp 0x559ee
movzwl -0x5(%rsi), %edx
jmp 0x559ee
movl -0x9(%rsi), %edx
jmp 0x559ee
movzbl -0x3(%rsi), %edx
jmp 0x559ee
xorl %edx, %edx
movq %r12, %rdi
movl $0x1, %ecx
callq 0x3b65e
movq 0x8(%r15), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %ecx
andl $0x7, %ecx
xorl %r12d, %r12d
cmpl $0x4, %ecx
ja 0x55a3c
leaq 0x6e11d(%rip), %rdi     # 0xc3b34
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x55a3e
movq -0x11(%rsi), %rdx
jmp 0x55a3e
movzwl -0x5(%rsi), %edx
jmp 0x55a3e
movl -0x9(%rsi), %edx
jmp 0x55a3e
movzbl -0x3(%rsi), %edx
jmp 0x55a3e
xorl %edx, %edx
movq %rax, %rdi
movl $0x1, %ecx
callq 0x3b65e
jmp 0x55a74
movq -0x11(%rdx), %rcx
jmp 0x55a66
movzwl -0x5(%rdx), %ecx
jmp 0x55a66
movl -0x9(%rdx), %ecx
jmp 0x55a66
movzbl -0x3(%rdx), %ecx
jmp 0x55a66
xorl %ecx, %ecx
movq %rax, %rdi
callq 0x3b887
movl $0x1, %r12d
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x40c8f
movq %r15, %rdi
callq 0x40c8f
movq %rbx, %rdi
callq 0x55afa
leaq 0xabe11(%rip), %rcx     # 0x1018a8
cmpq 0x940(%rcx), %rax
jbe 0x55aad
movq %rbx, %rdi
movl $0x2, %esi
callq 0x5548c
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x6cfbc(%rip), %rdi     # 0xc2a81
leaq 0x6e0b4(%rip), %rsi     # 0xc3b80
movl $0xef, %edx
callq 0x619b4
jmp 0x55af0
leaq 0x6e0aa(%rip), %rdi     # 0xc3b89
leaq 0x6e09a(%rip), %rsi     # 0xc3b80
movl $0xd0, %edx
callq 0x61908
movl $0x1, %edi
callq 0x263c0