// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis.c
// Function: redisLogFromHandler
void redisLogFromHandler(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,"[",1) == -1) goto err;
    if (write(fd,buf,strlen(buf)) == -1) goto err;
    if (write(fd," | signal handler] (",20) == -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 0xeee1f(%rip), %rax     # 0x113ec8
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 0xeec94(%rip), %eax     # 0x113d5c
jl 0x250d9
cmpl $0x0, -0x18(%rbp)
je 0x250de
cmpl $0x0, 0xeeca5(%rip)     # 0x113d7c
je 0x250de
jmp 0x2528b
cmpl $0x0, -0x18(%rbp)
je 0x250ee
movl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x25109
movq 0xeedd3(%rip), %rdi     # 0x113ec8
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x1f640
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0x2511a
jmp 0x2528b
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0x1f410
movq -0x70(%rbp), %rdi
movslq %eax, %rdx
movl $0x40, %esi
callq 0x39660
movl -0x14(%rbp), %edi
leaq 0xb95d6(%rip), %rsi     # 0xde718
movl $0x1, %edx
callq 0x1fb50
cmpq $-0x1, %rax
jne 0x25157
jmp 0x2527d
movl -0x14(%rbp), %eax
movl %eax, -0x7c(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x1f4d0
movl -0x7c(%rbp), %edi
movq -0x78(%rbp), %rsi
movq %rax, %rdx
callq 0x1fb50
cmpq $-0x1, %rax
jne 0x25188
jmp 0x2527d
movl -0x14(%rbp), %edi
leaq 0xb9588(%rip), %rsi     # 0xde71a
movl $0x14, %edx
callq 0x1fb50
cmpq $-0x1, %rax
jne 0x251a7
jmp 0x2527d
leaq -0x60(%rbp), %rax
movq %rax, -0x98(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x1fc70
movq -0x98(%rbp), %rdi
movq %rax, %rdx
movl $0x40, %esi
callq 0x39660
movl -0x14(%rbp), %eax
movl %eax, -0x8c(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x1f4d0
movl -0x8c(%rbp), %edi
movq -0x88(%rbp), %rsi
movq %rax, %rdx
callq 0x1fb50
cmpq $-0x1, %rax
jne 0x25209
jmp 0x2527d
movl -0x14(%rbp), %edi
leaq 0xc2b76(%rip), %rsi     # 0xe7d89
movl $0x2, %edx
callq 0x1fb50
cmpq $-0x1, %rax
jne 0x25225
jmp 0x2527d
movl -0x14(%rbp), %eax
movl %eax, -0xa4(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1f4d0
movl -0xa4(%rbp), %edi
movq -0xa0(%rbp), %rsi
movq %rax, %rdx
callq 0x1fb50
cmpq $-0x1, %rax
jne 0x2525f
jmp 0x2527d
movl -0x14(%rbp), %edi
leaq 0xbb550(%rip), %rsi     # 0xe07b9
movl $0x1, %edx
callq 0x1fb50
cmpq $-0x1, %rax
jne 0x2527b
jmp 0x2527d
jmp 0x2527d
cmpl $0x0, -0x18(%rbp)
jne 0x2528b
movl -0x14(%rbp), %edi
callq 0x1f170
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)