// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/server.c
// Function: serverLogRaw
void serverLogRaw(int level, const char *msg) {
    const int syslogLevelMap[] = { LOG_DEBUG, LOG_INFO, LOG_NOTICE, LOG_WARNING };
    const char *c = ".-*#";
    FILE *fp;
    char buf[64];
    int rawmode = (level & LL_RAW);
    int log_to_stdout = server.logfile[0] == '\0';

    level &= 0xff; /* clear flags */
    if (level < server.verbosity) return;

    fp = log_to_stdout ? stdout : fopen(server.logfile,"a");
    if (!fp) return;

    if (rawmode) {
        fprintf(fp,"%s",msg);
    } else {
        int off;
        struct timeval tv;
        int role_char;
        pid_t pid = getpid();

        gettimeofday(&tv,NULL);
        off = strftime(buf,sizeof(buf),"%d %b %H:%M:%S.",localtime(&tv.tv_sec));
        snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000);
        if (server.sentinel_mode) {
            role_char = 'X'; /* Sentinel. */
        } else if (pid != server.pid) {
            role_char = 'C'; /* RDB / AOF writing child. */
        } else {
            role_char = (server.masterhost ? 'S':'M'); /* Slave or Master. */
        }
        fprintf(fp,"%d:%c %s %c %s\n",
            (int)getpid(),role_char, buf,c[level],msg);
    }
    fflush(fp);

    if (!log_to_stdout) fclose(fp);
    if (server.syslog_enabled) syslog(syslogLevelMap[level], "%s", msg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edi, %ebp
movzbl %bpl, %r13d
cmpl 0xd4119(%rip), %r13d    # 0x106e40
jl 0x32e97
movq %rsi, %r12
movq 0xd42b1(%rip), %rdi     # 0x106fe8
movb (%rdi), %bl
testb %bl, %bl
je 0x32d4e
leaq 0xa1a45(%rip), %rsi     # 0xd4789
callq 0x26af0
movq %rax, %r14
jmp 0x32d58
movq 0xcf293(%rip), %rax     # 0x101fe8
movq (%rax), %r14
testq %r14, %r14
je 0x32e97
btl $0xa, %ebp
jb 0x32e51
movq %r12, %rbp
callq 0x26430
movl %eax, 0xc(%rsp)
leaq 0x10(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x26310
movq %r15, %rdi
callq 0x26bb0
leaq 0x8cbed(%rip), %rdx     # 0xbf982
leaq 0x20(%rsp), %rdi
movl $0x40, %r12d
movl $0x40, %esi
movq %rax, %rcx
callq 0x26bf0
cltq
leaq (%rsp,%rax), %rdi
addq $0x20, %rdi
subq %rax, %r12
movslq 0x8(%r15), %rax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0x26, %rcx
addl %eax, %ecx
leaq 0x8cbb9(%rip), %rdx     # 0xbf992
movq %r12, %rsi
xorl %eax, %eax
callq 0x26120
movl $0x58, %r15d
cmpl $0x0, 0xd3b04(%rip)     # 0x1068f4
jne 0x32e1b
movl $0x43, %r15d
movl 0xc(%rsp), %eax
cmpl 0xd3a56(%rip), %eax     # 0x106858
jne 0x32e1b
cmpq $0x0, 0xd4264(%rip)     # 0x107070
movl $0x4d, %eax
movl $0x53, %r15d
cmovel %eax, %r15d
callq 0x26430
leaq 0x8cb56(%rip), %rcx     # 0xbf97d
movsbl (%r13,%rcx), %r9d
movq %rbp, %r12
movq %rbp, (%rsp)
leaq 0x8cb5c(%rip), %rsi     # 0xbf997
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movl %eax, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x26ba0
jmp 0x32e5c
movq %r12, %rdi
movq %r14, %rsi
callq 0x26720
movq %r14, %rdi
callq 0x26cf0
testb %bl, %bl
je 0x32e70
movq %r14, %rdi
callq 0x26a20
cmpl $0x0, 0xd4179(%rip)     # 0x106ff0
je 0x32e97
movl %r13d, %eax
leaq 0x8c64d(%rip), %rcx     # 0xbf4d0
movl (%rcx,%rax,4), %edi
leaq 0x9c9ed(%rip), %rsi     # 0xcf87a
movq %r12, %rdx
xorl %eax, %eax
callq 0x26190
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq