// File: /workspace/github_cpp_makefile_star2_O1/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 0x177a5(%rip), %r14     # 0x43f60
je 0x2c7c4
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 0x2c817
callq 0xaf80
subq $0x8, %rsp
leaq 0xff4f(%rip), %rsi      # 0x3c742
leaq 0xfcbc(%rip), %r8       # 0x3c4b6
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
movq %r12, -0x40(%rbp)
cmpl $0x0, 0x1b6b4(%r14)
jle 0x2c85a
callq 0xaf80
movl 0x4(%r13), %r10d
subq $0x8, %rsp
leaq 0xff52(%rip), %rsi      # 0x3c78b
leaq 0xfc76(%rip), %r8       # 0x3c4b6
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 %r15, -0x38(%rbp)
movslq 0x4(%r13), %r14
testq %r14, %r14
jle 0x2c88a
movq 0x8(%r13), %r15
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
movq %rbx, %rsi
callq 0xaeb0
testl %eax, %eax
je 0x2c930
incq %r12
cmpq %r12, %r14
jne 0x2c86e
movq 0x176cf(%rip), %r14     # 0x43f60
cmpl $0x0, 0x1b6b4(%r14)
movq -0x38(%rbp), %r15
jle 0x2c8d4
callq 0xaf80
leaq 0xffa0(%rip), %r10      # 0x3c84b
leaq 0xff61(%rip), %rsi      # 0x3c813
leaq 0xfbfd(%rip), %r8       # 0x3c4b6
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 0xff82(%rip), %rdi      # 0x3c85d
callq 0xa1f0
movq %r15, %rdi
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xa850
movl $0x0, 0xd670(%r14)
leaq 0xc6d0(%r14), %rdi
leaq 0xef63(%rip), %rsi      # 0x3b86c
movl $0x50, %edx
callq 0xa8a0
movw $0x0, 0xc71f(%r14)
movl $0x1, 0xd670(%r14)
movl $0x5, %r15d
jmp 0x2c98c
movq 0x10(%r13), %rax
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax,%r12,8)
movq 0x1761a(%rip), %rax     # 0x43f60
cmpl $0x0, 0x1b6b4(%rax)
jle 0x2c989
callq 0xaf80
leaq 0xfe77(%rip), %rsi      # 0x3c7d2
leaq 0xfb54(%rip), %r8       # 0x3c4b6
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 0x2c98c
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq