// File: sundale[P]gcode/rs274ngc/rs274ngc_pre.cc
// Function: Interp::synch()
int Interp::synch()
{

  char file_name[LINELEN];

  _setup.control_mode = GET_EXTERNAL_MOTION_CONTROL_MODE();
  _setup.AA_current = GET_EXTERNAL_POSITION_A();
  _setup.BB_current = GET_EXTERNAL_POSITION_B();
  _setup.CC_current = GET_EXTERNAL_POSITION_C();
  _setup.current_pocket = GET_EXTERNAL_TOOL_SLOT();
  _setup.current_x = GET_EXTERNAL_POSITION_X();
  _setup.current_y = GET_EXTERNAL_POSITION_Y();
  _setup.current_z = GET_EXTERNAL_POSITION_Z();
  _setup.u_current = GET_EXTERNAL_POSITION_U();
  _setup.v_current = GET_EXTERNAL_POSITION_V();
  _setup.w_current = GET_EXTERNAL_POSITION_W();
  _setup.feed_rate = GET_EXTERNAL_FEED_RATE();
  _setup.flood = (GET_EXTERNAL_FLOOD() != 0) ? ON : OFF;
  _setup.length_units = GET_EXTERNAL_LENGTH_UNIT_TYPE();
  _setup.mist = (GET_EXTERNAL_MIST() != 0) ? ON : OFF;
  _setup.plane = GET_EXTERNAL_PLANE();
  _setup.selected_pocket = GET_EXTERNAL_SELECTED_TOOL_SLOT();
  _setup.speed = GET_EXTERNAL_SPEED();
  _setup.spindle_turning = GET_EXTERNAL_SPINDLE();
  _setup.pockets_max = GET_EXTERNAL_POCKETS_MAX();
  _setup.traverse_rate = GET_EXTERNAL_TRAVERSE_RATE();
  _setup.feed_override = GET_EXTERNAL_FEED_OVERRIDE_ENABLE();
  _setup.speed_override = GET_EXTERNAL_SPINDLE_OVERRIDE_ENABLE();
  _setup.adaptive_feed = GET_EXTERNAL_ADAPTIVE_FEED_ENABLE();
  _setup.feed_hold = GET_EXTERNAL_FEED_HOLD_ENABLE();

  GET_EXTERNAL_PARAMETER_FILE_NAME(file_name, (LINELEN - 1));
  save_parameters(((file_name[0] ==
                             0) ?
                            RS274NGC_PARAMETER_FILE_NAME_DEFAULT :
                            file_name), _setup.parameters);

  load_tool_table();   /*  must set  _setup.tool_max first */

  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x118(%rbp)
callq 0x10340
movl %eax, %ecx
movq 0x11b18(%rip), %rax     # 0x86f60
movl %ecx, 0x5f8(%rax)
callq 0x10450
movq 0x11b06(%rip), %rax     # 0x86f60
movsd %xmm0, 0x8(%rax)
callq 0x10e00
movq 0x11af5(%rip), %rax     # 0x86f60
movsd %xmm0, 0x20(%rax)
callq 0x11be0
movq 0x11ae4(%rip), %rax     # 0x86f60
movsd %xmm0, 0x38(%rax)
callq 0x106e0
movl %eax, %ecx
movq 0x11ad1(%rip), %rax     # 0x86f60
movl %ecx, 0x5fc(%rax)
callq 0x121e0
movq 0x11abf(%rip), %rax     # 0x86f60
movsd %xmm0, 0x600(%rax)
callq 0x10c50
movq 0x11aab(%rip), %rax     # 0x86f60
movsd %xmm0, 0x608(%rax)
callq 0x10580
movq 0x11a97(%rip), %rax     # 0x86f60
movsd %xmm0, 0x610(%rax)
callq 0x122d0
movq 0x11a83(%rip), %rax     # 0x86f60
movsd %xmm0, 0x50(%rax)
callq 0x11270
movq 0x11a72(%rip), %rax     # 0x86f60
movsd %xmm0, 0x68(%rax)
callq 0x10660
movq 0x11a61(%rip), %rax     # 0x86f60
movsd %xmm0, 0x80(%rax)
callq 0x11450
movq 0x11a4d(%rip), %rax     # 0x86f60
movsd %xmm0, 0x678(%rax)
callq 0x11460
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %cl
andb $0x1, %cl
movq 0x11a21(%rip), %rax     # 0x86f60
movb %cl, 0x1688(%rax)
callq 0x11a60
movl %eax, %ecx
movq 0x11a0d(%rip), %rax     # 0x86f60
movl %ecx, 0x1690(%rax)
callq 0x10da0
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cmpl $0x0, %eax
setne %cl
andb $0x1, %cl
movq 0x119e3(%rip), %rax     # 0x86f60
movb %cl, 0x1797(%rax)
callq 0x105c0
movl %eax, %ecx
movq 0x119cf(%rip), %rax     # 0x86f60
movl %ecx, 0xc67c(%rax)
callq 0x116c0
movl %eax, %ecx
movq 0x119bb(%rip), %rax     # 0x86f60
movl %ecx, 0xc6b0(%rax)
callq 0x11090
movq 0x119a9(%rip), %rax     # 0x86f60
movsd %xmm0, 0xc6b8(%rax)
callq 0x10390
movl %eax, %ecx
movq 0x11993(%rip), %rax     # 0x86f60
movl %ecx, 0xc6cc(%rax)
callq 0x10570
movl %eax, %ecx
movq 0x1197f(%rip), %rax     # 0x86f60
movl %ecx, 0xd6c0(%rax)
callq 0x10c60
movq 0x1196d(%rip), %rax     # 0x86f60
movsd %xmm0, 0xef48(%rax)
callq 0x11200
cmpl $0x0, %eax
setne %cl
andb $0x1, %cl
movq 0x11950(%rip), %rax     # 0x86f60
movb %cl, 0x674(%rax)
callq 0x11590
cmpl $0x0, %eax
setne %cl
andb $0x1, %cl
movq 0x11935(%rip), %rax     # 0x86f60
movb %cl, 0xc6c8(%rax)
callq 0x12240
cmpl $0x0, %eax
setne %cl
andb $0x1, %cl
movq 0x1191a(%rip), %rax     # 0x86f60
movb %cl, 0x1b6b0(%rax)
callq 0x10eb0
cmpl $0x0, %eax
setne %cl
andb $0x1, %cl
movq 0x118ff(%rip), %rax     # 0x86f60
movb %cl, 0x1b6b1(%rax)
leaq -0x110(%rbp), %rdi
movl $0xfe, %esi
callq 0x10f10
movsbl -0x110(%rbp), %eax
cmpl $0x0, %eax
jne 0x75694
leaq 0xa3ca(%rip), %rax      # 0x7fa55
movq %rax, -0x120(%rbp)
jmp 0x756a2
leaq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x118(%rbp), %rdi
movq -0x120(%rbp), %rsi
movq 0x118a9(%rip), %rdx     # 0x86f60
addq $0x17c0, %rdx           # imm = 0x17C0
callq 0x12280
movq -0x118(%rbp), %rdi
callq 0x11b30
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw (%rax,%rax)