// File: 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
subq $0x5a0, %rsp            # imm = 0x5A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x560(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x528(%rbp), %rdi
movl $0x8, %edx
callq 0xab00
movq -0x528(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x528(%rbp,%rax), %rdi
callq 0xaa20
movb %al, -0x551(%rbp)
jmp 0x70723
movb -0x551(%rbp), %al
testb $0x1, %al
jne 0x70732
jmp 0x709fc
jmp 0x70734
movq -0x528(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x528(%rbp,%rax), %rdi
callq 0xab20
movb %al, -0x561(%rbp)
jmp 0x70754
movb -0x561(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x70765
jmp 0x709db
leaq -0x528(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0xa1f0
jmp 0x7077f
movsbl -0x120(%rbp), %eax
cmpl $0x23, %eax
je 0x707af
movsbl -0x120(%rbp), %eax
cmpl $0x0, %eax
je 0x707af
movsbl -0x120(%rbp), %eax
cmpl $0xa, %eax
je 0x707af
movsbl -0x120(%rbp), %eax
cmpl $0xd, %eax
jne 0x707d4
jmp 0x70734
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x548(%rbp)
movl %eax, -0x54c(%rbp)
leaq -0x528(%rbp), %rdi
callq 0xa1b0
jmp 0x70ade
leaq -0x120(%rbp), %rax
movq %rax, -0x530(%rbp)
movq -0x530(%rbp), %rax
movsbl (%rax), %edi
callq 0xa0d0
cmpl $0x0, %eax
je 0x7080a
movq -0x530(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x530(%rbp)
jmp 0x707e2
movq -0x530(%rbp), %rax
movq %rax, -0x538(%rbp)
movq -0x538(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3d, %ecx
movb %al, -0x562(%rbp)
je 0x7084c
movq -0x538(%rbp), %rax
movsbl (%rax), %edi
callq 0xa0d0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x562(%rbp)
movb -0x562(%rbp), %al
testb $0x1, %al
jne 0x70858
jmp 0x7086c
movq -0x538(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x538(%rbp)
jmp 0x70818
movq -0x538(%rbp), %rax
movq -0x530(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x53c(%rbp)
leaq -0x220(%rbp), %rdi
movq -0x530(%rbp), %rsi
movslq -0x53c(%rbp), %rdx
shlq $0x0, %rdx
callq 0xa2f0
movslq -0x53c(%rbp), %rax
movb $0x0, -0x220(%rbp,%rax)
movq -0x538(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x530(%rbp)
movq -0x530(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x3d, %ecx
movb %al, -0x563(%rbp)
je 0x708f4
movq -0x530(%rbp), %rax
movsbl (%rax), %edi
callq 0xa0d0
cmpl $0x0, %eax
setne %al
movb %al, -0x563(%rbp)
movb -0x563(%rbp), %al
testb $0x1, %al
jne 0x70900
jmp 0x70914
movq -0x530(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x530(%rbp)
jmp 0x708c2
movq -0x530(%rbp), %rax
movq %rax, -0x538(%rbp)
movq -0x538(%rbp), %rax
movsbl (%rax), %edi
callq 0xa0d0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x564(%rbp)
jne 0x70956
movq -0x538(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x564(%rbp)
movb -0x564(%rbp), %al
testb $0x1, %al
jne 0x70962
jmp 0x70976
movq -0x538(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x538(%rbp)
jmp 0x70922
movl -0x538(%rbp), %eax
movl -0x530(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x53c(%rbp)
movq -0x530(%rbp), %rsi
movslq -0x53c(%rbp), %rdx
leaq -0x320(%rbp), %rdi
movq %rdi, -0x570(%rbp)
callq 0xa2f0
movq -0x560(%rbp), %rdi
movq -0x570(%rbp), %rdx
movslq -0x53c(%rbp), %rax
movb $0x0, -0x320(%rbp,%rax)
leaq -0x220(%rbp), %rsi
callq 0x6fa90
jmp 0x709d6
jmp 0x70734
leaq -0x528(%rbp), %rdi
callq 0xa150
jmp 0x709e9
movb $0x1, -0x1(%rbp)
movl $0x1, -0x550(%rbp)
jmp 0x70ac4
movq 0x8d5ed(%rip), %rdi     # 0xfdff0
leaq 0x5258a(%rip), %rsi     # 0xc2f94
callq 0xa5a0
movq %rax, -0x578(%rbp)
jmp 0x70a18
movq -0x578(%rbp), %rdi
leaq 0x5482b(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, -0x580(%rbp)
jmp 0x70a34
movq -0x580(%rbp), %rdi
movl $0x110, %esi            # imm = 0x110
callq 0xaa40
movq %rax, -0x588(%rbp)
jmp 0x70a4e
movq -0x588(%rbp), %rdi
leaq 0x525c5(%rip), %rsi     # 0xc3021
callq 0xa5a0
movq %rax, -0x590(%rbp)
jmp 0x70a6a
movq -0x590(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa5a0
movq %rax, -0x598(%rbp)
jmp 0x70a83
movq -0x598(%rbp), %rdi
leaq 0x525a4(%rip), %rsi     # 0xc3035
callq 0xa5a0
movq %rax, -0x5a0(%rbp)
jmp 0x70a9f
movq -0x5a0(%rbp), %rdi
movq 0x8d503(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x70ab4
jmp 0x70ab6
movb $0x0, -0x1(%rbp)
movl $0x1, -0x550(%rbp)
leaq -0x528(%rbp), %rdi
callq 0xa1b0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbp
retq
movq -0x548(%rbp), %rdi
callq 0xaa60
nopw (%rax,%rax)