// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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 0xd2272(%rip), %r13d    # 0x101ea0
jl 0x2fd9e
movq %rsi, %r12
movq 0xd240a(%rip), %rdi     # 0x102048
movb (%rdi), %bl
testb %bl, %bl
je 0x2fc55
leaq 0xa1c9e(%rip), %rsi     # 0xd18e9
callq 0x26ae0
movq %rax, %r14
jmp 0x2fc5f
movq 0xcd38c(%rip), %rax     # 0xfcfe8
movq (%rax), %r14
testq %r14, %r14
je 0x2fd9e
btl $0xa, %ebp
jb 0x2fd58
movq %r12, %rbp
callq 0x26420
movl %eax, 0xc(%rsp)
leaq 0x10(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x26300
movq %r15, %rdi
callq 0x26ba0
leaq 0x8cd58(%rip), %rdx     # 0xbc9f4
leaq 0x20(%rsp), %rdi
movl $0x40, %r12d
movl $0x40, %esi
movq %rax, %rcx
callq 0x26be0
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 0x8cd24(%rip), %rdx     # 0xbca04
movq %r12, %rsi
xorl %eax, %eax
callq 0x26120
movl $0x58, %r15d
cmpl $0x0, 0xd1c4d(%rip)     # 0x101944
jne 0x2fd22
movl $0x43, %r15d
movl 0xc(%rsp), %eax
cmpl 0xd1b9f(%rip), %eax     # 0x1018a8
jne 0x2fd22
cmpq $0x0, 0xd23bd(%rip)     # 0x1020d0
movl $0x4d, %eax
movl $0x53, %r15d
cmovel %eax, %r15d
callq 0x26420
leaq 0x8ccc1(%rip), %rcx     # 0xbc9ef
movsbl (%r13,%rcx), %r9d
movq %rbp, %r12
movq %rbp, (%rsp)
leaq 0x8ccc7(%rip), %rsi     # 0xbca09
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movl %eax, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x26b90
jmp 0x2fd63
movq %r12, %rdi
movq %r14, %rsi
callq 0x26710
movq %r14, %rdi
callq 0x26ce0
testb %bl, %bl
je 0x2fd77
movq %r14, %rdi
callq 0x26a10
cmpl $0x0, 0xd22d2(%rip)     # 0x102050
je 0x2fd9e
movl %r13d, %eax
leaq 0x8c796(%rip), %rcx     # 0xbc520
movl (%rcx,%rax,4), %edi
leaq 0x9cbe6(%rip), %rsi     # 0xcc97a
movq %r12, %rdx
xorl %eax, %eax
callq 0x26190
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq