// File: /workspace/github_cpp_makefile_star2_O2/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 0x33d6f
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x38(%rbp), %rdx
andq $0x0, (%rdx)
callq 0x33c20
testb %al, %al
je 0x33d6f
movb (%r15), %r12b
testb %r12b, %r12b
je 0x33d11
movq -0x38(%rbp), %rax
movl 0x38(%rax), %eax
decl %eax
cmpl $0x3, %eax
ja 0x33d6f
leaq 0x2530a(%rip), %rcx     # 0x58ff8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
callq 0x97a0
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x34690
jmp 0x33f3f
movq 0x432d8(%rip), %rdi     # 0x76ff0
leaq 0x252f9(%rip), %rsi     # 0x59018
callq 0x94b0
leaq 0x27447(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
pushq $0x3c
popq %rsi
movq %rax, %rdi
callq 0x9890
leaq 0x252ea(%rip), %rsi     # 0x5902f
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x94b0
leaq 0x2535a(%rip), %rsi     # 0x590b9
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x9210
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 0x9470
cmpb $0x22, (%r12)
jne 0x33f00
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r13
sarq $0x20, %r13
movb $0x0, (%r12,%r13)
movq %r12, %rsi
incq %rsi
leaq -0x78(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x10e4a
leaq -0x78(%rbp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x347f4
leaq -0x78(%rbp), %rdi
jmp 0x33f23
cmpb $0x6f, %r12b
jne 0x33e17
cmpb $0x6e, 0x1(%r15)
jne 0x33e17
cmpb $0x0, 0x2(%r15)
je 0x33ef5
leaq 0x23472(%rip), %rsi     # 0x57290
movq %r15, %rdi
callq 0x9690
testl %eax, %eax
je 0x33ef5
cmpb $0x31, %r12b
jne 0x33e3f
cmpb $0x0, 0x1(%r15)
je 0x33ef5
leaq 0x2743e(%rip), %rsi     # 0x5b284
movq %r15, %rdi
callq 0x9690
testl %eax, %eax
je 0x33f32
leaq 0x23439(%rip), %rsi     # 0x57296
movq %r15, %rdi
callq 0x9690
testl %eax, %eax
je 0x33f32
cmpb $0x30, %r12b
jne 0x33e7e
cmpb $0x0, 0x1(%r15)
je 0x33f32
movq 0x4316b(%rip), %rdi     # 0x76ff0
leaq 0x2518c(%rip), %rsi     # 0x59018
callq 0x94b0
leaq 0x272da(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
pushq $0x5c
popq %rsi
movq %rax, %rdi
callq 0x9890
leaq 0x25198(%rip), %rsi     # 0x5904a
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x94b0
leaq 0x251ed(%rip), %rsi     # 0x590b9
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
jmp 0x33f3f
movq %r15, %rdi
xorl %esi, %esi
callq 0x93c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x34740
jmp 0x33f3f
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
jmp 0x33f3a
leaq -0x58(%rbp), %rdi
leaq -0x29(%rbp), %rdx
movq %r12, %rsi
callq 0x10e4a
leaq -0x58(%rbp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x347f4
leaq -0x58(%rbp), %rdi
callq 0x9240
movq %r12, %rdi
callq 0x9630
jmp 0x33f3f
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x348ac
movb $0x1, %al
jmp 0x33d71
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0x33f56
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x9240
jmp 0x33f62
jmp 0x33f5f
movq %rax, %rbx
movq %rbx, %rdi
callq 0x98b0