// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x3dc7b
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
leaq -0x40(%rbp), %rdx
movq $0x0, (%rdx)
callq 0x3d88c
movl %eax, %ebx
testb %bl, %bl
je 0x3dc77
cmpb $0x0, (%r12)
je 0x3d99b
movq -0x40(%rbp), %rax
movl 0x38(%rax), %eax
decl %eax
cmpl $0x3, %eax
ja 0x3da3f
leaq 0x2f6d0(%rip), %rcx     # 0x6d048
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r12, %rdi
callq 0x9790
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x3e57e
jmp 0x3dc75
movq 0x4964e(%rip), %r15     # 0x86ff0
leaq 0x2f6bf(%rip), %rsi     # 0x6d068
movl $0x16, %edx
movq %r15, %rdi
callq 0x9560
leaq 0x31805(%rip), %rsi     # 0x6f1c2
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq %r15, %rdi
movl $0x3c, %esi
callq 0x9880
movq %rax, %r15
leaq 0x2f69e(%rip), %rsi     # 0x6d07f
movl $0x1a, %edx
movq %rax, %rdi
callq 0x9560
movq %r14, %rdi
callq 0x9200
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x9560
leaq 0x2f6fe(%rip), %rsi     # 0x6d109
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r15, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
xorl %eax, %eax
jmp 0x3dc77
movq %r12, %rdi
callq 0x9200
movq %rax, %r13
shlq $0x20, %r13
movabsq $0x100000000, %rdi      # imm = 0x100000000
addq %r13, %rdi
sarq $0x20, %rdi
callq 0x9050
movq %rax, -0x38(%rbp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x9450
movq -0x38(%rbp), %rcx
cmpb $0x22, (%rcx)
jne 0x3dc23
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r13
sarq $0x20, %r13
movb $0x0, (%rcx,%r13)
leaq 0x1(%rcx), %r12
leaq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %rax, -0x10(%rax)
movq %rcx, %r13
movq %r12, %rdi
callq 0x9200
leaq (%rax,%r13), %rdx
incq %rdx
leaq -0x60(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x13766
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x3e7a0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %r13
jmp 0x3dc5b
leaq 0x317f7(%rip), %rsi     # 0x6f2e7
movq %r12, %rdi
callq 0x9670
testl %eax, %eax
je 0x3dc11
leaq 0x2d7c1(%rip), %rsi     # 0x6b2c8
movq %r12, %rdi
callq 0x9670
testl %eax, %eax
je 0x3dc11
leaq 0x301a9(%rip), %rsi     # 0x6dcc7
movq %r12, %rdi
callq 0x9670
testl %eax, %eax
je 0x3dc11
leaq 0x3179f(%rip), %rsi     # 0x6f2d4
movq %r12, %rdi
callq 0x9670
testl %eax, %eax
je 0x3dc8e
leaq 0x2d782(%rip), %rsi     # 0x6b2ce
movq %r12, %rdi
callq 0x9670
testl %eax, %eax
je 0x3dc8e
leaq 0x2ec48(%rip), %rsi     # 0x6c7ab
movq %r12, %rdi
callq 0x9670
testl %eax, %eax
je 0x3dc8e
movq 0x49476(%rip), %r15     # 0x86ff0
leaq 0x2f4e7(%rip), %rsi     # 0x6d068
movl $0x16, %edx
movq %r15, %rdi
callq 0x9560
leaq 0x3162d(%rip), %rsi     # 0x6f1c2
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq %r15, %rdi
movl $0x5c, %esi
callq 0x9880
movq %rax, %r15
leaq 0x2f4e1(%rip), %rsi     # 0x6d09a
movl $0x31, %edx
movq %rax, %rdi
callq 0x9560
movq %r14, %rdi
callq 0x9200
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x9560
leaq 0x2f526(%rip), %rsi     # 0x6d109
movl $0x1, %edx
movq %r15, %rdi
callq 0x9560
movq %r15, %rdi
callq 0x9240
jmp 0x3dc75
movq %r12, %rdi
xorl %esi, %esi
callq 0x93a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e68a
jmp 0x3dc75
movq %r15, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x3e8b0
jmp 0x3dc75
leaq -0x70(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rcx, %r12
movq %rcx, %rdi
callq 0x9200
movq %r12, %rdx
addq %rax, %rdx
leaq -0x80(%rbp), %rdi
movq %r12, %rsi
callq 0x13766
movq %r15, %rdi
movq %r14, %rsi
leaq -0x80(%rbp), %rdx
callq 0x3e7a0
movq -0x80(%rbp), %rdi
cmpq %r13, %rdi
je 0x3dc6c
movq (%r13), %rsi
incq %rsi
callq 0x94e0
movq -0x38(%rbp), %rdi
callq 0x9630
movb $0x1, %al
testb %bl, %bl
jne 0x3dc7d
xorl %eax, %eax
andb $0x1, %al
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
jmp 0x3dc1c
movq %rax, %rbx
movq -0x80(%rbp), %rdi
movq %r13, -0x30(%rbp)
cmpq %r13, %rdi
je 0x3dcb7
movq -0x30(%rbp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x94e0
movq %rbx, %rdi
callq 0x98b0
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
jne 0x3dca8
jmp 0x3dcb7
nop