// File: /workspace/github_cpp_makefile_star2_O2/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 0x12202
movsd 0x210(%r15), %xmm0
callq 0xc620
movl 0x158(%r15), %esi
cmpl $-0x1, %esi
je 0x12221
movq %r12, %rdi
movq %r14, %rdx
callq 0xc7f0
testl %eax, %eax
jne 0x12386
movl 0x168(%r15), %esi
cmpl $-0x1, %esi
je 0x12240
movq %r12, %rdi
movq %r14, %rdx
callq 0xc100
testl %eax, %eax
jne 0x12386
movl 0x18c(%r15), %esi
cmpl $-0x1, %esi
je 0x12262
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xb4d0
testl %eax, %eax
jne 0x12386
movl 0x16c(%r15), %esi
cmpl $-0x1, %esi
je 0x12284
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xbe20
testl %eax, %eax
jne 0x12386
movl 0x170(%r15), %esi
cmpl $-0x1, %esi
je 0x122a6
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xb590
testl %eax, %eax
jne 0x12386
movl 0x180(%r15), %esi
cmpl $-0x1, %esi
je 0x122c5
movq %r12, %rdi
movq %r14, %rdx
callq 0xb740
testl %eax, %eax
jne 0x12386
movl 0x184(%r15), %esi
cmpl $-0x1, %esi
je 0x122f6
movsd 0x210(%r15), %xmm0
movsd 0x220(%r15), %xmm1
movq %r12, %rdi
movq %r14, %rdx
callq 0xb650
testl %eax, %eax
jne 0x12386
movl 0x15c(%r15), %esi
cmpl $-0x1, %esi
je 0x12311
movq %r12, %rdi
movq %r14, %rdx
callq 0xbf90
testl %eax, %eax
jne 0x12386
movl 0x160(%r15), %esi
cmpl $-0x1, %esi
je 0x1232c
movq %r12, %rdi
movq %r14, %rdx
callq 0xbfa0
testl %eax, %eax
jne 0x12386
movl 0x178(%r15), %esi
cmpl $-0x1, %esi
je 0x12347
movq %r12, %rdi
movq %r14, %rdx
callq 0xb250
testl %eax, %eax
jne 0x12386
movl 0x150(%r15), %esi
cmpl $-0x1, %esi
je 0x12365
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xc640
testl %eax, %eax
jne 0x12386
movl 0x1d8(%r15), %esi
xorl %r13d, %r13d
cmpl $-0x1, %esi
je 0x123e9
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0xb660
testl %eax, %eax
je 0x123e9
movl %eax, %ebx
movq 0x2abd1(%rip), %rax     # 0x3cf60
movslq 0xd670(%rax), %rcx
cmpq $0x30, %rcx
jg 0x123e6
imulq $0x50, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x1e1fc(%rip), %rsi     # 0x305ae
pushq $0x50
popq %rdx
callq 0xb940
movq 0x2ab9f(%rip), %rax     # 0x3cf60
movslq 0xd670(%rax), %rcx
imulq $0x50, %rcx, %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