// File: /workspace/github_cpp_makefile_star2_O2/hzeller[P]gcode-multi-shell-extrude/config-values.cc
// Function: SetParametersFromCommandline(int, char**)
bool SetParametersFromCommandline(int argc, char *argv[]) {
  if (sRegisteredParameters == NULL)
    return true;

  std::string optstring;
  struct option *long_options = new option [ sRegisteredParameters->size() + 1 ];
  int opt_idx = 0;
  for (size_t i = 0; i < sRegisteredParameters->size(); ++i) {
    const Parameter *const p = (*sRegisteredParameters)[i];
    if (p->option_name == NULL && p->option_char == 0) {
      continue;
    }
    if (p->option_char != 0) {
      optstring.append(1, p->option_char);
      if (p->RequiresValue()) optstring.append(1, ':');
    }
    struct option *opt = &long_options[opt_idx++];
    opt->name = p->option_name;
    opt->has_arg = p->RequiresValue() ? 1 : 2;
    opt->flag = NULL;
    opt->val = i + 256;
  }
  const char *optstr = optstring.c_str();
  bool success = true;
  int opt;
  int arg_idx = 0;
  while ((opt = getopt_long(argc, argv, optstr, long_options, &arg_idx)) >= 0) {
    if (opt == '?') {
      success = false;
      break;
    }
    for (size_t i = 0; i < sRegisteredParameters->size(); ++i) {
      Parameter *const p = (*sRegisteredParameters)[i];
      if (opt == p->option_char || opt == (int) (i + 256)) {
        p->FromString(optarg);
      }
    }
  }
  delete [] long_options;
  return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x10(%rsp)
movl %edi, 0x8(%rsp)
movq 0x13c1b(%rip), %rax     # 0x1b220
testq %rax, %rax
je 0x779a
leaq 0x28(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
movq (%rax), %rbx
movq 0x8(%rax), %rbp
movq %rbp, %rax
subq %rbx, %rax
sarq $0x3, %rax
incq %rax
movq %rax, %rcx
shrq $0x3b, %rcx
shlq $0x5, %rax
xorl %r15d, %r15d
negq %rcx
movl $0x0, %edi
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x3030
movq %rax, %r14
xorl %r12d, %r12d
movq %rbp, %rax
subq %rbx, %rax
sarq $0x3, %rax
cmpq %rax, %r12
jae 0x7704
movq (%rbx,%r12,8), %r13
cmpq $0x0, 0x8(%r13)
movb 0x10(%r13), %al
je 0x7682
testb %al, %al
jne 0x7686
jmp 0x76b4
testb %al, %al
je 0x76fc
movsbl %al, %edx
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x3270
movq (%r13), %rax
movq %r13, %rdi
callq *0x20(%rax)
testb %al, %al
je 0x76b4
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x3a
popq %rdx
callq 0x3270
movslq %r15d, %rbx
shlq $0x5, %rbx
movq 0x8(%r13), %rax
movq %rax, (%r14,%rbx)
movq (%r13), %rax
movq %r13, %rdi
callq *0x20(%rax)
addq %r14, %rbx
incl %r15d
movzbl %al, %eax
pushq $0x2
popq %rcx
subl %eax, %ecx
movl %ecx, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
leal 0x100(%r12), %eax
movl %eax, 0x18(%rbx)
movq 0x13b2b(%rip), %rax     # 0x1b220
movq (%rax), %rbx
movq 0x8(%rax), %rbp
incq %r12
jmp 0x765a
movq 0x18(%rsp), %r12
leaq 0xc(%rsp), %rax
andl $0x0, (%rax)
movq 0x138a8(%rip), %rbx     # 0x1afc0
movl 0x8(%rsp), %edi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
movq %r14, %rcx
leaq 0xc(%rsp), %r8
callq 0x3380
movl %eax, %r15d
testl %eax, %eax
js 0x7782
cmpl $0x3f, %r15d
je 0x7782
leal -0x100(%r15), %ebp
xorl %r13d, %r13d
movq 0x13ad1(%rip), %rcx     # 0x1b220
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jae 0x7718
movq (%rax,%r13,8), %rdi
cmpl %r13d, %ebp
je 0x7774
movsbl 0x10(%rdi), %eax
cmpl %eax, %r15d
jne 0x777d
movq (%rbx), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
incq %r13
jmp 0x7748
shrl $0x1f, %r15d
movq %r14, %rdi
callq 0x32c0
leaq 0x18(%rsp), %rdi
callq 0x30f0
jmp 0x779d
movb $0x1, %r15b
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x77b5
jmp 0x77b5
jmp 0x77b5
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x33a0