// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
leaq -0x240(%rbp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x9920
movq (%r15), %rax
movq -0x18(%rax), %rax
movl -0x220(%rbp,%rax), %r15d
testl %r15d, %r15d
je 0x3e354
movq 0x48d11(%rip), %rdi     # 0x86ff0
leaq 0x2ed82(%rip), %rsi     # 0x6d068
movl $0x16, %edx
callq 0x9560
movq 0x48cf9(%rip), %rdi     # 0x86ff0
leaq 0x30ec4(%rip), %rsi     # 0x6f1c2
movl $0x1, %edx
callq 0x9560
movq 0x48ce1(%rip), %rdi     # 0x86ff0
movl $0x110, %esi            # imm = 0x110
callq 0x9880
movq %rax, %rbx
leaq 0x2edd2(%rip), %rsi     # 0x6d0f5
movl $0x15, %edx
movq %rax, %rdi
callq 0x9560
testq %r14, %r14
je 0x3e4eb
movq %r14, %rdi
callq 0x9200
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x9560
jmp 0x3e504
movl %r15d, -0x2c(%rbp)
movq -0x240(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x220(%rbp,%rax)
jne 0x3e4d9
leaq (%rax,%rbp), %rdi
addq $-0x240, %rdi           # imm = 0xFDC0
leaq -0x341(%rbp), %r14
movabsq $0x100000000, %r15      # imm = 0x100000000
movq %r13, -0x38(%rbp)
movl $0xa, %esi
callq 0x9480
movsbl %al, %ecx
movl $0x100, %edx            # imm = 0x100
leaq -0x240(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x9980
movzbl -0x340(%rbp), %eax
movq %r14, %rbx
movq %r14, %r12
cmpq $0x23, %rax
ja 0x3e400
movabsq $0x800002401, %rcx      # imm = 0x800002401
btq %rax, %rcx
movq %r14, %rbx
movq %r14, %r12
jae 0x3e400
movq -0x240(%rbp), %rax
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %rdi
addq $-0x240, %rdi           # imm = 0xFDC0
testb $0x2, 0x20(%rdi)
je 0x3e391
jmp 0x3e4d9
movsbl 0x1(%r12), %edi
incq %r12
callq 0x90c0
incq %rbx
testl %eax, %eax
jne 0x3e400
movb (%r12), %al
movq %r12, %r14
cmpb $0x3d, %al
je 0x3e43a
movq %r12, %r14
movsbl %al, %edi
callq 0x90c0
testl %eax, %eax
jne 0x3e43a
movb 0x1(%r14), %al
incq %r14
cmpb $0x3d, %al
jne 0x3e423
movl %r14d, %eax
subl %ebx, %eax
movslq %eax, %rbx
leaq -0x440(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x9270
movb $0x0, -0x440(%rbp,%rbx)
incq %r14
movsbl (%r14), %edi
cmpl $0x3d, %edi
je 0x3e45c
callq 0x90c0
testl %eax, %eax
jne 0x3e45c
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
movq %r14, %r13
addq %r15, %r12
movsbl (%r13), %ebx
movl %ebx, %edi
callq 0x90c0
testl %ebx, %ebx
je 0x3e498
incq %r13
testl %eax, %eax
je 0x3e47e
sarq $0x20, %r12
leaq -0x540(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x9270
movb $0x0, -0x540(%rbp,%r12)
movq -0x38(%rbp), %rdi
leaq -0x440(%rbp), %rsi
movq %rbx, %rdx
callq 0x3d910
leaq -0x341(%rbp), %r14
jmp 0x3e3df
leaq -0x240(%rbp), %rdi
callq 0x9120
movl -0x2c(%rbp), %r15d
jmp 0x3e53f
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x9860
leaq 0x2ebfe(%rip), %rsi     # 0x6d109
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
testl %r15d, %r15d
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 0x3e567
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
callq 0x9170
movq %rbx, %rdi
callq 0x98b0