// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x28, 0x150(%rsi)
jne 0x11a74
movsd 0x210(%r14), %xmm0
callq 0xb4b0
movl 0x158(%r14), %esi
cmpl $-0x1, %esi
je 0x11afc
movq %r15, %rdi
movq %rbx, %rdx
callq 0xb680
movl %eax, %r13d
testl %eax, %eax
je 0x11b01
movq 0x324c7(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11af7
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x25aed(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
jmp 0x11b04
xorl %r12d, %r12d
jmp 0x11b0d
xorl %r12d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x168(%r14), %esi
cmpl $-0x1, %esi
je 0x11ba0
movq %r15, %rdi
movq %rbx, %rdx
callq 0xafd0
movl %eax, %r13d
testl %eax, %eax
je 0x11b97
movq 0x3242a(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11b94
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x25a50(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x18c(%r14), %esi
cmpl $-0x1, %esi
je 0x11c36
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xa490
movl %eax, %r13d
testl %eax, %eax
je 0x11c2d
movq 0x32394(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11c2a
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x259ba(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x16c(%r14), %esi
cmpl $-0x1, %esi
je 0x11ccc
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xad20
movl %eax, %r13d
testl %eax, %eax
je 0x11cc3
movq 0x322fe(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11cc0
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x25924(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x170(%r14), %esi
cmpl $-0x1, %esi
je 0x11d62
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xa540
movl %eax, %r13d
testl %eax, %eax
je 0x11d59
movq 0x32268(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11d56
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x2588e(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x180(%r14), %esi
cmpl $-0x1, %esi
je 0x11df5
movq %r15, %rdi
movq %rbx, %rdx
callq 0xa6f0
movl %eax, %r13d
testl %eax, %eax
je 0x11dec
movq 0x321d5(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11de9
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x257fb(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x184(%r14), %esi
cmpl $-0x1, %esi
je 0x11e9a
movsd 0x210(%r14), %xmm0
movsd 0x220(%r14), %xmm1
movq %r15, %rdi
movq %rbx, %rdx
callq 0xa610
movl %eax, %r13d
testl %eax, %eax
je 0x11e91
movq 0x32130(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11e8e
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x25756(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x15c(%r14), %esi
cmpl $-0x1, %esi
je 0x11f2d
movq %r15, %rdi
movq %rbx, %rdx
callq 0xae70
movl %eax, %r13d
testl %eax, %eax
je 0x11f24
movq 0x3209d(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11f21
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x256c3(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x160(%r14), %esi
cmpl $-0x1, %esi
je 0x11fc0
movq %r15, %rdi
movq %rbx, %rdx
callq 0xae80
movl %eax, %r13d
testl %eax, %eax
je 0x11fb7
movq 0x3200a(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x11fb4
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x25630(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x178(%r14), %esi
cmpl $-0x1, %esi
je 0x12053
movq %r15, %rdi
movq %rbx, %rdx
callq 0xa220
movl %eax, %r13d
testl %eax, %eax
je 0x1204a
movq 0x31f77(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x12047
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x2559d(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x150(%r14), %esi
cmpl $-0x1, %esi
je 0x120e9
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xb4d0
movl %eax, %r13d
testl %eax, %eax
je 0x120e0
movq 0x31ee1(%rip), %r12     # 0x43f60
movslq 0xd670(%r12), %rax
cmpq $0x30, %rax
jg 0x120dd
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r12,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x25507(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r12), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r12,%rcx)
incl %eax
movl %eax, 0xd670(%r12)
movb %dl, 0xc720(%r12,%rcx)
movl %r13d, %r12d
testl %r13d, %r13d
jne 0x12175
movl 0x1d8(%r14), %esi
cmpl $-0x1, %esi
je 0x12172
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xa620
movl %eax, %ebx
testl %eax, %eax
je 0x1216e
movq 0x31e50(%rip), %r14     # 0x43f60
movslq 0xd670(%r14), %rax
cmpq $0x30, %rax
jg 0x1216b
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%r14,%rax), %rdi
addq $0xc6d0, %rdi           # imm = 0xC6D0
leaq 0x25477(%rip), %rsi     # 0x375ae
movl $0x50, %edx
callq 0xa8a0
movslq 0xd670(%r14), %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
xorl %edx, %edx
movb %dl, 0xc71f(%r14,%rcx)
incl %eax
movl %eax, 0xd670(%r14)
movb %dl, 0xc720(%r14,%rcx)
movl %ebx, %r12d
testl %ebx, %ebx
jne 0x12175
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop