// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/sentinel.c
// Function: sentinelPendingScriptsCommand
void sentinelPendingScriptsCommand(redisClient *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 0x829fb(%rip), %rax     # 0xde910
movq 0x28(%rax), %rsi
callq 0x2ded8
movq 0x829eb(%rip), %rdi     # 0xde910
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x205d2
movq %r14, %rdi
callq 0x205ef
testq %rax, %rax
je 0x5c08b
leaq 0x38dcc(%rip), %r12     # 0x94d16
leaq 0x43016(%rip), %rbp     # 0x9ef67
leaq 0x8(%rsp), %r13
movq 0x10(%rax), %r15
movl $0xa, %esi
movq %rbx, %rdi
callq 0x2ded8
movq %rbx, %rdi
leaq 0x42fd6(%rip), %rsi     # 0x9ef47
callq 0x2ddc1
movq 0x8(%r15), %rax
movq $-0x1, %rsi
cmpq $0x0, 0x8(%rax,%rsi,8)
leaq 0x1(%rsi), %rsi
jne 0x5bf81
movq %rbx, %rdi
callq 0x2ded8
movq 0x8(%r15), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0x5bfc0
movl $0x8, %r14d
movq %rbx, %rdi
callq 0x2ddc1
movq 0x8(%r15), %rax
movq (%rax,%r14), %rsi
addq $0x8, %r14
testq %rsi, %rsi
jne 0x5bfa7
movq %rbx, %rdi
leaq 0x3fcdb(%rip), %rsi     # 0x9bca5
callq 0x2ddc1
testb $0x1, (%r15)
leaq 0x42f72(%rip), %rsi     # 0x9ef4c
leaq 0x3edb0(%rip), %rax     # 0x9ad91
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x2ddc1
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2ddc1
movslq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x2dfe7
testb $0x1, (%r15)
jne 0x5c01d
movq 0x10(%r15), %r14
testq %r14, %r14
je 0x5c03a
callq 0x232a3
subq %rax, %r14
jmp 0x5c03d
movq %rbx, %rdi
leaq 0x42f2d(%rip), %rsi     # 0x9ef54
callq 0x2ddc1
callq 0x232a3
movq %rax, %r14
subq 0x10(%r15), %r14
jmp 0x5c058
xorl %r14d, %r14d
testq %r14, %r14
movl $0x0, %eax
cmovleq %rax, %r14
movq %rbx, %rdi
leaq 0x42f0a(%rip), %rsi     # 0x9ef5d
callq 0x2ddc1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2dfe7
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2ddc1
movslq 0x4(%r15), %rsi
movq %rbx, %rdi
callq 0x2dfe7
movq %r13, %rdi
callq 0x205ef
testq %rax, %rax
jne 0x5bf56
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq