// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 $0x18, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, %ebp
movq %rdi, %r15
movl $0x28, %edi
callq 0x3b29d
cmpl $0x20, %ebp
movl $0x20, %r12d
cmovll %ebp, %r12d
movq %rax, %r14
movl %r12d, 0x8(%rax)
movslq %r12d, %rdi
shlq $0x3, %rdi
callq 0x3b29d
movq %rax, (%r14)
testl %ebp, %ebp
jle 0x70ddc
leal -0x1(%r12), %ebx
movl %ebp, %eax
subl %r12d, %eax
incl %eax
movl %eax, 0xc(%rsp)
movl %r12d, %r13d
xorl %r12d, %r12d
cmpl $0x21, %ebp
setge %al
cmpq %r12, %rbx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x70cfb
callq 0x39222
movq %rax, %rdi
leaq 0x5b8cb(%rip), %rsi     # 0xcc5a8
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x39eb7
xorl %edi, %edi
movq %rax, %rsi
callq 0x43ab4
movq (%r14), %rcx
movq %rax, (%rcx,%r12,8)
jmp 0x70d16
movq (%r15,%r12,8), %rax
movl (%rax), %ecx
testb $0xf, %cl
je 0x70d23
movq (%r14), %rcx
movq %rax, (%rcx,%r12,8)
movq (%r15,%r12,8), %rdi
callq 0x43c0c
incq %r12
cmpq %r12, %r13
jne 0x70cbb
jmp 0x70ddc
shrl $0x4, %ecx
testb $0x7, %cl
jne 0x70d06
movq 0x8(%rax), %rdi
movzbl -0x1(%rdi), %ecx
movl %ecx, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x70d69
leaq 0x5b83c(%rip), %rsi     # 0xcc580
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %ecx
jmp 0x70d6b
movq -0x11(%rdi), %rcx
jmp 0x70d6b
movzwl -0x5(%rdi), %ecx
jmp 0x70d6b
movl -0x9(%rdi), %ecx
jmp 0x70d6b
movzbl -0x3(%rdi), %ecx
jmp 0x70d6b
xorl %ecx, %ecx
cmpq $0x81, %rcx
jb 0x70d06
movl $0x80, %esi
callq 0x3910c
movq (%r15,%r12,8), %rcx
movq 0x8(%rcx), %rcx
movzbl -0x1(%rcx), %edx
movl %edx, %esi
andl $0x7, %esi
cmpl $0x4, %esi
ja 0x70dc0
leaq 0x5b7f9(%rip), %rdi     # 0xcc594
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
shrl $0x3, %edx
jmp 0x70dc2
movq -0x11(%rcx), %rdx
jmp 0x70dc2
movzwl -0x5(%rcx), %edx
jmp 0x70dc2
movl -0x9(%rcx), %edx
jmp 0x70dc2
movzbl -0x3(%rcx), %edx
jmp 0x70dc2
xorl %edx, %edx
addq $-0x80, %rdx
movq %rax, %rdi
leaq 0x5b7f0(%rip), %rsi     # 0xcc5c0
xorl %eax, %eax
callq 0x39eb7
jmp 0x70ce8
xorl %edi, %edi
callq 0x26ce0
movq %rax, 0x20(%r14)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%r14)
leaq 0x95a61(%rip), %rax     # 0x106858
movq 0x3f0(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x3f0(%rax)
movq %rcx, 0x10(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq