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

    if (val->flags & OPVAL_DIRTY_ROBJ)
        decrRefCount(val->ele);

    memset(val,0,sizeof(zsetopval));

    if (op->type == OBJ_SET) {
        iterset *it = &op->iter.set;
        if (op->encoding == OBJ_ENCODING_INTSET) {
            int64_t ell;

            if (!intsetGet(it->is.is,it->is.ii,&ell))
                return 0;
            val->ell = ell;
            val->score = 1.0;

            /* Move to next element. */
            it->is.ii++;
        } else if (op->encoding == OBJ_ENCODING_HT) {
            if (it->ht.de == NULL)
                return 0;
            val->ele = dictGetKey(it->ht.de);
            val->score = 1.0;

            /* Move to next element. */
            it->ht.de = dictNext(it->ht.di);
        } else {
            serverPanic("Unknown set encoding");
        }
    } else if (op->type == OBJ_ZSET) {
        iterzset *it = &op->iter.zset;
        if (op->encoding == OBJ_ENCODING_ZIPLIST) {
            /* No need to check both, but better be explicit. */
            if (it->zl.eptr == NULL || it->zl.sptr == NULL)
                return 0;
            serverAssert(ziplistGet(it->zl.eptr,&val->estr,&val->elen,&val->ell));
            val->score = zzlGetScore(it->zl.sptr);

            /* Move to next element. */
            zzlNext(it->zl.zl,&it->zl.eptr,&it->zl.sptr);
        } else if (op->encoding == OBJ_ENCODING_SKIPLIST) {
            if (it->sl.node == NULL)
                return 0;
            val->ele = it->sl.node->obj;
            val->score = it->sl.node->score;

            /* Move to next element. */
            it->sl.node = it->sl.node->level[0].forward;
        } else {
            serverPanic("Unknown sorted set encoding");
        }
    } else {
        serverPanic("Unsupported type");
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x62f16
movl $0x0, -0x4(%rbp)
jmp 0x631c3
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x62f31
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x48f70
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x26110
movq -0x10(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x63043
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x6, 0xc(%rax)
jne 0x62fbb
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %esi
leaq -0x28(%rbp), %rdx
callq 0x7b9d0
cmpb $0x0, %al
jne 0x62f8c
movl $0x0, -0x4(%rbp)
jmp 0x631c3
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
movsd 0xd44c4(%rip), %xmm0    # 0x137468
movsd %xmm0, 0x48(%rax)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x6303e
movq -0x10(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jne 0x6301a
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x62fdc
movl $0x0, -0x4(%rbp)
jmp 0x631c3
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
movsd 0xd446d(%rip), %xmm0    # 0x137468
movsd %xmm0, 0x48(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2e4a0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x6303c
leaq 0xda1dc(%rip), %rdi     # 0x13d1fd
leaq 0xdabfa(%rip), %rsi     # 0x13dc22
movl $0x6e9, %edx            # imm = 0x6E9
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x6303e
jmp 0x631bc
movq -0x10(%rbp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x63198
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x5, 0xc(%rax)
jne 0x63112
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x63081
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x6308d
movl $0x0, -0x4(%rbp)
jmp 0x631c3
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x30, %rsi
movq -0x18(%rbp), %rdx
addq $0x38, %rdx
movq -0x18(%rbp), %rcx
addq $0x40, %rcx
callq 0x41470
cmpl $0x0, %eax
je 0x630b9
jmp 0x630db
leaq 0xdae24(%rip), %rdi     # 0x13dee4
leaq 0xdab5b(%rip), %rsi     # 0x13dc22
movl $0x6f1, %edx            # imm = 0x6F1
callq 0x76ce0
movl $0x1, %edi
callq 0x263c0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5fe60
movq -0x18(%rbp), %rax
movsd %xmm0, 0x48(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
addq $0x8, %rsi
movq -0x30(%rbp), %rdx
addq $0x10, %rdx
callq 0x600e0
jmp 0x63196
movq -0x10(%rbp), %rax
cmpl $0x7, 0xc(%rax)
jne 0x63172
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x63133
movl $0x0, -0x4(%rbp)
jmp 0x631c3
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movsd 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x48(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x63194
leaq 0xd8571(%rip), %rdi     # 0x13b6ea
leaq 0xdaaa2(%rip), %rsi     # 0x13dc22
movl $0x6ff, %edx            # imm = 0x6FF
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x63196
jmp 0x631ba
leaq 0xdad32(%rip), %rdi     # 0x13ded1
leaq 0xdaa7c(%rip), %rsi     # 0x13dc22
movl $0x702, %edx            # imm = 0x702
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x631bc
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)