// File: /workspace/github_cpp_makefile_star2_O2/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 0x16795(%rip), %r14     # 0x3cf60
je 0x267d4
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 0x26864
callq 0xc0b0
subq $0x8, %rsp
leaq 0xef34(%rip), %rsi      # 0x35737
leaq 0xeca4(%rip), %r8       # 0x354ae
movq %r15, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x730, %r9d            # imm = 0x730
xorl %eax, %eax
pushq %rbx
pushq %r13
pushq %r12
callq 0xc5e0
addq $0x20, %rsp
cmpl $0x0, 0x1b6b4(%r14)
jle 0x26864
callq 0xc0b0
movl 0x4(%r13), %r10d
subq $0x8, %rsp
leaq 0xef3b(%rip), %rsi      # 0x35780
leaq 0xec62(%rip), %r8       # 0x354ae
movq %r15, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x732, %r9d            # imm = 0x732
xorl %eax, %eax
pushq %r10
callq 0xc5e0
popq %rax
popq %rcx
movq %r12, -0x38(%rbp)
movq %r15, %r12
movl 0x4(%r13), %r15d
xorl %r14d, %r14d
testl %r15d, %r15d
cmovlel %r14d, %r15d
cmpq %r14, %r15
je 0x268f3
movq 0x8(%r13), %rax
movq (%rax,%r14,8), %rdi
movq %rbx, %rsi
callq 0xbfd0
incq %r14
testl %eax, %eax
jne 0x26879
movq 0x10(%r13), %rax
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rax,%r14,8)
movq 0x166b4(%rip), %rax     # 0x3cf60
cmpl $0x0, 0x1b6b4(%rax)
jle 0x26983
callq 0xc0b0
leaq 0xef02(%rip), %rsi      # 0x357c7
leaq 0xebe2(%rip), %r8       # 0x354ae
xorl %r15d, %r15d
movq %r12, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x73f, %r9d            # imm = 0x73F
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
pushq %rbx
pushq -0x38(%rbp)
callq 0xc5e0
popq %rax
popq %rcx
jmp 0x26986
movq 0x16666(%rip), %r14     # 0x3cf60
cmpl $0x0, 0x1b6b4(%r14)
jle 0x26937
callq 0xc0b0
leaq 0xef30(%rip), %r10      # 0x35840
leaq 0xeef1(%rip), %rsi      # 0x35808
leaq 0xeb90(%rip), %r8       # 0x354ae
movq %r12, %rdi
xorl %edx, %edx
movl %eax, %ecx
movl $0x746, %r9d            # imm = 0x746
xorl %eax, %eax
pushq %rbx
pushq %r10
callq 0xc5e0
popq %rax
popq %rcx
leaq 0xef14(%rip), %rdi      # 0x35852
callq 0xb220
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xb8e0
leaq 0xc6d0(%r14), %rdi
leaq 0xdf0b(%rip), %rsi      # 0x3486c
pushq $0x50
popq %rdx
callq 0xb940
andw $0x0, 0xc71f(%r14)
movl $0x1, 0xd670(%r14)
pushq $0x5
popq %r15
jmp 0x26986
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq