// File: sundale[P]gcode/rs274ngc/interp_convert.cc
// Function: Interp::convert_retract_mode(int, setup_struct*)
int Interp::convert_retract_mode(int g_code,     //!< g_code being executed (must be G_98 or G_99)
                                setup_pointer settings) //!< pointer to machine settings                 
{
  CHKS((settings->cutter_comp_side != OFF),
       (_("Cannot change retract mode with cutter radius compensation on")));
  if (g_code == G_98) {
#ifdef DEBUG_EMC
    enqueue_COMMENT("interpreter: retract mode set to old_z");
#endif
    settings->retract_mode = OLD_Z;
  } else if (g_code == G_99) {
#ifdef DEBUG_EMC
    enqueue_COMMENT("interpreter: retract mode set to r_plane");
#endif
    settings->retract_mode = R_PLANE;
  } else
    ERS(NCE_BUG_CODE_NOT_G98_OR_G99);
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x624(%rax)
je 0x24071
jmp 0x23f9e
leaq 0x56c00(%rip), %rdi     # 0x7aba5
callq 0x10380
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x62fa1(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x62f90(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x62f82(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x56bf0(%rip), %rsi     # 0x7abe3
movl $0x50, %edx
callq 0x10840
movq 0x62f5c(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x62f4e(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x62f36(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x62f26(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x62f19(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x62f0b(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x2419e
jmp 0x24073
cmpl $0x3d4, -0x14(%rbp)     # imm = 0x3D4
jne 0x2409b
leaq 0x56b95(%rip), %rdi     # 0x7ac18
callq 0x11f00
movq -0x20(%rbp), %rax
movl $0x1, 0xc6a8(%rax)
jmp 0x24197
cmpl $0x3de, -0x14(%rbp)     # imm = 0x3DE
jne 0x240c3
leaq 0x56b94(%rip), %rdi     # 0x7ac3f
callq 0x11f00
movq -0x20(%rbp), %rax
movl $0x0, 0xc6a8(%rax)
jmp 0x24195
jmp 0x240c5
leaq 0x56b9c(%rip), %rdi     # 0x7ac68
callq 0x10380
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x62e7a(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x62e69(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x62e5b(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x56ac9(%rip), %rsi     # 0x7abe3
movl $0x50, %edx
callq 0x10840
movq 0x62e35(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x62e27(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x62e0f(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x62dff(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x62df2(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x62de4(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x2419e
jmp 0x24197
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)