// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/slowlog.c
// Function: slowlogCreateEntry
slowlogEntry *slowlogCreateEntry(robj **argv, int argc, long long duration) {
    slowlogEntry *se = zmalloc(sizeof(*se));
    int j, slargc = argc;

    if (slargc > SLOWLOG_ENTRY_MAX_ARGC) slargc = SLOWLOG_ENTRY_MAX_ARGC;
    se->argc = slargc;
    se->argv = zmalloc(sizeof(robj*)*slargc);
    for (j = 0; j < slargc; j++) {
        /* Logging too many arguments is a useless memory waste, so we stop
         * at SLOWLOG_ENTRY_MAX_ARGC, but use the last argument to specify
         * how many remaining arguments there were in the original command. */
        if (slargc != argc && j == slargc-1) {
            se->argv[j] = createObject(OBJ_STRING,
                sdscatprintf(sdsempty(),"... (%d more arguments)",
                argc-slargc+1));
        } else {
            /* Trim too long strings as well... */
            if (argv[j]->type == OBJ_STRING &&
                sdsEncodedObject(argv[j]) &&
                sdslen(argv[j]->ptr) > SLOWLOG_ENTRY_MAX_STRING)
            {
                sds s = sdsnewlen(argv[j]->ptr, SLOWLOG_ENTRY_MAX_STRING);

                s = sdscatprintf(s,"... (%lu more bytes)",
                    (unsigned long)
                    sdslen(argv[j]->ptr) - SLOWLOG_ENTRY_MAX_STRING);
                se->argv[j] = createObject(OBJ_STRING,s);
            } else {
                se->argv[j] = argv[j];
                incrRefCount(argv[j]);
            }
        }
    }
    se->time = time(NULL);
    se->duration = duration;
    se->id = server.slowlog_entry_id++;
    return se;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x20(%rsp)
movl %esi, %ebx
movq %rdi, %rbp
pushq $0x28
popq %rdi
callq 0x327b9
cmpl $0x20, %ebx
pushq $0x20
popq %rcx
cmovll %ebx, %ecx
movq %rax, %r14
movl %ecx, 0x8(%rax)
movslq %ecx, %r13
leaq (,%r13,8), %rdi
callq 0x327b9
leal -0x1(%r13), %r12d
movl %ebx, %ecx
subl %r13d, %ecx
incl %ecx
movl %ecx, 0x14(%rsp)
xorl %ecx, %ecx
testl %r13d, %r13d
cmovlel %ecx, %r13d
movq %rax, (%r14)
xorl %r15d, %r15d
movq %r12, 0x18(%rsp)
cmpq %r15, %r13
je 0x620ce
cmpl $0x21, %ebx
setge %al
cmpq %r15, %r12
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x6202f
callq 0x3114c
movq %rax, %rdi
leaq 0x585f3(%rip), %rsi     # 0xba604
movl 0x14(%rsp), %edx
xorl %eax, %eax
callq 0x31a38
xorl %edi, %edi
movq %rax, %rsi
callq 0x39d58
movq (%r14), %rcx
movq %rax, (%rcx,%r12,8)
jmp 0x6205d
movq %r13, %r12
movq %rbp, %r13
movq (%rbp,%r15,8), %rbp
movl (%rbp), %eax
testb $0xf, %al
je 0x62062
movq (%r14), %rax
movq %rbp, (%rax,%r15,8)
movq %r13, %rbp
movq (%r13,%r15,8), %rdi
callq 0x39e74
movq %r12, %r13
movq 0x18(%rsp), %r12
incq %r15
jmp 0x61fe6
shrl $0x4, %eax
testb $0x7, %al
jne 0x62041
movq 0x8(%rbp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x62111
cmpq $0x81, %rax
jb 0x62041
movl $0x80, %esi
movq 0x8(%rsp), %rdi
callq 0x31018
movq %rax, 0x8(%rsp)
movq %r13, %rbp
movq (%r13,%r15,8), %rax
movq 0x8(%rax), %rdi
callq 0x62111
leaq -0x80(%rax), %rdx
movq 0x8(%rsp), %rdi
leaq 0x58568(%rip), %rsi     # 0xba61c
xorl %eax, %eax
callq 0x31a38
xorl %edi, %edi
movq %rax, %rsi
callq 0x39d58
movq (%r14), %rcx
movq %rax, (%rcx,%r15,8)
jmp 0x62055
xorl %edi, %edi
callq 0x26cd0
movq %rax, 0x20(%r14)
movq 0x20(%rsp), %rax
movq %rax, 0x18(%r14)
leaq 0x977bf(%rip), %rax     # 0xf98a8
movq 0x400(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x400(%rax)
movq %rcx, 0x10(%r14)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq