// File: /workspace/github_cpp_makefile_star2_O3/sundale[P]gcode/rs274ngc/interp_convert.cc
// Function: Interp::convert_modal_0(int, block_struct*, setup_struct*)
int Interp::convert_modal_0(int code,    //!< G code, must be from group 0                
                           block_pointer block, //!< pointer to a block of RS274/NGC instructions
                           setup_pointer settings)      //!< pointer to machine settings                 
{

  if (code == G_10) {
      if(block->l_number == 1 || block->l_number == 10)
          CHP(convert_setup_tool(block, settings));
      else
          CHP(convert_setup(block, settings));
  } else if ((code == G_28) || (code == G_30)) {
    CHP(convert_home(code, block, settings));
  } else if ((code == G_28_1) || (code == G_30_1)) {
    CHP(convert_savehome(code, block, settings));
  } else if ((code == G_92) || (code == G_92_1) ||
             (code == G_92_2) || (code == G_92_3)) {
    CHP(convert_axis_offsets(code, block, settings));
  } else if (code == G_5_3) {
    CHP(convert_nurbs(code, block, settings));
  } else if ((code == G_4) || (code == G_53));  /* handled elsewhere */
  else
    ERS(NCE_BUG_CODE_NOT_G4_G10_G28_G30_G53_OR_G92_SERIES);
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
cmpl $0x12c, %esi            # imm = 0x12C
jg 0x1257a
cmpl $0x117, %esi            # imm = 0x117
jg 0x12592
cmpl $0x28, %esi
je 0x126bf
cmpl $0x35, %esi
je 0x12635
cmpl $0x64, %esi
jne 0x125cf
movl 0x1c8(%rdx), %eax
cmpl $0xa, %eax
je 0x12567
cmpl $0x1, %eax
jne 0x12644
movq %rbx, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xa330
jmp 0x12652
leal -0x398(%rsi), %eax
cmpl $0x4, %eax
jae 0x125bb
movq %rbx, %rdi
callq 0xb630
jmp 0x12652
cmpl $0x118, %esi            # imm = 0x118
je 0x125ae
cmpl $0x119, %esi            # imm = 0x119
je 0x1262b
cmpl $0x12c, %esi            # imm = 0x12C
jne 0x125cf
movq %rbx, %rdi
callq 0xaea0
jmp 0x12652
cmpl $0x12d, %esi            # imm = 0x12D
je 0x1262b
cmpl $0x212, %esi            # imm = 0x212
je 0x126bf
leaq 0x2393b(%rip), %rdi     # 0x35f11
callq 0xa1f0
movq %rbx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0xa850
movq 0x2e971(%rip), %r14     # 0x40f60
leaq 0xc6d0(%r14), %rdi
leaq 0x22146(%rip), %rsi     # 0x34743
movl $0x50, %edx
callq 0xa8a0
movb $0x0, 0xc71f(%r14)
movl $0x1, 0xd670(%r14)
addq $0xc720, %r14           # imm = 0xC720
movl $0x5, %ebx
jmp 0x126b8
movq %rbx, %rdi
callq 0xa410
jmp 0x12652
movq %rbx, %rdi
movl $0x35, %esi
callq 0xb460
jmp 0x12652
movq %rbx, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xa790
testl %eax, %eax
je 0x126bf
movl %eax, %ebx
movq 0x2e901(%rip), %r15     # 0x40f60
movslq 0xd670(%r15), %rax
cmpq $0x30, %rax
jg 0x126bc
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r15,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x220bd(%rip), %rsi     # 0x34743
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r15), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
leaq (%r15,%rcx), %r14
addq $0xc720, %r14           # imm = 0xC720
movb $0x0, -0x1(%r14)
incl %eax
movl %eax, 0xd670(%r15)
movb $0x0, (%r14)
movl %ebx, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop