// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/ParamEngine.cpp
// Function: ParamEngine::ParseFromConfigFile(char const*)
bool ParamEngine::ParseFromConfigFile(const char *file_name) {
  static const int LINE_SIZE = 256;
  char line[LINE_SIZE];
  char name[256];
  char buffer[256];
  std::ifstream config_file(file_name);
  char *p, *q;
  int n;

  if (config_file.good()) {
    while (!config_file.eof()) {
      config_file.getline(line, LINE_SIZE);
      if (line[0] == '#' || line[0] == '\0' || line[0] == '\n' ||
          line[0] == '\r') {
        continue;
      }
      p = line;
      while (isspace(*p))
        p++;
      q = p;
      while (*q != '=' && !isspace(*q))
        q++;
      n = q - p;
      strncpy(name, p, n * sizeof(char));
      name[n] = 0;
      p = q + 1;
      while (*p == '=' || isspace(*p))
        p++;
      q = p;
      while (!isspace(*q) && *q != '\0')
        q++;
      n = q - p;
      strncpy(buffer, p, n * sizeof(char));
      buffer[n] = 0;
      SetParamFromString(name, buffer);
    }
    config_file.close();
    return true;
  } else {
    std::cerr << __FILE__ << ":" << __LINE__ << ": can not open file \'"
              << file_name << "\'" << std::endl;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x518, %rsp            # imm = 0x518
movq %rsi, %r14
movq %rdi, %r12
leaq -0x240(%rbp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x9920
movq (%r15), %rax
movq -0x18(%rax), %rax
movl -0x220(%rbp,%rax), %ecx
movl %ecx, -0x2c(%rbp)
testl %ecx, %ecx
je 0x3d3b3
movq 0x46cb2(%rip), %rdi     # 0x83ff0
leaq 0x2dd13(%rip), %rsi     # 0x6b058
movl $0x16, %edx
callq 0x9560
movq 0x46c9a(%rip), %rdi     # 0x83ff0
leaq 0x2fe35(%rip), %rsi     # 0x6d192
movl $0x1, %edx
callq 0x9560
movq 0x46c82(%rip), %rdi     # 0x83ff0
movl $0x110, %esi            # imm = 0x110
callq 0x9880
movq %rax, %rbx
leaq 0x2dd63(%rip), %rsi     # 0x6b0e5
movl $0x15, %edx
movq %rax, %rdi
callq 0x9560
testq %r14, %r14
je 0x3d527
movq %r14, %rdi
callq 0x9200
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x9560
jmp 0x3d540
leaq (%rax,%rbp), %rdi
addq $-0x240, %rdi           # imm = 0xFDC0
leaq -0x440(%rbp), %r13
movabsq $0x100000000, %r14      # imm = 0x100000000
movq %r12, -0x38(%rbp)
movl $0xa, %esi
callq 0x9480
movsbl %al, %ecx
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
movq %r13, %rsi
callq 0x9980
movzbl -0x440(%rbp), %ebx
cmpq $0x23, %rbx
ja 0x3d42e
movabsq $0x800002401, %rax      # imm = 0x800002401
btq %rbx, %rax
jae 0x3d42e
movq -0x240(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rdi
addq $-0x240, %rdi           # imm = 0xFDC0
testb $0x2, 0x20(%rdi)
je 0x3d3d3
jmp 0x3d519
movsbl %bl, %edi
callq 0x90c0
movq %r13, %r15
testl %eax, %eax
je 0x3d44e
movb 0x1(%r15), %bl
incq %r15
movsbl %bl, %edi
callq 0x90c0
jmp 0x3d439
movq %r15, %r13
cmpb $0x3d, %bl
je 0x3d471
movq %r15, %r13
movsbl %bl, %edi
callq 0x90c0
testl %eax, %eax
jne 0x3d471
movb 0x1(%r13), %bl
incq %r13
cmpb $0x3d, %bl
jne 0x3d459
movl %r13d, %eax
subl %r15d, %eax
movslq %eax, %rbx
leaq -0x340(%rbp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x9270
movb $0x0, -0x340(%rbp,%rbx)
incq %r13
movsbl (%r13), %edi
cmpl $0x3d, %edi
je 0x3d494
callq 0x90c0
testl %eax, %eax
jne 0x3d494
movabsq $-0x100000000, %r15     # imm = 0xFFFFFFFF00000000
movq %r13, %r12
addq %r14, %r15
movsbl (%r12), %ebx
movl %ebx, %edi
callq 0x90c0
testl %ebx, %ebx
je 0x3d4d1
incq %r12
testl %eax, %eax
je 0x3d4b7
sarq $0x20, %r15
leaq -0x540(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x9270
movb $0x0, -0x540(%rbp,%r15)
movq -0x38(%rbp), %rdi
leaq -0x340(%rbp), %rsi
movq %rbx, %rdx
callq 0x3c968
leaq -0x240(%rbp), %r15
leaq -0x440(%rbp), %r13
jmp 0x3d40d
leaq -0x240(%rbp), %rdi
callq 0x9120
jmp 0x3d57b
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x9860
leaq 0x2dbb2(%rip), %rsi     # 0x6b0f9
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9560
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
cmpl $0x0, -0x2c(%rbp)
sete %bl
leaq -0x240(%rbp), %rdi
callq 0x9170
movl %ebx, %eax
addq $0x518, %rsp            # imm = 0x518
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3d5a4
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
callq 0x9170
movq %rbx, %rdi
callq 0x98b0
nop