// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq 0xf7ab9(%rip), %rax     # 0x18d060
movq 0x28(%rax), %rsi
callq 0x437f0
movq 0xf7aa9(%rip), %rdi     # 0x18d060
leaq -0x20(%rbp), %rsi
callq 0x27320
leaq -0x20(%rbp), %rdi
callq 0x27380
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x95799
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x437f0
movq -0x8(%rbp), %rdi
leaq 0xb0ae9(%rip), %rsi     # 0x1460ec
callq 0x43580
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x95626
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x95608
movq -0x8(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x437f0
movl $0x0, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x2c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x95672
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x2c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x43580
jmp 0x9563a
movq -0x8(%rbp), %rdi
leaq 0xac137(%rip), %rsi     # 0x1417b4
callq 0x43580
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %ecx
leaq 0xaa830(%rip), %rsi     # 0x13fec6
leaq 0xb0a54(%rip), %rax     # 0x1460f1
cmpl $0x0, %ecx
cmovneq %rax, %rsi
callq 0x43580
movq -0x8(%rbp), %rdi
leaq 0xa409a(%rip), %rsi     # 0x13974e
callq 0x43580
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq 0x18(%rax), %rsi
callq 0x439f0
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x9570b
movq -0x8(%rbp), %rdi
leaq 0xb0a16(%rip), %rsi     # 0x1460f9
callq 0x43580
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2ff70
movq -0x40(%rbp), %rdi
movq %rax, %rsi
movq -0x28(%rbp), %rax
subq 0x10(%rax), %rsi
callq 0x439f0
jmp 0x95773
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x95737
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x2ff70
movq %rax, %rcx
movq -0x50(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x48(%rbp)
jmp 0x9573f
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x9573f
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0x95756
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xb09a1(%rip), %rsi     # 0x146102
callq 0x43580
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x439f0
movq -0x8(%rbp), %rdi
leaq 0xb098e(%rip), %rsi     # 0x14610c
callq 0x43580
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x439f0
jmp 0x955c0
addq $0x50, %rsp
popq %rbp
retq
nop