// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %esi, %ebp
orl %edi, %ebp
je 0x4a89c
movl %esi, %ebx
testl %esi, %esi
setne %al
testl %edi, %edi
sete %cl
orb %al, %cl
jne 0x4a8da
leaq 0x78607(%rip), %rsi     # 0xc2e8c
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x4a97a
leaq 0x785bf(%rip), %rsi     # 0xc2e62
xorl %r14d, %r14d
movl $0x2, %edi
xorl %eax, %eax
callq 0x2fdad
leaq 0xb6fef(%rip), %rbx     # 0x1018a8
movq 0x728(%rbx), %rax
subq %rax, 0x720(%rbx)
xorl %edi, %edi
callq 0x26cd0
movq %rax, 0x758(%rbx)
jmp 0x4a97a
leaq 0x785c3(%rip), %rsi     # 0xc2ea4
xorl %r14d, %r14d
movl $0x3, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2fdad
leaq 0xb6faf(%rip), %r12     # 0x1018a8
cmpq $0x0, 0xa18(%r12)
je 0x4a90c
callq 0x2ffce
movq %rax, %r14
movl 0x730(%r12), %ecx
leaq 0x781bc(%rip), %rdx     # 0xc2ad7
movq %rsp, %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
xorl %eax, %eax
callq 0x26120
movq %r15, %rdi
callq 0x263b0
cmpq $0x0, 0xa18(%r12)
je 0x4a96f
callq 0x2ffce
subq %r14, %rax
movq 0xa18(%r12), %rcx
testq %rcx, %rcx
sete %dl
cmpq %rcx, %rax
setl %cl
orb %dl, %cl
jne 0x4a96f
leaq 0x78567(%rip), %rdi     # 0xc2ece
movq %rax, %rsi
callq 0x7eb75
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $0xa, %ebx
je 0x4a988
leaq 0xb6f27(%rip), %rax     # 0x1018a8
movl %r14d, 0x780(%rax)
leaq 0xb6f19(%rip), %r14     # 0x1018a8
movl $0xffffffff, 0x730(%r14) # imm = 0xFFFFFFFF
movl $0x0, 0x77c(%r14)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x26cd0
subq 0x770(%r14), %rax
movq %rax, 0x768(%r14)
movq $-0x1, 0x770(%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 0x4547e