// File: /workspace/github_cpp_makefile_star2_O3/sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::store_named_param(char*, double)
int Interp::store_named_param(
    char *nameBuf, //!< pointer to name to be written
    double value   //!< value to be written
    )   
{
  struct named_parameters_struct *nameList;

  int level;
  int i;

  // now look it up
  if(nameBuf[0] != '_') // local scope
  {
      level = _setup.call_level;
  }
  else
  {
      // call level zero is global scope
      level = 0;
  }

  nameList = &_setup.sub_context[level].named_parameters;

  logDebug("store_named_parameter: nameList[%d]=0x%x storing:|%s|", level,
           nameList, nameBuf);
  logDebug("store_named_parameter: named_parameter_used_size=%d",
           nameList->named_parameter_used_size);


  for(i=0; i<nameList->named_parameter_used_size; i++)
  {
#if 0
      logDebug("store_named_parameter: named_parameter[%d]=|%s|",
               i, nameList->named_parameters[i]);
#endif
      if(0 == strcmp(nameList->named_parameters[i], nameBuf))
      {
          nameList->named_param_values[i] = value;
          logDebug("store_named_parameter: level[%d] %s value=%lf",
                   level, nameBuf, value);

          return INTERP_OK;
      }
  }

  logDebug("%s: param:|%s| returning not defined", "store_named_param",
           nameBuf);

  ERS(_("Internal error: Could not assign #<%s>"), nameBuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, -0x30(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
xorl %r12d, %r12d
cmpb $0x5f, (%rsi)
movq 0x17db7(%rip), %r14     # 0x40f60
je 0x291b2
movl 0xef90(%r14), %r12d
movslq %r12d, %rax
imulq $0x128, %rax, %rax      # imm = 0x128
leaq (%r14,%rax), %r13
addq $0xf0a8, %r13           # imm = 0xF0A8
cmpl $0x0, 0x1b6b4(%r14)
jle 0x29244
callq 0xaf80
subq $0x8, %rsp
leaq 0x10556(%rip), %rsi     # 0x39737
leaq 0x102c6(%rip), %r8      # 0x394ae
movq %r15, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x730, %r9d            # imm = 0x730
xorl %eax, %eax
pushq %rbx
pushq %r13
pushq %r12
callq 0xb470
addq $0x20, %rsp
cmpl $0x0, 0x1b6b4(%r14)
jle 0x29244
callq 0xaf80
movl 0x4(%r13), %r10d
subq $0x8, %rsp
leaq 0x1055d(%rip), %rsi     # 0x39780
leaq 0x10284(%rip), %r8      # 0x394ae
movq %r15, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x732, %r9d            # imm = 0x732
xorl %eax, %eax
pushq %r10
callq 0xb470
addq $0x10, %rsp
movq %r12, -0x40(%rbp)
movq %r15, -0x38(%rbp)
movslq 0x4(%r13), %r14
testq %r14, %r14
jle 0x29278
movq 0x8(%r13), %r12
xorl %r15d, %r15d
movq (%r12,%r15,8), %rdi
movq %rbx, %rsi
callq 0xaeb0
testl %eax, %eax
je 0x29313
incq %r15
cmpq %r15, %r14
jne 0x2925c
movq 0x17ce1(%rip), %r14     # 0x40f60
cmpl $0x0, 0x1b6b4(%r14)
movq -0x38(%rbp), %r15
jle 0x292c2
callq 0xaf80
leaq 0x105a7(%rip), %r10     # 0x39840
leaq 0x10568(%rip), %rsi     # 0x39808
leaq 0x10207(%rip), %r8      # 0x394ae
movq %r15, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x746, %r9d            # imm = 0x746
xorl %eax, %eax
pushq %rbx
pushq %r10
callq 0xb470
addq $0x10, %rsp
leaq 0x10589(%rip), %rdi     # 0x39852
callq 0xa1f0
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xa850
leaq 0xc6d0(%r14), %rdi
leaq 0xf580(%rip), %rsi      # 0x3886c
movl $0x50, %edx
callq 0xa8a0
movw $0x0, 0xc71f(%r14)
movl $0x1, 0xd670(%r14)
movl $0x5, %r15d
jmp 0x2936f
movq 0x10(%r13), %rax
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax,%r15,8)
movq 0x17c37(%rip), %rax     # 0x40f60
cmpl $0x0, 0x1b6b4(%rax)
jle 0x2936c
callq 0xaf80
leaq 0x10489(%rip), %rsi     # 0x397c7
leaq 0x10169(%rip), %r8      # 0x394ae
xorl %r15d, %r15d
movq -0x38(%rbp), %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x73f, %r9d            # imm = 0x73F
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
pushq %rbx
pushq -0x40(%rbp)
callq 0xb470
addq $0x10, %rsp
jmp 0x2936f
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop