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

  if (block->g_modes[0] == G_4) {
    CHP(convert_dwell(settings, block->p_number));
  }
  if (block->g_modes[2] != -1) {
    CHP(convert_set_plane(block->g_modes[2], settings));
  }
  if (block->g_modes[6] != -1) {
    CHP(convert_length_units(block->g_modes[6], settings));
  }
  if (block->g_modes[15] != -1) {
    CHP(convert_lathe_diameter_mode(block->g_modes[15], block, settings));
  }
  if (block->g_modes[7] != -1) {
    CHP(convert_cutter_compensation(block->g_modes[7], block, settings));
  }
  if (block->g_modes[8] != -1) {
    CHP(convert_tool_length_offset(block->g_modes[8], block, settings));
  }
  if (block->g_modes[12] != -1) {
    CHP(convert_coordinate_system(block->g_modes[12], settings));
  }
  if (block->g_modes[13] != -1) {
    CHP(convert_control_mode(block->g_modes[13], block->p_number, block->q_number, settings));
  }
  if (block->g_modes[3] != -1) {
    CHP(convert_distance_mode(block->g_modes[3], settings));
  }
  if (block->g_modes[4] != -1) {
    CHP(convert_ijk_distance_mode(block->g_modes[4], settings));
  }
  if (block->g_modes[10] != -1) {
    CHP(convert_retract_mode(block->g_modes[10], settings));
  }
  if (block->g_modes[0] != -1) {
    CHP(convert_modal_0(block->g_modes[0], block, settings));
  }
  if (block->motion_to_be != -1) {
    CHP(convert_motion(block->motion_to_be, block, settings));
  }
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x28, 0x150(%rsi)
jne 0x115e2
movsd 0x210(%r15), %xmm0
callq 0xb4b0
movl 0x158(%r15), %esi
cmpl $-0x1, %esi
je 0x11601
movq %r12, %rdi
movq %r14, %rdx
callq 0xb680
testl %eax, %eax
jne 0x11766
movl 0x168(%r15), %esi
cmpl $-0x1, %esi
je 0x11620
movq %r12, %rdi
movq %r14, %rdx
callq 0xafd0
testl %eax, %eax
jne 0x11766
movl 0x18c(%r15), %esi
cmpl $-0x1, %esi
je 0x11642
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xa490
testl %eax, %eax
jne 0x11766
movl 0x16c(%r15), %esi
cmpl $-0x1, %esi
je 0x11664
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xad20
testl %eax, %eax
jne 0x11766
movl 0x170(%r15), %esi
cmpl $-0x1, %esi
je 0x11686
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xa540
testl %eax, %eax
jne 0x11766
movl 0x180(%r15), %esi
cmpl $-0x1, %esi
je 0x116a5
movq %r12, %rdi
movq %r14, %rdx
callq 0xa6f0
testl %eax, %eax
jne 0x11766
movl 0x184(%r15), %esi
cmpl $-0x1, %esi
je 0x116d6
movsd 0x210(%r15), %xmm0
movsd 0x220(%r15), %xmm1
movq %r12, %rdi
movq %r14, %rdx
callq 0xa610
testl %eax, %eax
jne 0x11766
movl 0x15c(%r15), %esi
cmpl $-0x1, %esi
je 0x116f1
movq %r12, %rdi
movq %r14, %rdx
callq 0xae70
testl %eax, %eax
jne 0x11766
movl 0x160(%r15), %esi
cmpl $-0x1, %esi
je 0x1170c
movq %r12, %rdi
movq %r14, %rdx
callq 0xae80
testl %eax, %eax
jne 0x11766
movl 0x178(%r15), %esi
cmpl $-0x1, %esi
je 0x11727
movq %r12, %rdi
movq %r14, %rdx
callq 0xa220
testl %eax, %eax
jne 0x11766
movl 0x150(%r15), %esi
cmpl $-0x1, %esi
je 0x11745
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xb4d0
testl %eax, %eax
jne 0x11766
movl 0x1d8(%r15), %esi
xorl %r13d, %r13d
cmpl $-0x1, %esi
je 0x117d3
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xa620
testl %eax, %eax
je 0x117d3
movl %eax, %ebx
movq 0x2f7f1(%rip), %rax     # 0x40f60
movslq 0xd670(%rax), %rcx
cmpq $0x30, %rcx
jg 0x117d0
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x22e18(%rip), %rsi     # 0x345ae
movl $0x50, %edx
callq 0xa8a0
movq 0x2f7b9(%rip), %rax     # 0x40f60
movslq 0xd670(%rax), %rcx
leaq (%rcx,%rcx,4), %rdx
shlq $0x4, %rdx
xorl %esi, %esi
movb %sil, 0xc71f(%rax,%rdx)
incl %ecx
movl %ecx, 0xd670(%rax)
movb %sil, 0xc720(%rax,%rdx)
movl %ebx, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop