// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/t_zset.c
// Function: zuiFind
int zuiFind(zsetopsrc *op, zsetopval *val, double *score) {
    if (op->subject == NULL)
        return 0;

    if (op->type == OBJ_SET) {
        if (op->encoding == OBJ_ENCODING_INTSET) {
            if (zuiLongLongFromValue(val) &&
                intsetFind(op->subject->ptr,val->ell))
            {
                *score = 1.0;
                return 1;
            } else {
                return 0;
            }
        } else if (op->encoding == OBJ_ENCODING_HT) {
            dict *ht = op->subject->ptr;
            zuiObjectFromValue(val);
            if (dictFind(ht,val->ele) != NULL) {
                *score = 1.0;
                return 1;
            } else {
                return 0;
            }
        } else {
            serverPanic("Unknown set encoding");
        }
    } else if (op->type == OBJ_ZSET) {
        zuiObjectFromValue(val);

        if (op->encoding == OBJ_ENCODING_ZIPLIST) {
            if (zzlFind(op->subject->ptr,val->ele,score) != NULL) {
                /* Score is already set by zzlFind. */
                return 1;
            } else {
                return 0;
            }
        } else if (op->encoding == OBJ_ENCODING_SKIPLIST) {
            zset *zs = op->subject->ptr;
            dictEntry *de;
            if ((de = dictFind(zs->dict,val->ele)) != NULL) {
                *score = *(double*)dictGetVal(de);
                return 1;
            } else {
                return 0;
            }
        } else {
            serverPanic("Unknown sorted set encoding");
        }
    } else {
        serverPanic("Unsupported type");
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rax
xorl %ebx, %ebx
testq %rax, %rax
je 0x4a8c2
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x8(%rdi), %ecx
cmpl $0x3, %ecx
je 0x4a834
cmpl $0x2, %ecx
jne 0x4a8d0
movl 0xc(%r12), %ecx
cmpl $0x2, %ecx
je 0x4a895
cmpl $0x6, %ecx
jne 0x4a8fa
movq %r15, %rdi
callq 0x4a65f
testl %eax, %eax
je 0x4a8c2
movq (%r12), %rax
movq 0x8(%rax), %rdi
movq 0x40(%r15), %rsi
callq 0x5a95d
testb %al, %al
jne 0x4a8b2
jmp 0x4a8c2
movq %r15, %rdi
callq 0x4a704
movl 0xc(%r12), %eax
cmpl $0x7, %eax
je 0x4a86d
cmpl $0x5, %eax
jne 0x4a8e5
movq (%r12), %rax
movq 0x8(%rax), %rdi
movq 0x28(%r15), %rsi
movq %r14, %rdx
callq 0x48cbf
xorl %ebx, %ebx
testq %rax, %rax
setne %bl
jmp 0x4a8c2
movq (%r12), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq 0x28(%r15), %rsi
callq 0x2a5f9
testq %rax, %rax
je 0x4a8c2
movq 0x8(%rax), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%r14)
jmp 0x4a8bf
movq 0x8(%rax), %r12
movq %r15, %rdi
callq 0x4a704
movq 0x28(%r15), %rsi
movq %r12, %rdi
callq 0x2a5f9
testq %rax, %rax
je 0x4a8c2
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%r14)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x6a52a(%rip), %rdi     # 0xb4e01
leaq 0x6a274(%rip), %rsi     # 0xb4b52
movl $0x773, %edx            # imm = 0x773
jmp 0x4a90d
leaq 0x67cb2(%rip), %rdi     # 0xb259e
leaq 0x6a25f(%rip), %rsi     # 0xb4b52
movl $0x770, %edx            # imm = 0x770
jmp 0x4a90d
leaq 0x69829(%rip), %rdi     # 0xb412a
leaq 0x6a24a(%rip), %rsi     # 0xb4b52
movl $0x75a, %edx            # imm = 0x75A
callq 0x57b45
pushq $0x1
popq %rdi
callq 0x263c0