// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/rdb.c
// Function: backgroundSaveDoneHandlerDisk
void backgroundSaveDoneHandlerDisk(int exitcode, int bysignal) {
    if (!bysignal && exitcode == 0) {
        serverLog(LL_NOTICE,
            "Background saving terminated with success");
        server.dirty = server.dirty - server.dirty_before_bgsave;
        server.lastsave = time(NULL);
        server.lastbgsave_status = C_OK;
    } else if (!bysignal && exitcode != 0) {
        serverLog(LL_WARNING, "Background saving error");
        server.lastbgsave_status = C_ERR;
    } else {
        mstime_t latency;

        serverLog(LL_WARNING,
            "Background saving terminated by signal %d", bysignal);
        latencyStartMonitor(latency);
        rdbRemoveTempFile(server.rdb_child_pid);
        latencyEndMonitor(latency);
        latencyAddSampleIfNeeded("rdb-unlink-temp-file",latency);
        /* SIGUSR1 is whitelisted, so we have a way to kill a child without
         * tirggering an error conditon. */
        if (bysignal != SIGUSR1)
            server.lastbgsave_status = C_ERR;
    }
    server.rdb_child_pid = -1;
    server.rdb_child_type = RDB_CHILD_TYPE_NONE;
    server.rdb_save_time_last = time(NULL)-server.rdb_save_time_start;
    server.rdb_save_time_start = -1;
    /* Possibly there are slaves waiting for a BGSAVE in order to be served
     * (the first stage of SYNC is a bulk transfer of dump.rdb) */
    updateSlavesWaitingBgsave((!bysignal && exitcode == 0) ? C_OK : C_ERR, RDB_CHILD_TYPE_DISK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0x56ab7
cmpl $0x0, -0x4(%rbp)
jne 0x56ab7
movl $0x2, %edi
leaq 0xe6b9f(%rip), %rsi     # 0x13d5f5
movb $0x0, %al
callq 0x2fc60
leaq 0x121774(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
leaq 0x121766(%rip), %rax    # 0x1781d8
subq 0x728(%rax), %rcx
leaq 0x121758(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
movq %rax, %rcx
leaq 0x12173e(%rip), %rax    # 0x1781d8
movq %rcx, 0x758(%rax)
leaq 0x121730(%rip), %rax    # 0x1781d8
movl $0x0, 0x780(%rax)
jmp 0x56ba6
cmpl $0x0, -0x8(%rbp)
jne 0x56aec
cmpl $0x0, -0x4(%rbp)
je 0x56aec
movl $0x3, %edi
leaq 0xe6b50(%rip), %rsi     # 0x13d61f
movb $0x0, %al
callq 0x2fc60
leaq 0x1216fb(%rip), %rax    # 0x1781d8
movl $0xffffffff, 0x780(%rax) # imm = 0xFFFFFFFF
jmp 0x56ba4
movl -0x8(%rbp), %edx
movl $0x3, %edi
leaq 0xe6b3c(%rip), %rsi     # 0x13d637
movb $0x0, %al
callq 0x2fc60
leaq 0x1216cf(%rip), %rax    # 0x1781d8
cmpq $0x0, 0xa18(%rax)
je 0x56b1e
callq 0x2ff70
movq %rax, -0x10(%rbp)
jmp 0x56b26
movq $0x0, -0x10(%rbp)
leaq 0x1216ab(%rip), %rax    # 0x1781d8
movl 0x730(%rax), %edi
callq 0x555f0
leaq 0x121699(%rip), %rax    # 0x1781d8
cmpq $0x0, 0xa18(%rax)
je 0x56b56
callq 0x2ff70
subq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x12167b(%rip), %rax    # 0x1781d8
cmpq $0x0, 0xa18(%rax)
je 0x56b8b
movq -0x10(%rbp), %rax
leaq 0x121666(%rip), %rcx    # 0x1781d8
cmpq 0xa18(%rcx), %rax
jl 0x56b8b
movq -0x10(%rbp), %rsi
leaq 0xe6adb(%rip), %rdi     # 0x13d661
callq 0xa1210
cmpl $0xa, -0x8(%rbp)
je 0x56ba2
leaq 0x121640(%rip), %rax    # 0x1781d8
movl $0xffffffff, 0x780(%rax) # imm = 0xFFFFFFFF
jmp 0x56ba4
jmp 0x56ba6
leaq 0x12162b(%rip), %rax    # 0x1781d8
movl $0xffffffff, 0x730(%rax) # imm = 0xFFFFFFFF
leaq 0x12161a(%rip), %rax    # 0x1781d8
movl $0x0, 0x77c(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
movq %rax, %rcx
leaq 0x1215fd(%rip), %rax    # 0x1781d8
subq 0x770(%rax), %rcx
leaq 0x1215ef(%rip), %rax    # 0x1781d8
movq %rcx, 0x768(%rax)
leaq 0x1215e1(%rip), %rax    # 0x1781d8
movq $-0x1, 0x770(%rax)
xorl %eax, %eax
cmpl $0x0, -0x8(%rbp)
movb %al, -0x11(%rbp)
jne 0x56c17
cmpl $0x0, -0x4(%rbp)
sete %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %cl
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
testb $0x1, %cl
cmovnel %eax, %edi
movl $0x1, %esi
callq 0x4f670
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)