// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/rdb.c
// Function: rdbSaveBackground
int rdbSaveBackground(char *filename) {
    pid_t childpid;
    long long start;

    if (server.aof_child_pid != -1 || server.rdb_child_pid != -1) return C_ERR;

    server.dirty_before_bgsave = server.dirty;
    server.lastbgsave_try = time(NULL);

    start = ustime();
    if ((childpid = fork()) == 0) {
        int retval;

        /* Child */
        closeListeningSockets(0);
        redisSetProcTitle("redis-rdb-bgsave");
        retval = rdbSave(filename);
        if (retval == C_OK) {
            size_t private_dirty = zmalloc_get_private_dirty();

            if (private_dirty) {
                serverLog(LL_NOTICE,
                    "RDB: %zu MB of memory used by copy-on-write",
                    private_dirty/(1024*1024));
            }
        }
        exitFromChild((retval == C_OK) ? 0 : 1);
    } else {
        /* Parent */
        server.stat_fork_time = ustime()-start;
        server.stat_fork_rate = (double) zmalloc_used_memory() * 1000000 / server.stat_fork_time / (1024*1024*1024); /* GB per second. */
        latencyAddSampleIfNeeded("fork",server.stat_fork_time/1000);
        if (childpid == -1) {
            server.lastbgsave_status = C_ERR;
            serverLog(LL_WARNING,"Can't save in background: fork: %s",
                strerror(errno));
            return C_ERR;
        }
        serverLog(LL_NOTICE,"Background saving started by pid %d",childpid);
        server.rdb_save_time_start = time(NULL);
        server.rdb_child_pid = childpid;
        server.rdb_child_type = RDB_CHILD_TYPE_DISK;
        updateDictResizePolicy();
        return C_OK;
    }
    return C_OK; /* unreached */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x122e65(%rip), %rax    # 0x1781d8
cmpl $-0x1, 0x69c(%rax)
jne 0x5538c
leaq 0x122e55(%rip), %rax    # 0x1781d8
cmpl $-0x1, 0x730(%rax)
je 0x55398
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x555dc
leaq 0x122e39(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
leaq 0x122e2b(%rip), %rax    # 0x1781d8
movq %rcx, 0x728(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
movq %rax, %rcx
leaq 0x122e11(%rip), %rax    # 0x1781d8
movq %rcx, 0x760(%rax)
callq 0x2ff30
movq %rax, -0x20(%rbp)
callq 0x26ab0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jne 0x55450
xorl %edi, %edi
callq 0x34f40
leaq 0xe7f52(%rip), %rdi     # 0x13d344
callq 0x37840
movq -0x10(%rbp), %rdi
callq 0x55050
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x55436
callq 0x3b4a0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x55434
movq -0x30(%rbp), %rdx
shrq $0x14, %rdx
movl $0x2, %edi
leaq 0xe7f28(%rip), %rsi     # 0x13d355
movb $0x0, %al
callq 0x2fc60
jmp 0x55436
movl -0x24(%rbp), %ecx
movl $0x1, %edi
xorl %eax, %eax
cmpl $0x0, %ecx
cmovel %eax, %edi
callq 0x2ff90
jmp 0x555d5
callq 0x2ff30
movq %rax, %rcx
movq -0x20(%rbp), %rax
subq %rax, %rcx
leaq 0x122d72(%rip), %rax    # 0x1781d8
movq %rcx, 0x3c8(%rax)
callq 0x3b090
movq %rax, %xmm0
movaps 0xe2022(%rip), %xmm1    # 0x1374a0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xe2026(%rip), %xmm1    # 0x1374b0
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0xe7c47(%rip), %xmm1    # 0x13d0e8
mulsd %xmm1, %xmm0
leaq 0x122d2c(%rip), %rax    # 0x1781d8
cvtsi2sdq 0x3c8(%rax), %xmm1
divsd %xmm1, %xmm0
movsd 0xe1fbf(%rip), %xmm1    # 0x137480
divsd %xmm1, %xmm0
leaq 0x122d0c(%rip), %rax    # 0x1781d8
movsd %xmm0, 0x3d0(%rax)
leaq 0x122cfd(%rip), %rax    # 0x1781d8
cmpq $0x0, 0xa18(%rax)
je 0x55534
leaq 0x122cec(%rip), %rax    # 0x1781d8
movq 0x3c8(%rax), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
leaq 0x122cd4(%rip), %rcx    # 0x1781d8
cmpq 0xa18(%rcx), %rax
jl 0x55534
leaq 0x122cc4(%rip), %rax    # 0x1781d8
movq 0x3c8(%rax), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rsi
leaq 0xe7e52(%rip), %rdi     # 0x13d381
callq 0xa1210
cmpl $-0x1, -0x14(%rbp)
jne 0x55576
leaq 0x122c97(%rip), %rax    # 0x1781d8
movl $0xffffffff, 0x780(%rax) # imm = 0xFFFFFFFF
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq %rax, %rdx
movl $0x3, %edi
leaq 0xe7e20(%rip), %rsi     # 0x13d386
movb $0x0, %al
callq 0x2fc60
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x555dc
movl -0x14(%rbp), %edx
movl $0x2, %edi
leaq 0xe7e24(%rip), %rsi     # 0x13d3a9
movb $0x0, %al
callq 0x2fc60
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
movq %rax, %rcx
leaq 0x122c39(%rip), %rax    # 0x1781d8
movq %rcx, 0x770(%rax)
movl -0x14(%rbp), %ecx
leaq 0x122c28(%rip), %rax    # 0x1781d8
movl %ecx, 0x730(%rax)
leaq 0x122c1b(%rip), %rax    # 0x1781d8
movl $0x1, 0x77c(%rax)
callq 0x305c0
movl $0x0, -0x4(%rbp)
jmp 0x555dc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)