// File: /workspace/github_cpp_makefile_star2_O1/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 0x1649(%rip), %rsi      # 0xc51f
callq 0x3310
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0xb0f8
movq %rsp, -0x98(%rbp)
movq 0x53fa(%rip), %rax      # 0x102f0
movq %rsp, %rcx
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rax
movq %rcx, %rsp
xorl %r14d, %r14d
leaq -0x70(%rbp), %rbx
xorl %r12d, %r12d
movq %rcx, -0xa0(%rbp)
movq 0x53ce(%rip), %r15      # 0x102f0
subq %r12, %r15
addq %rax, %r12
movl $0x1, %esi
movq %r12, %rdi
movq %r15, %rdx
movq -0x48(%rbp), %rcx
movq %rax, %r13
callq 0x33f0
cmpq %r15, %rax
movzbl %r14b, %r14d
movl $0x1, %ecx
cmovbl %ecx, %r14d
movq %r14, -0xa8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq %r12, %r14
addq %rax, %r14
movq %r13, %r15
movq %r13, %r12
cmpq %r14, %r13
jae 0xafef
movzbl (%r15), %eax
cmpl $0xd, %eax
je 0xaf84
cmpl $0xa, %eax
jne 0xaf8c
incq %r15
incq %r12
jmp 0xafea
movzbl 0x1(%r12), %eax
incq %r12
cmpl $0xd, %eax
je 0xaf9f
cmpl $0xa, %eax
jne 0xafea
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x513e
leaq -0x40(%rbp), %rdi
movq %r13, %rsi
callq 0xb656
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xafe7
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3290
movq %r12, %r15
cmpq %r14, %r12
jb 0xaf76
movq -0x40(%rbp), %rax
cmpq %rax, -0x38(%rbp)
je 0xb05e
movl $0x8, %r14d
xorl %r13d, %r13d
leaq -0x60(%rbp), %rcx
movq %rcx, -0x70(%rbp)
movq -0x8(%rax,%r14), %rsi
movq (%rax,%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x773e
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0xb174
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xb043
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3290
incq %r13
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r14
cmpq %rcx, %r13
jb 0xb002
subq %r15, %r12
movq -0xa0(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x34b0
leaq -0x40(%rbp), %rdi
callq 0xb5fa
movq %r14, %rax
movq -0xa8(%rbp), %r14
testb $0x1, %r14b
je 0xaf1b
leaq -0xb8(%rbp), %r14
movq %r14, -0x10(%r14)
addq %rax, %r12
leaq -0xc8(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x513e
movq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0xb174
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0xb0dd
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3290
movq -0x48(%rbp), %rbx
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, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0xb16c
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3290
jmp 0xb16c
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xb163
movq -0x80(%rbp), %rsi
jmp 0xb156
jmp 0xb160
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xb163
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3290
jmp 0xb163
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xb5fa
movq %rbx, %rdi
callq 0x3520