// File: /workspace/github_c_makefile_star2_O0/erikdubbelboer[P]discnt/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 (pid != server.pid) {
            role_char = 'C'; /* DDB writing child. */
        } else {
            role_char = 'P'; /* Parent child. */
        }
        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 0x8ab77(%rip), %rax     # 0xa3490
movq %rax, -0x20(%rbp)
movq 0x8ab74(%rip), %rax     # 0xa3498
movq %rax, -0x18(%rbp)
leaq 0x8ac14(%rip), %rax     # 0xa3543
movq %rax, -0x28(%rbp)
movl -0x4(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
movl %eax, -0x74(%rbp)
movq 0xa6d93(%rip), %rax     # 0xbf6d8
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 0xa6d16(%rip), %eax     # 0xbf680
jge 0x18971
jmp 0x18b07
cmpl $0x0, -0x78(%rbp)
je 0x1898a
movq 0xa5632(%rip), %rax     # 0xbdfb0
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x189a4
movq 0xa6d47(%rip), %rdi     # 0xbf6d8
leaq 0x8cc6f(%rip), %rsi     # 0xa5607
callq 0x124e0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x189bb
jmp 0x18b07
cmpl $0x0, -0x74(%rbp)
je 0x189dc
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x8d6b0(%rip), %rsi     # 0xa6080
movb $0x0, %al
callq 0x124b0
jmp 0x18acc
callq 0x121d0
movl %eax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x12330
leaq -0x70(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x12090
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl $0x40, %esi
leaq 0x8ab24(%rip), %rdx     # 0xa3548
callq 0x126e0
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 0x90a0f(%rip), %rdx     # 0xa946a
movb $0x0, %al
callq 0x122c0
movl -0x98(%rbp), %eax
cmpl 0xa667a(%rip), %eax     # 0xbf0e8
je 0x18a7c
movl $0x43, -0x94(%rbp)
jmp 0x18a86
movl $0x50, -0x94(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xb0(%rbp)
callq 0x121d0
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 0x8aa97(%rip), %rsi     # 0xa3558
movq %rax, (%rsp)
movb $0x0, %al
callq 0x124b0
movq -0x30(%rbp), %rdi
callq 0x125c0
cmpl $0x0, -0x78(%rbp)
jne 0x18ae4
movq -0x30(%rbp), %rdi
callq 0x12200
cmpl $0x0, 0xa6bf5(%rip)     # 0xbf6e0
je 0x18b07
movslq -0x4(%rbp), %rax
movl -0x20(%rbp,%rax,4), %edi
movq -0x10(%rbp), %rdx
leaq 0x8d580(%rip), %rsi     # 0xa6080
movb $0x0, %al
callq 0x125e0
addq $0xc0, %rsp
popq %rbp
retq