// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/ParamEngine.cpp
// Function: ParamEngine::SetParamFromString(char const*, char const*)
bool ParamEngine::SetParamFromString(const char *name, const char *buffer) {
  if (name != 0 && buffer != 0) {
    ParamPtr it;
    bool found = GetParam(name, it);
    if (found == true) {
      if (buffer[0] == '\0') {
        std::cerr << __FILE__ << ":" << __LINE__
                  << ": miss argument value of \'" << name << "\'" << std::endl;
        return false;
      }

      switch (it->type) {
      case V_INT:
        SetParam(name, atoi(buffer));
        break;
      case V_DOUBLE:
        SetParam(name, strtod(buffer, 0));
        break;
      case V_STRING: {
        int n = strlen(buffer);
        char *tmp = new char[n + 1];
        strcpy(tmp, buffer);
        if (tmp[0] == '\"') {
          tmp[n - 1] = '\0';
          SetParam(name, std::string(tmp + 1)); // strip qutoes
        } else {
          SetParam(name, std::string(tmp));
        }
        delete[] tmp;
      } break;
      case V_ONOFF:
        if (str_equal(buffer, "on") || str_equal(buffer, "true") ||
            str_equal(buffer, "1")) {
          SetParam(name, true);
        } else if (str_equal(buffer, "off") || str_equal(buffer, "false") ||
                   str_equal(buffer, "0")) {
          SetParam(name, false);
        } else {
          std::cerr << __FILE__ << ":" << __LINE__
                    << ": boolean value must be on/true or off/false of \'"
                    << name << "\'" << std::endl;
        }
        break;
      default:
        return false;
      }
      return true;
    } else {
      //			ParamPtr it;
      //			if (ServerParam::instance().GetParam(name, it)
      //== false && PlayerParam::instance().GetParam(name, it) == false){
      //				std::cerr << __FILE__ << ":" << __LINE__
      //<< ": unknown argument \'" << name << "\'" << std::endl;
      //			}
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x3ca96
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x30(%rbp), %rdx
movq $0x0, (%rdx)
callq 0x3c8d4
testb %al, %al
je 0x3ca96
movb (%r15), %r12b
testb %r12b, %r12b
je 0x3c9f2
movq -0x30(%rbp), %rax
movl 0x38(%rax), %eax
decl %eax
cmpl $0x3, %eax
ja 0x3ca96
leaq 0x2e669(%rip), %rcx     # 0x6b038
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x9790
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x3d5bc
jmp 0x3ccea
movq 0x475f7(%rip), %r14     # 0x83ff0
leaq 0x2e658(%rip), %rsi     # 0x6b058
movl $0x16, %edx
movq %r14, %rdi
callq 0x9560
leaq 0x3077e(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r14, %rdi
callq 0x9560
movq %r14, %rdi
movl $0x3c, %esi
callq 0x9880
movq %rax, %r14
leaq 0x2e637(%rip), %rsi     # 0x6b06f
movl $0x1a, %edx
movq %rax, %rdi
callq 0x9560
movq %rbx, %rdi
callq 0x9200
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x9560
leaq 0x2e697(%rip), %rsi     # 0x6b0f9
movl $0x1, %edx
movq %r14, %rdi
callq 0x9560
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r14, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x9200
movq %rax, %r13
shlq $0x20, %r13
movabsq $0x100000000, %rdi      # imm = 0x100000000
addq %r13, %rdi
sarq $0x20, %rdi
callq 0x9050
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x9450
cmpb $0x22, (%r12)
jne 0x3cb8d
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r13
sarq $0x20, %r13
movb $0x0, (%r12,%r13)
leaq 0x1(%r12), %r15
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
movq %r15, %rdi
callq 0x9200
leaq (%r12,%rax), %rdx
incq %rdx
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x1362e
movq %r14, %rdi
movq %rbx, %rsi
leaq -0x50(%rbp), %rdx
callq 0x3d7c0
movq -0x50(%rbp), %rdi
jmp 0x3cbc4
cmpb $0x6f, %r12b
jne 0x3cbe2
cmpb $0x6e, 0x1(%r15)
jne 0x3cb57
cmpb $0x0, 0x2(%r15)
je 0x3ccd0
leaq 0x2c76a(%rip), %rsi     # 0x692c8
movq %r15, %rdi
callq 0x9670
testl %eax, %eax
jne 0x3cc0a
jmp 0x3ccd0
movq %r15, %rdi
xorl %esi, %esi
callq 0x93a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3d6ba
jmp 0x3ccea
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq %r12, %rdi
callq 0x9200
movq %r12, %rdx
addq %rax, %rdx
leaq -0x70(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x1362e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3d7c0
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x3cbd5
movq (%r13), %rsi
incq %rsi
callq 0x94e0
movq %r12, %rdi
callq 0x9630
jmp 0x3ccea
leaq 0x2c6df(%rip), %rsi     # 0x692c8
movq %r15, %rdi
callq 0x9670
testl %eax, %eax
je 0x3ccd0
cmpb $0x31, %r12b
jne 0x3cc0a
cmpb $0x0, 0x1(%r15)
je 0x3ccd0
leaq 0x30693(%rip), %rsi     # 0x6d2a4
movq %r15, %rdi
callq 0x9670
testl %eax, %eax
je 0x3ccdd
leaq 0x2c6a6(%rip), %rsi     # 0x692ce
movq %r15, %rdi
callq 0x9670
testl %eax, %eax
je 0x3ccdd
cmpb $0x30, %r12b
jne 0x3cc49
cmpb $0x0, 0x1(%r15)
je 0x3ccdd
movq 0x473a0(%rip), %r14     # 0x83ff0
leaq 0x2e401(%rip), %rsi     # 0x6b058
movl $0x16, %edx
movq %r14, %rdi
callq 0x9560
leaq 0x30527(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r14, %rdi
callq 0x9560
movq %r14, %rdi
movl $0x5c, %esi
callq 0x9880
movq %rax, %r14
leaq 0x2e3fb(%rip), %rsi     # 0x6b08a
movl $0x31, %edx
movq %rax, %rdi
callq 0x9560
movq %rbx, %rdi
callq 0x9200
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x9560
leaq 0x2e440(%rip), %rsi     # 0x6b0f9
movl $0x1, %edx
movq %r14, %rdi
callq 0x9560
movq %r14, %rdi
callq 0x9240
jmp 0x3ccea
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
jmp 0x3cce5
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3d8c6
movb $0x1, %al
jmp 0x3ca98
movq %rax, %rbx
movq -0x70(%rbp), %rdi
jmp 0x3cd01
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x3cd12
movq (%r13), %rsi
incq %rsi
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0