// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/server.c
// Function: serverLogFromHandler
void serverLogFromHandler(int level, const char *msg) {
    int fd;
    int log_to_stdout = server.logfile[0] == '\0';
    char buf[64];

    if ((level&0xff) < server.verbosity || (log_to_stdout && server.daemonize))
        return;
    fd = log_to_stdout ? STDOUT_FILENO :
                         open(server.logfile, O_APPEND|O_CREAT|O_WRONLY, 0644);
    if (fd == -1) return;
    ll2string(buf,sizeof(buf),getpid());
    if (write(fd,buf,strlen(buf)) == -1) goto err;
    if (write(fd,":signal-handler (",17) == -1) goto err;
    ll2string(buf,sizeof(buf),time(NULL));
    if (write(fd,buf,strlen(buf)) == -1) goto err;
    if (write(fd,") ",2) == -1) goto err;
    if (write(fd,msg,strlen(msg)) == -1) goto err;
    if (write(fd,"\n",1) == -1) goto err;
err:
    if (!log_to_stdout) close(fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x148c1f(%rip), %rax    # 0x178978
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
cmpl 0x148a58(%rip), %eax    # 0x1787d0
jl 0x2fd89
cmpl $0x0, -0x18(%rbp)
je 0x2fd8e
cmpl $0x0, 0x148a6d(%rip)    # 0x1787f4
je 0x2fd8e
jmp 0x2ff1c
cmpl $0x0, -0x18(%rbp)
je 0x2fd9e
movl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2fdb9
movq 0x148bd3(%rip), %rdi    # 0x178978
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x266a0
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x2fdca
jmp 0x2ff1c
leaq -0x60(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x26420
movq -0x80(%rbp), %rdi
movslq %eax, %rdx
movl $0x40, %esi
callq 0x477e0
movl -0x14(%rbp), %eax
movl %eax, -0x74(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x264f0
movl -0x74(%rbp), %edi
movq -0x70(%rbp), %rsi
movq %rax, %rdx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x2fe19
jmp 0x2ff0e
movl -0x14(%rbp), %edi
leaq 0x107b66(%rip), %rsi    # 0x137989
movl $0x11, %edx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x2fe38
jmp 0x2ff0e
leaq -0x60(%rbp), %rax
movq %rax, -0x98(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x26ce0
movq -0x98(%rbp), %rdi
movq %rax, %rdx
movl $0x40, %esi
callq 0x477e0
movl -0x14(%rbp), %eax
movl %eax, -0x8c(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x264f0
movl -0x8c(%rbp), %edi
movq -0x88(%rbp), %rsi
movq %rax, %rdx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x2fe9a
jmp 0x2ff0e
movl -0x14(%rbp), %edi
leaq 0x1142a2(%rip), %rsi    # 0x144146
movl $0x2, %edx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x2feb6
jmp 0x2ff0e
movl -0x14(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x264f0
movl -0xa4(%rbp), %edi
movq -0xa0(%rbp), %rsi
movq %rax, %rdx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x2fef0
jmp 0x2ff0e
movl -0x14(%rbp), %edi
leaq 0x109f3f(%rip), %rsi    # 0x139e39
movl $0x1, %edx
callq 0x26bc0
cmpq $-0x1, %rax
jne 0x2ff0c
jmp 0x2ff0e
jmp 0x2ff0e
cmpl $0x0, -0x18(%rbp)
jne 0x2ff1c
movl -0x14(%rbp), %edi
callq 0x26180
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)