// File: /workspace/github_cpp_makefile_star2_O1/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 0xabb8
movq %rdx, %r14
movq %rsi, %rbx
xorl %edi, %edi
callq 0x3260
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0xac34
leaq 0x174c(%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 0xaa42
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xaa49
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 0xaa99
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0xaaa1
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 0x1771(%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 0xaaf0
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xaaf7
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 0xab26
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xab3d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xab58
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 0xab80
movq %rbx, %rdi
callq 0x3300
jmp 0xaba1
callq 0x3040
movl (%rax), %ebx
movl %ebx, %edi
callq 0x3120
leaq 0x1b6f(%rip), %rdi      # 0xc704
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3050
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xabb8
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 0xabe6
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0xabe6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xac02
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0xac02
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xac1d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3520
nop