// File: /workspace/github_c_makefile_star2_O2/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 0xce966(%rip), %r13d    # 0xf9ea0
jl 0x2b68a
movq %rsi, %rbx
movq 0xceafe(%rip), %rdi     # 0xfa048
movb (%rdi), %r15b
testb %r15b, %r15b
je 0x2b563
leaq 0x96e50(%rip), %rsi     # 0xc23a9
callq 0x26ae0
movq %rax, %r14
jmp 0x2b56d
movq 0xc9a7e(%rip), %rax     # 0xf4fe8
movq (%rax), %r14
testq %r14, %r14
je 0x2b68a
btl $0xa, %ebp
jb 0x2b5ef
callq 0x26420
movl %eax, 0xc(%rsp)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x26300
movq %rbp, %rdi
callq 0x26ba0
leaq 0x83341(%rip), %rdx     # 0xae8e4
leaq 0x20(%rsp), %rdi
pushq $0x40
popq %r12
movq %r12, %rsi
movq %rax, %rcx
callq 0x26be0
cltq
leaq (%rsp,%rax), %rdi
addq $0x20, %rdi
subq %rax, %r12
movl 0x8(%rbp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
leaq 0x8331e(%rip), %rdx     # 0xae8f4
movq %r12, %rsi
movl %eax, %ecx
xorl %eax, %eax
callq 0x26120
cmpl $0x0, 0xce35b(%rip)     # 0xf9944
je 0x2b5fc
pushq $0x58
jmp 0x2b61d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26710
jmp 0x2b64e
movl 0xc(%rsp), %eax
cmpl 0xce2a2(%rip), %eax     # 0xf98a8
jne 0x2b61b
cmpq $0x0, 0xceac0(%rip)     # 0xfa0d0
pushq $0x4d
popq %rax
pushq $0x53
popq %rbp
cmovel %eax, %ebp
jmp 0x2b61e
pushq $0x43
popq %rbp
callq 0x26420
leaq 0x832b5(%rip), %rcx     # 0xae8df
movsbl (%r13,%rcx), %r9d
movq %rbx, (%rsp)
leaq 0x832be(%rip), %rsi     # 0xae8f9
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x26b90
movq %r14, %rdi
callq 0x26ce0
testb %r15b, %r15b
je 0x2b663
movq %r14, %rdi
callq 0x26a10
cmpl $0x0, 0xce9e6(%rip)     # 0xfa050
je 0x2b68a
movl %r13d, %eax
leaq 0x82d9a(%rip), %rcx     # 0xae410
movl (%rcx,%rax,4), %edi
leaq 0x91f46(%rip), %rsi     # 0xbd5c6
movq %rbx, %rdx
xorl %eax, %eax
callq 0x26190
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq