// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/aof.c
// Function: rewriteSetObject
int rewriteSetObject(rio *r, robj *key, robj *o) {
    long long count = 0, items = setTypeSize(o);

    if (o->encoding == OBJ_ENCODING_INTSET) {
        int ii = 0;
        int64_t llval;

        while(intsetGet(o->ptr,ii++,&llval)) {
            if (count == 0) {
                int cmd_items = (items > AOF_REWRITE_ITEMS_PER_CMD) ?
                    AOF_REWRITE_ITEMS_PER_CMD : items;

                if (rioWriteBulkCount(r,'*',2+cmd_items) == 0) return 0;
                if (rioWriteBulkString(r,"SADD",4) == 0) return 0;
                if (rioWriteBulkObject(r,key) == 0) return 0;
            }
            if (rioWriteBulkLongLong(r,llval) == 0) return 0;
            if (++count == AOF_REWRITE_ITEMS_PER_CMD) count = 0;
            items--;
        }
    } else if (o->encoding == OBJ_ENCODING_HT) {
        dictIterator *di = dictGetIterator(o->ptr);
        dictEntry *de;

        while((de = dictNext(di)) != NULL) {
            robj *eleobj = dictGetKey(de);
            if (count == 0) {
                int cmd_items = (items > AOF_REWRITE_ITEMS_PER_CMD) ?
                    AOF_REWRITE_ITEMS_PER_CMD : items;

                if (rioWriteBulkCount(r,'*',2+cmd_items) == 0) return 0;
                if (rioWriteBulkString(r,"SADD",4) == 0) return 0;
                if (rioWriteBulkObject(r,key) == 0) return 0;
            }
            if (rioWriteBulkObject(r,eleobj) == 0) return 0;
            if (++count == AOF_REWRITE_ITEMS_PER_CMD) count = 0;
            items--;
        }
        dictReleaseIterator(di);
    } else {
        serverPanic("Unknown set encoding");
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x5bf20
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x6, %eax
jne 0x72d94
movl $0x0, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x34(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
leaq -0x40(%rbp), %rdx
callq 0x7b9d0
cmpb $0x0, %al
je 0x72d8f
cmpq $0x0, -0x28(%rbp)
jne 0x72d45
cmpq $0x40, -0x30(%rbp)
jle 0x72cc9
movl $0x40, %eax
movq %rax, -0x70(%rbp)
jmp 0x72cd1
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rdi
movl -0x44(%rbp), %edx
addl $0x2, %edx
movl $0x2a, %esi
callq 0x8e820
cmpq $0x0, %rax
jne 0x72cfe
movl $0x0, -0x4(%rbp)
jmp 0x72eee
movq -0x10(%rbp), %rdi
leaq 0xcce52(%rip), %rsi     # 0x13fb5b
movl $0x4, %edx
callq 0x8e9c0
cmpq $0x0, %rax
jne 0x72d25
movl $0x0, -0x4(%rbp)
jmp 0x72eee
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x729c0
cmpl $0x0, %eax
jne 0x72d43
movl $0x0, -0x4(%rbp)
jmp 0x72eee
jmp 0x72d45
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x8ea70
cmpq $0x0, %rax
jne 0x72d64
movl $0x0, -0x4(%rbp)
jmp 0x72eee
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x40, %rax
jne 0x72d7e
movq $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x72c88
jmp 0x72ee7
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
jne 0x72ec3
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2e400
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x72eb8
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x72e72
cmpq $0x40, -0x30(%rbp)
jle 0x72df9
movl $0x40, %eax
movq %rax, -0x78(%rbp)
jmp 0x72e01
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rdi
movl -0x64(%rbp), %edx
addl $0x2, %edx
movl $0x2a, %esi
callq 0x8e820
cmpq $0x0, %rax
jne 0x72e2e
movl $0x0, -0x4(%rbp)
jmp 0x72eee
movq -0x10(%rbp), %rdi
leaq 0xccd22(%rip), %rsi     # 0x13fb5b
movl $0x4, %edx
callq 0x8e9c0
cmpq $0x0, %rax
jne 0x72e55
movl $0x0, -0x4(%rbp)
jmp 0x72eee
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x729c0
cmpl $0x0, %eax
jne 0x72e70
movl $0x0, -0x4(%rbp)
jmp 0x72eee
jmp 0x72e72
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x729c0
cmpl $0x0, %eax
jne 0x72e8d
movl $0x0, -0x4(%rbp)
jmp 0x72eee
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpq $0x40, %rax
jne 0x72ea7
movq $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x72dba
movq -0x50(%rbp), %rdi
callq 0x2e600
jmp 0x72ee5
leaq 0xca333(%rip), %rdi     # 0x13d1fd
leaq 0xcc4a6(%rip), %rsi     # 0x13f377
movl $0x36e, %edx            # imm = 0x36E
callq 0x76d80
movl $0x1, %edi
callq 0x263c0
jmp 0x72ee7
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)