// File: 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
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6ff1f
cmpq $0x0, -0x20(%rbp)
je 0x6ff1f
leaq -0x28(%rbp), %rdi
callq 0x70cb0
movq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x6f9a0
andb $0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x6ff1b
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x6fb78
movq 0x8e4e2(%rip), %rdi     # 0xfdff0
leaq 0x5347f(%rip), %rsi     # 0xc2f94
callq 0xa5a0
movq %rax, %rdi
leaq 0x5572d(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, %rdi
movl $0x3c, %esi
callq 0xaa40
movq %rax, %rdi
leaq 0x5346b(%rip), %rsi     # 0xc2fab
callq 0xa5a0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0xa5a0
movq %rax, %rdi
leaq 0x534da(%rip), %rsi     # 0xc3035
callq 0xa5a0
movq %rax, %rdi
movq 0x8e446(%rip), %rsi     # 0xfdfb0
callq 0xa630
movb $0x0, -0x1(%rbp)
jmp 0x6ff23
leaq -0x28(%rbp), %rdi
callq 0x70c60
movl 0x28(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xa8(%rbp)
subl $0x3, %eax
ja 0x6ff0f
movq -0xa8(%rbp), %rax
leaq 0x533ca(%rip), %rcx     # 0xc2f70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa940
movq -0xa0(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movl %eax, %edx
callq 0x70cd0
jmp 0x6ff15
movq -0x18(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa450
movq -0xa0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
callq 0x70de0
jmp 0x6ff15
movq -0x20(%rbp), %rdi
callq 0xa260
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0xa050
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xa540
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x6fcfb
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
decl %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x38(%rbp), %rax
incq %rax
movq %rax, -0xc8(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xaa70
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x1a540
jmp 0x6fc9a
movq -0xd0(%rbp), %rsi
movq -0xa0(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x70ef0
jmp 0x6fcb3
leaq -0x58(%rbp), %rdi
callq 0xa370
leaq -0x59(%rbp), %rdi
callq 0xa650
jmp 0x6fdad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6fced
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xa370
leaq -0x59(%rbp), %rdi
callq 0xa650
jmp 0x6ff31
movq -0x18(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0xaa70
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x1a540
jmp 0x6fd40
movq -0xe8(%rbp), %rsi
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x70ef0
jmp 0x6fd5c
leaq -0x90(%rbp), %rdi
callq 0xa370
leaq -0x91(%rbp), %rdi
callq 0xa650
jmp 0x6fdad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6fd9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xa370
leaq -0x91(%rbp), %rdi
callq 0xa650
jmp 0x6ff31
movq -0x38(%rbp), %rax
movq %rax, -0xf0(%rbp)
cmpq $0x0, %rax
je 0x6fdca
movq -0xf0(%rbp), %rdi
callq 0xa7b0
jmp 0x6ff15
movq -0xa0(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x55596(%rip), %rdx     # 0xc5377
callq 0x70c20
testb $0x1, %al
jne 0x6fe22
movq -0xa0(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x51454(%rip), %rdx     # 0xc1250
callq 0x70c20
testb $0x1, %al
jne 0x6fe22
movq -0xa0(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x53f90(%rip), %rdx     # 0xc3da7
callq 0x70c20
testb $0x1, %al
jne 0x6fe22
jmp 0x6fe3c
movq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x1, %edx
callq 0x71000
jmp 0x6ff0d
movq -0xa0(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x55516(%rip), %rdx     # 0xc5364
callq 0x70c20
testb $0x1, %al
jne 0x6fe8f
movq -0xa0(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x513ed(%rip), %rdx     # 0xc1256
callq 0x70c20
testb $0x1, %al
jne 0x6fe8f
movq -0xa0(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0x5284c(%rip), %rdx     # 0xc26d0
callq 0x70c20
testb $0x1, %al
jne 0x6fe8f
jmp 0x6fea3
movq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x71000
jmp 0x6ff0b
movq 0x8e146(%rip), %rdi     # 0xfdff0
leaq 0x530e3(%rip), %rsi     # 0xc2f94
callq 0xa5a0
movq %rax, %rdi
leaq 0x55391(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, %rdi
movl $0x5c, %esi
callq 0xaa40
movq %rax, %rdi
leaq 0x530ea(%rip), %rsi     # 0xc2fc6
callq 0xa5a0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0xa5a0
movq %rax, %rdi
leaq 0x5313e(%rip), %rsi     # 0xc3035
callq 0xa5a0
movq %rax, %rdi
movq 0x8e0aa(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x6ff0d
jmp 0x6ff15
movb $0x0, -0x1(%rbp)
jmp 0x6ff23
movb $0x1, -0x1(%rbp)
jmp 0x6ff23
jmp 0x6ff1d
jmp 0x6ff1f
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xf0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0xaa60
nopw (%rax,%rax)