// File: /workspace/github_cpp_makefile_star2_O3/tylerkaraszewski[P]Argyle/Logger.cpp
// Function: Logger::log(_IO_FILE*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Logger::log(FILE* file, const string& msg)
{
  if (file != NULL)
  {
    string logline = Utils::llToString(time(NULL)) + "\t" + msg + "\n";
    size_t bytesWritten = fwrite(logline.c_str(), 1, logline.size(), file);
    if (bytesWritten != logline.size())
    {
      // This wont actually go anywhere.
      printf("Log writing error %d (%s).\n", errno, strerror(errno));
    }
    else
    {
      fflush(file); // Can take this out for performance reasons if required.
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
testq %rsi, %rsi
je 0xab40
movq %rdx, %r14
movq %rsi, %rbx
xorl %edi, %edi
callq 0x3260
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0xabbc
leaq 0x17c4(%rip), %rsi      # 0xc15f
movq %r15, %rdi
callq 0x3560
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xa9ca
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xa9d1
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
callq 0x30f0
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xaa21
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xaa29
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x17e9(%rip), %rsi      # 0xc235
callq 0x3560
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xaa78
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xaa7f
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0xaaae
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xaac5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaae0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x3570
cmpq 0x10(%rsp), %rax
jne 0xab08
movq %rbx, %rdi
callq 0x3300
jmp 0xab29
callq 0x3040
movl (%rax), %ebx
movl %ebx, %edi
callq 0x3120
leaq 0x1be7(%rip), %rdi      # 0xc704
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xab40
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0xab6e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0xab6e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xab8a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0xab8a
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaba5
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3520
nop