// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x107a87(%rip), %rax    # 0x1374c0
movq %rax, -0x20(%rbp)
movq 0x107a84(%rip), %rax    # 0x1374c8
movq %rax, -0x18(%rbp)
leaq 0x107f10(%rip), %rax    # 0x13795f
movq %rax, -0x28(%rbp)
movl -0x4(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
movl %eax, -0x74(%rbp)
movq 0x148f13(%rip), %rax    # 0x178978
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x78(%rbp)
movl -0x4(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x148d46(%rip), %eax    # 0x1787d0
jge 0x2fa91
jmp 0x2fc52
cmpl $0x0, -0x78(%rbp)
je 0x2faaa
movq 0x14355a(%rip), %rax    # 0x172ff8
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x2fac4
movq 0x148ec7(%rip), %rdi    # 0x178978
leaq 0x11bd51(%rip), %rsi    # 0x14b809
callq 0x26ae0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2fadb
jmp 0x2fc52
cmpl $0x0, -0x74(%rbp)
je 0x2fafc
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x116b96(%rip), %rsi    # 0x146686
movb $0x0, %al
callq 0x26ba0
jmp 0x2fc17
callq 0x26420
movl %eax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x26310
leaq -0x70(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x26bb0
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl $0x40, %esi
leaq 0x107e20(%rip), %rdx    # 0x137964
callq 0x26bf0
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
movslq -0x7c(%rbp), %rax
addq %rax, %rdi
movslq -0x7c(%rbp), %rax
movl $0x40, %esi
subq %rax, %rsi
movq -0x88(%rbp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movl %eax, %ecx
leaq 0x107df9(%rip), %rdx    # 0x137974
movb $0x0, %al
callq 0x26120
cmpl $0x0, 0x1486eb(%rip)    # 0x178274
je 0x2fb97
movl $0x58, -0x94(%rbp)
jmp 0x2fbd1
movl -0x98(%rbp), %eax
cmpl 0x148635(%rip), %eax    # 0x1781d8
je 0x2fbb1
movl $0x43, -0x94(%rbp)
jmp 0x2fbcf
movq 0x148e48(%rip), %rdx    # 0x178a00
movl $0x4d, %eax
movl $0x53, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movl %eax, -0x94(%rbp)
jmp 0x2fbd1
movq -0x30(%rbp), %rax
movq %rax, -0xb0(%rbp)
callq 0x26420
movq -0xb0(%rbp), %rdi
movl %eax, %edx
movl -0x94(%rbp), %ecx
leaq -0x70(%rbp), %r8
movq -0x28(%rbp), %rax
movslq -0x4(%rbp), %rsi
movsbl (%rax,%rsi), %r9d
movq -0x10(%rbp), %rax
leaq 0x107d6d(%rip), %rsi    # 0x137979
movq %rax, (%rsp)
movb $0x0, %al
callq 0x26ba0
movq -0x30(%rbp), %rdi
callq 0x26cf0
cmpl $0x0, -0x78(%rbp)
jne 0x2fc2f
movq -0x30(%rbp), %rdi
callq 0x26a10
cmpl $0x0, 0x148d4a(%rip)    # 0x178980
je 0x2fc52
movslq -0x4(%rbp), %rax
movl -0x20(%rbp,%rax,4), %edi
movq -0x10(%rbp), %rdx
leaq 0x116a3b(%rip), %rsi    # 0x146686
movb $0x0, %al
callq 0x26190
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)