// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %esi, %ebp
orl %edi, %ebp
je 0x4dfa6
movl %esi, %ebx
testl %esi, %esi
setne %al
testl %edi, %edi
sete %cl
orb %al, %cl
jne 0x4dfe4
leaq 0x77e7d(%rip), %rsi     # 0xc5e0c
movl $0x3, %edi
xorl %eax, %eax
callq 0x32ea6
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x4e087
leaq 0x77e35(%rip), %rsi     # 0xc5de2
xorl %r14d, %r14d
movl $0x2, %edi
xorl %eax, %eax
callq 0x32ea6
leaq 0xb8895(%rip), %rbx     # 0x106858
movq 0x718(%rbx), %rax
subq %rax, 0x710(%rbx)
xorl %edi, %edi
callq 0x26ce0
movq %rax, 0x748(%rbx)
jmp 0x4e087
leaq 0x77e39(%rip), %rsi     # 0xc5e24
xorl %r14d, %r14d
movl $0x3, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x32ea6
leaq 0xb8855(%rip), %r12     # 0x106858
cmpq $0x0, 0xa08(%r12)
je 0x4e016
callq 0x330c8
movq %rax, %r14
movl 0x720(%r12), %ecx
leaq 0x77a32(%rip), %rdx     # 0xc5a57
movq %rsp, %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
xorl %eax, %eax
callq 0x26120
movq %r15, %rdi
callq 0x263c0
cmpq $0x0, 0xa08(%r12)
je 0x4e055
callq 0x330c8
subq %r14, %rax
movq %rax, %r14
movq 0xa08(%r12), %rax
testq %rax, %rax
sete %cl
cmpq %rax, %r14
setl %al
orb %cl, %al
jne 0x4e07c
leaq 0x77dda(%rip), %rdi     # 0xc5e4e
movq %r14, %rsi
callq 0x825dd
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $0xa, %ebx
je 0x4e095
leaq 0xb87ca(%rip), %rax     # 0x106858
movl %r14d, 0x770(%rax)
leaq 0xb87bc(%rip), %r14     # 0x106858
movl $0xffffffff, 0x720(%r14) # imm = 0xFFFFFFFF
movl $0x0, 0x76c(%r14)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x26ce0
subq 0x760(%r14), %rax
movq %rax, 0x758(%r14)
movq $-0x1, 0x760(%r14)
negl %ebp
sbbl %ebx, %ebx
movl %ebx, %edi
movl $0x1, %esi
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x486fb