// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/t_set.c
// Function: setTypeAdd
int setTypeAdd(robj *subject, robj *value) {
    long long llval;
    if (subject->encoding == OBJ_ENCODING_HT) {
        if (dictAdd(subject->ptr,value,NULL) == DICT_OK) {
            incrRefCount(value);
            return 1;
        }
    } else if (subject->encoding == OBJ_ENCODING_INTSET) {
        if (isObjectRepresentableAsLongLong(value,&llval) == C_OK) {
            uint8_t success = 0;
            subject->ptr = intsetAdd(subject->ptr,llval,&success);
            if (success) {
                /* Convert to regular set when the intset contains
                 * too many entries. */
                if (intsetLen(subject->ptr) > server.set_max_intset_entries)
                    setTypeConvert(subject,OBJ_ENCODING_HT);
                return 1;
            }
        } else {
            /* Failed to get integer from object, convert to regular set. */
            setTypeConvert(subject,OBJ_ENCODING_HT);

            /* The set *was* an intset and this value is not integer
             * encodable, so dictAdd should always work. */
            serverAssertWithInfo(NULL,value,
                                dictAdd(subject->ptr,value,NULL) == DICT_OK);
            incrRefCount(value);
            return 1;
        }
    } else {
        serverPanic("Unknown set encoding");
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
jne 0x5b7a5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2d8c0
cmpl $0x0, %eax
jne 0x5b7a0
movq -0x18(%rbp), %rdi
callq 0x487b0
movl $0x1, -0x4(%rbp)
jmp 0x5b8c5
jmp 0x5b8be
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x6, %eax
jne 0x5b89a
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x490f0
cmpl $0x0, %eax
jne 0x5b831
movb $0x0, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq -0x21(%rbp), %rdx
callq 0x7b2f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpb $0x0, -0x21(%rbp)
je 0x5b82f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7ba20
movl %eax, %eax
leaq 0x11c9cc(%rip), %rcx    # 0x1781d8
cmpq 0x950(%rcx), %rax
jbe 0x5b823
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x5b8d0
movl $0x1, -0x4(%rbp)
jmp 0x5b8c5
jmp 0x5b898
movq -0x10(%rbp), %rdi
movl $0x2, %esi
callq 0x5b8d0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x2d8c0
cmpl $0x0, %eax
jne 0x5b85b
jmp 0x5b886
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
leaq 0xe2282(%rip), %rdx     # 0x13daec
leaq 0xe22a7(%rip), %rcx     # 0x13db18
movl $0x4e, %r8d
callq 0x78360
movl $0x1, %edi
callq 0x263c0
movq -0x18(%rbp), %rdi
callq 0x487b0
movl $0x1, -0x4(%rbp)
jmp 0x5b8c5
jmp 0x5b8bc
leaq 0xe195c(%rip), %rdi     # 0x13d1fd
leaq 0xe2270(%rip), %rsi     # 0x13db18
movl $0x53, %edx
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x5b8be
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop