// File: sundale[P]gcode/rs274ngc/interp_read.cc
// Function: Interp::read_m(char*, int*, block_struct*, double*)
int Interp::read_m(char *line,   //!< string: line of RS274 code being processed   
                  int *counter, //!< pointer to a counter for position on the line
                  block_pointer block,  //!< pointer to a block being filled from the line
                  double *parameters)   //!< array of system parameters                   
{
  int value;
  int mode;

  CHKS((line[*counter] != 'm'), NCE_BUG_FUNCTION_SHOULD_NOT_HAVE_BEEN_CALLED);
  *counter = (*counter + 1);
  CHP(read_integer_value(line, counter, &value, parameters));
  CHKS((value < 0), NCE_NEGATIVE_M_CODE_USED);
  CHKS((value > 199), NCE_M_CODE_GREATER_THAN_199);
  mode = _ems[value];
  CHKS((mode == -1), NCE_UNKNOWN_M_CODE_USED);
  CHKS((block->m_modes[mode] != -1),
      NCE_TWO_M_CODES_USED_FROM_SAME_MODAL_GROUP);
  block->m_modes[mode] = value;
  block->m_count++;
  if (value >= 100 && value < 200) {
    block->user_m = 1;
  }
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x6d, %eax
je 0x62e81
jmp 0x62dae
leaq 0x19630(%rip), %rdi     # 0x7c3e5
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x24191(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x24180(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x24172(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1ab7e(%rip), %rsi     # 0x7d981
movl $0x50, %edx
callq 0x10840
movq 0x2414c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x2413e(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x24126(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x24116(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x24109(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x240fb(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x63367
jmp 0x62e83
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %r8
leaq -0x34(%rbp), %rcx
callq 0x11250
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x62f75
jmp 0x62eba
movq 0x2409f(%rip), %rax     # 0x86f60
cmpl $0x31, 0xd670(%rax)
jge 0x62f6a
movq 0x2408b(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x2407d(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1aa89(%rip), %rsi     # 0x7d981
movl $0x50, %edx
callq 0x10840
movq 0x24057(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x24049(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x24031(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x24021(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x24014(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x24006(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x63367
jmp 0x62f77
jmp 0x62f79
cmpl $0x0, -0x34(%rbp)
jge 0x63058
jmp 0x62f85
leaq 0x1aa30(%rip), %rdi     # 0x7d9bc
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x23fba(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x23fa9(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x23f9b(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1a9a7(%rip), %rsi     # 0x7d981
movl $0x50, %edx
callq 0x10840
movq 0x23f75(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23f67(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x23f4f(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x23f3f(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x23f32(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23f24(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x63367
jmp 0x6305a
jmp 0x6305c
cmpl $0xc7, -0x34(%rbp)
jle 0x6313e
jmp 0x6306b
leaq 0x1a95f(%rip), %rdi     # 0x7d9d1
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x23ed4(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x23ec3(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x23eb5(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1a8c1(%rip), %rsi     # 0x7d981
movl $0x50, %edx
callq 0x10840
movq 0x23e8f(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23e81(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x23e69(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x23e59(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x23e4c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23e3e(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x63367
jmp 0x63140
movslq -0x34(%rbp), %rcx
movq 0x23e85(%rip), %rax     # 0x86fd0
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
cmpl $-0x1, -0x38(%rbp)
jne 0x63230
jmp 0x6315d
leaq 0x1783b(%rip), %rdi     # 0x7a99f
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x23de2(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x23dd1(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x23dc3(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1a7cf(%rip), %rsi     # 0x7d981
movl $0x50, %edx
callq 0x10840
movq 0x23d9d(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23d8f(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x23d77(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x23d67(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x23d5a(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23d4c(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x63367
jmp 0x63232
jmp 0x63234
movq -0x28(%rbp), %rax
movslq -0x38(%rbp), %rcx
cmpl $-0x1, 0x1e0(%rax,%rcx,4)
je 0x6331c
jmp 0x6324c
leaq 0x1a796(%rip), %rdi     # 0x7d9e9
callq 0x10380
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x23cf3(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x23ce2(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x23cd4(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x1a6e0(%rip), %rsi     # 0x7d981
movl $0x50, %edx
callq 0x10840
movq 0x23cae(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23ca0(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x23c88(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x23c78(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x23c6b(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x23c5d(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x63367
jmp 0x6331e
movl -0x34(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, 0x1e0(%rax,%rcx,4)
movq -0x28(%rbp), %rax
movl 0x1dc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1dc(%rax)
cmpl $0x64, -0x34(%rbp)
jl 0x63360
cmpl $0xc8, -0x34(%rbp)
jge 0x63360
movq -0x28(%rbp), %rax
movl $0x1, 0x20c(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq