// File: /workspace/github_cpp_makefile_star2_O2/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 $0x528, %rsp            # imm = 0x528
movq %rsi, %r14
movq %rdi, %r15
leaq -0x348(%rbp), %rbx
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x9920
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl -0x328(%rbp,%rax), %ecx
movl %ecx, -0x2c(%rbp)
testl %ecx, %ecx
je 0x344a0
movq 0x42bae(%rip), %rdi     # 0x76ff0
leaq 0x24bcf(%rip), %rsi     # 0x59018
callq 0x94b0
leaq 0x26d1d(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x110, %esi            # imm = 0x110
callq 0x9890
leaq 0x24c34(%rip), %rsi     # 0x590a5
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x94b0
leaq 0x24c2e(%rip), %rsi     # 0x590b9
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
jmp 0x34625
movq %r15, -0x38(%rbp)
leaq -0x141(%rbp), %rbx
testb $0x2, -0x328(%rbp,%rax)
jne 0x34619
movl $0x100, %edx            # imm = 0x100
leaq -0x348(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x91c0
movzbl -0x140(%rbp), %eax
leaq -0x13f(%rbp), %rdx
movq %rdx, %rcx
movq %rbx, %r13
cmpq $0x23, %rax
ja 0x3450e
movabsq $0x800002401, %rcx      # imm = 0x800002401
btq %rax, %rcx
movq %rdx, %rcx
movq %rbx, %r13
jae 0x3450e
movq -0x348(%rbp), %rax
movq -0x18(%rax), %rax
jmp 0x344ab
movq %rdx, %r12
movq %rcx, %r15
movb 0x1(%r13), %r14b
incq %r13
movsbl %r14b, %edi
callq 0x90b0
leaq 0x1(%r12), %rdx
leaq 0x1(%r15), %rcx
testl %eax, %eax
jne 0x3450e
xorl %ecx, %ecx
movq %r13, %rbx
cmpb $0x3d, %r14b
je 0x3456b
movsbl %r14b, %edi
movq %rcx, %r14
callq 0x90b0
movq %r14, %rcx
testl %eax, %eax
jne 0x3456b
movb 0x1(%rbx), %r14b
incq %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rcx
incq %r12
incq %r15
jmp 0x34536
sarq $0x20, %rcx
leaq -0x450(%rbp), %rdi
movq %r13, %rsi
movq %rcx, %rbx
movq %rcx, %rdx
callq 0x9290
movb $0x0, -0x450(%rbp,%rbx)
movq -0x38(%rbp), %r15
movsbl (%r12), %edi
cmpl $0x3d, %edi
je 0x345a3
callq 0x90b0
testl %eax, %eax
je 0x345a8
incq %r12
jmp 0x34590
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movq %r12, %r14
movsbl (%r14), %r13d
movl %r13d, %edi
callq 0x90b0
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rcx, %rbx
testl %r13d, %r13d
je 0x345da
incq %r14
testl %eax, %eax
je 0x345b5
sarq $0x20, %rbx
leaq -0x550(%rbp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x9290
movb $0x0, -0x550(%rbp,%rbx)
movq %r15, %rdi
leaq -0x450(%rbp), %rsi
movq %r14, %rdx
callq 0x33c8a
leaq -0x141(%rbp), %rbx
jmp 0x34501
leaq -0x348(%rbp), %rdi
callq 0x9120
cmpl $0x0, -0x2c(%rbp)
sete %bl
leaq -0x348(%rbp), %rdi
callq 0x9180
movl %ebx, %eax
addq $0x528, %rsp            # imm = 0x528
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3464e
movq %rax, %rbx
leaq -0x348(%rbp), %rdi
callq 0x9180
movq %rbx, %rdi
callq 0x98b0
nop