// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, %ebp
movq %rdi, %r15
movl $0x28, %edi
callq 0x382d1
cmpl $0x20, %ebp
movl $0x20, %r12d
cmovll %ebp, %r12d
movq %rax, %r14
movl %r12d, 0x8(%rax)
movslq %r12d, %rdi
shlq $0x3, %rdi
callq 0x382d1
movq %rax, (%r14)
testl %ebp, %ebp
jle 0x6d30c
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 0x6d223
callq 0x3628d
movq %rax, %rdi
leaq 0x5c42f(%rip), %rsi     # 0xc9634
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x36f2d
xorl %edi, %edi
movq %rax, %rsi
callq 0x40650
movq (%r14), %rcx
movq %rax, (%rcx,%rbx,8)
jmp 0x6d23e
movq (%r15,%r12,8), %rax
movl (%rax), %ecx
testb $0xf, %cl
je 0x6d24b
movq (%r14), %rcx
movq %rax, (%rcx,%r12,8)
movq (%r15,%r12,8), %rdi
callq 0x407a8
incq %r12
cmpq %r12, %r13
jne 0x6d1e3
jmp 0x6d30c
shrl $0x4, %ecx
testb $0x7, %cl
jne 0x6d22e
movq 0x8(%rax), %rdi
movzbl -0x1(%rdi), %ecx
andl $0x7, %ecx
decl %ecx
cmpl $0x3, %ecx
ja 0x6d22e
leaq 0x5c3a4(%rip), %rdx     # 0xc9610
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzbl -0x3(%rdi), %ecx
jmp 0x6d28a
movl -0x9(%rdi), %ecx
jmp 0x6d28a
movq -0x11(%rdi), %rcx
jmp 0x6d28a
movzwl -0x5(%rdi), %ecx
cmpq $0x81, %rcx
jb 0x6d22e
movl $0x80, %esi
callq 0x36178
movq (%r15,%r12,8), %rcx
movq 0x8(%rcx), %rcx
movzbl -0x1(%rcx), %edx
movl %edx, %esi
andl $0x7, %esi
cmpl $0x4, %esi
ja 0x6d2df
leaq 0x5c366(%rip), %rdi     # 0xc9620
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
shrl $0x3, %edx
jmp 0x6d2e1
movq -0x11(%rcx), %rdx
jmp 0x6d2e1
movzwl -0x5(%rcx), %edx
jmp 0x6d2e1
movl -0x9(%rcx), %edx
jmp 0x6d2e1
movzbl -0x3(%rcx), %edx
jmp 0x6d2e1
xorl %edx, %edx
addq $-0x80, %rdx
movq %rax, %rdi
leaq 0x5c35d(%rip), %rsi     # 0xc964c
xorl %eax, %eax
callq 0x36f2d
xorl %edi, %edi
movq %rax, %rsi
callq 0x40650
movq (%r14), %rcx
movq %rax, (%rcx,%r12,8)
jmp 0x6d23e
xorl %edi, %edi
callq 0x26cd0
movq %rax, 0x20(%r14)
movq 0x10(%rsp), %rax
movq %rax, 0x18(%r14)
leaq 0x94581(%rip), %rax     # 0x1018a8
movq 0x400(%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x400(%rax)
movq %rcx, 0x10(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq