// File: /workspace/github_cpp_makefile_star2_O3/tylerkaraszewski[P]Argyle/Config.cpp
// Function: Config::import()
void Config::import()
{

  FILE* file = fopen(m_configFile.c_str(), "r");
  if (file == NULL)
  {
    return;
  }

  char buffer[S_READ_SIZE];
  bool doneReading = false;
  size_t remaining = 0;
  while (!doneReading)
  {
    size_t readSize = S_READ_SIZE - remaining;
    size_t bytesRead = fread(buffer + remaining, 1, readSize, file);
    if (bytesRead < readSize)
    {
      doneReading = true;
    }

    // parse what we've read so far.
    vector<string> lines;
    char* start = buffer;
    char* end = buffer;
    while (end < (buffer + bytesRead + remaining))
    {
      // Skip to a useful character.
      if ((*start == '\n') || (*start == '\r'))
      {
        start++;
        end++;
        continue;
      }

      end++;
      if ((*end == '\n') || (*end == '\r'))
      {
        lines.push_back(string(start, end - start));
        start = end;
      }
    }
    for (size_t i = 0; i < lines.size(); i++)
    {
      parseLine(lines[i]);
    }
    remaining = end - start;
    memmove(buffer, start, remaining);
  }
  // We still have one line in the buffer if it didn't have a terminating newline.
  parseLine(string(buffer, remaining));

  int fileError = ferror(file);
  if (fileError)
  {
    // Log?
  }
  fclose(file);
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, -0x50(%rbp)
movq (%rdi), %rdi
leaq 0x16c1(%rip), %rsi      # 0xc51f
callq 0x3310
testq %rax, %rax
je 0xb074
movq %rsp, -0x98(%rbp)
movq 0x5476(%rip), %rcx      # 0x102f0
movq %rsp, %r14
addq $0xf, %rcx
andq $-0x10, %rcx
subq %rcx, %r14
movq %r14, %rsp
xorl %r12d, %r12d
leaq -0x70(%rbp), %r13
movq %rax, -0x48(%rbp)
movq %r14, -0xa0(%rbp)
movq 0x544c(%rip), %rdx      # 0x102f0
subq %r12, %rdx
addq %r14, %r12
movl $0x1, %esi
movq %r12, %rdi
movq %rdx, -0xb0(%rbp)
movq %rax, %rcx
callq 0x33f0
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq %r14, %rcx
movq %r12, %r14
movq %rax, -0xa8(%rbp)
addq %rax, %r14
movq %rcx, %r12
movq %rcx, %r15
cmpq %r14, %rcx
jae 0xafd6
movzbl (%r15), %eax
cmpl $0xd, %eax
je 0xaefd
cmpl $0xa, %eax
jne 0xaf05
incq %r15
incq %r12
jmp 0xaf63
movzbl 0x1(%r12), %eax
incq %r12
cmpl $0xd, %eax
je 0xaf18
cmpl $0xa, %eax
jne 0xaf63
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x513a
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0xb5d4
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xaf60
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3290
movq %r12, %r15
cmpq %r14, %r12
jb 0xaeef
movq -0x40(%rbp), %rax
cmpq %rax, -0x38(%rbp)
je 0xafd6
movl $0x8, %r14d
xorl %ebx, %ebx
leaq -0x60(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movq -0x8(%rax,%r14), %rsi
movq (%rax,%r14), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x76da
movq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0xb0f0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xafbb
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3290
incq %rbx
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r14
cmpq %rcx, %rbx
jb 0xaf7a
subq %r15, %r12
movq -0xa0(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x34b0
leaq -0x40(%rbp), %rdi
callq 0xb576
movq -0xa8(%rbp), %rax
cmpq -0xb0(%rbp), %rax
movq -0x48(%rbp), %rax
jae 0xae9d
leaq -0xc0(%rbp), %r15
movq %r15, -0x10(%r15)
addq %r14, %r12
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x513a
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0xb0f0
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
movq -0x48(%rbp), %rbx
je 0xb05d
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x3550
movq %rbx, %rdi
callq 0x3270
movq -0x98(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0xd0(%rbp), %rdi
cmpq %r15, %rdi
je 0xb0e8
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x3290
jmp 0xb0e8
movq %rax, %r14
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xb0df
movq -0x80(%rbp), %rsi
jmp 0xb0d7
jmp 0xb0be
movq %rax, %r14
jmp 0xb0df
movq %rax, %r14
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xb0df
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3290
leaq -0x40(%rbp), %rdi
callq 0xb576
movq %r14, %rdi
callq 0x3520