// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelPendingScriptsCommand
void sentinelPendingScriptsCommand(client *c) {
    listNode *ln;
    listIter li;

    addReplyMultiBulkLen(c,listLength(sentinel.scripts_queue));
    listRewind(sentinel.scripts_queue,&li);
    while ((ln = listNext(&li)) != NULL) {
        sentinelScriptJob *sj = ln->value;
        int j = 0;

        addReplyMultiBulkLen(c,10);

        addReplyBulkCString(c,"argv");
        while (sj->argv[j]) j++;
        addReplyMultiBulkLen(c,j);
        j = 0;
        while (sj->argv[j]) addReplyBulkCString(c,sj->argv[j++]);

        addReplyBulkCString(c,"flags");
        addReplyBulkCString(c,
            (sj->flags & SENTINEL_SCRIPT_RUNNING) ? "running" : "scheduled");

        addReplyBulkCString(c,"pid");
        addReplyBulkLongLong(c,sj->pid);

        if (sj->flags & SENTINEL_SCRIPT_RUNNING) {
            addReplyBulkCString(c,"run-time");
            addReplyBulkLongLong(c,mstime() - sj->start_time);
        } else {
            mstime_t delay = sj->start_time ? (sj->start_time-mstime()) : 0;
            if (delay < 0) delay = 0;
            addReplyBulkCString(c,"run-delay");
            addReplyBulkLongLong(c,delay);
        }

        addReplyBulkCString(c,"retry-num");
        addReplyBulkLongLong(c,sj->retry_num);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x9f460(%rip), %rax     # 0x116730
movq 0x28(%rax), %rsi
callq 0x3d274
movq 0x9f450(%rip), %rdi     # 0x116730
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x2b3b7
movq %r14, %rdi
callq 0x2b3d4
testq %rax, %rax
je 0x77446
leaq 0x474d9(%rip), %r12     # 0xbe7de
leaq 0x550f4(%rip), %rbp     # 0xcc400
leaq 0x8(%rsp), %r13
movq 0x10(%rax), %r15
movl $0xa, %esi
movq %rbx, %rdi
callq 0x3d274
movq %rbx, %rdi
leaq 0x550b4(%rip), %rsi     # 0xcc3e0
callq 0x3d0f2
movq 0x8(%r15), %rax
movq $-0x1, %rsi
cmpq $0x0, 0x8(%rax,%rsi,8)
leaq 0x1(%rsi), %rsi
jne 0x7733c
movq %rbx, %rdi
callq 0x3d274
movq 0x8(%r15), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0x7737b
movl $0x8, %r14d
movq %rbx, %rdi
callq 0x3d0f2
movq 0x8(%r15), %rax
movq (%rax,%r14), %rsi
addq $0x8, %r14
testq %rsi, %rsi
jne 0x77362
movq %rbx, %rdi
leaq 0x503ae(%rip), %rsi     # 0xc7733
callq 0x3d0f2
testb $0x1, (%r15)
leaq 0x55050(%rip), %rsi     # 0xcc3e5
leaq 0x4e72e(%rip), %rax     # 0xc5aca
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x3d0f2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d0f2
movslq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
testb $0x1, (%r15)
jne 0x773d8
movq 0x10(%r15), %r14
testq %r14, %r14
je 0x773f5
callq 0x2ffce
subq %rax, %r14
jmp 0x773f8
movq %rbx, %rdi
leaq 0x5500b(%rip), %rsi     # 0xcc3ed
callq 0x3d0f2
callq 0x2ffce
movq %rax, %r14
subq 0x10(%r15), %r14
jmp 0x77413
xorl %r14d, %r14d
testq %r14, %r14
movl $0x0, %eax
cmovleq %rax, %r14
movq %rbx, %rdi
leaq 0x54fe8(%rip), %rsi     # 0xcc3f6
callq 0x3d0f2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d415
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3d0f2
movslq 0x4(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
movq %r13, %rdi
callq 0x2b3d4
testq %rax, %rax
jne 0x77311
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq