// File: sundale[P]gcode/saicanon.cc
// Function: SET_MOTION_CONTROL_MODE(int, double)
extern void SET_MOTION_CONTROL_MODE(CANON_MOTION_MODE mode, double tolerance)
{
  motion_tolerance = 0;
  if (mode == CANON_EXACT_STOP)
    {
      PRINT0("SET_MOTION_CONTROL_MODE(CANON_EXACT_STOP)\n");
      _motion_mode = CANON_EXACT_STOP;
    }
  else if (mode == CANON_EXACT_PATH)
    {
      PRINT0("SET_MOTION_CONTROL_MODE(CANON_EXACT_PATH)\n");
      _motion_mode = CANON_EXACT_PATH;
    }
  else if (mode == CANON_CONTINUOUS)
    {
      motion_tolerance = tolerance;
      PRINT1("SET_MOTION_CONTROL_MODE(CANON_CONTINUOUS, %f)\n", tolerance);
      _motion_mode = CANON_CONTINUOUS;
    }
  else
    PRINT0("SET_MOTION_CONTROL_MODE(UNKNOWN)\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movsd %xmm0, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xb06d(%rip)     # 0x11c88
cmpl $0x1, -0x4(%rbp)
jne 0x6caa
cmpq $0x0, 0x96e3(%rip)      # 0x10310
jne 0x6c40
movq 0x8382(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x96d0(%rip)      # 0x10310
movq 0x96c9(%rip), %rdi      # 0x10310
movl 0x8567(%rip), %edx      # 0xf1b4
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x855c(%rip)      # 0xf1b4
leaq 0x45d9(%rip), %rsi      # 0xb238
movb $0x0, %al
callq 0x4260
callq 0x60d0
cmpq $0x0, 0x969d(%rip)      # 0x10310
jne 0x6c86
movq 0x833c(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x968a(%rip)      # 0x10310
movq 0x9683(%rip), %rdi      # 0x10310
leaq 0x4705(%rip), %rsi      # 0xb399
movb $0x0, %al
callq 0x4260
movl $0x1, 0x8523(%rip)      # 0xf1c8
jmp 0x6e51
cmpl $0x2, -0x4(%rbp)
jne 0x6d39
cmpq $0x0, 0x9654(%rip)      # 0x10310
jne 0x6ccf
movq 0x82f3(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x9641(%rip)      # 0x10310
movq 0x963a(%rip), %rdi      # 0x10310
movl 0x84d8(%rip), %edx      # 0xf1b4
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x84cd(%rip)      # 0xf1b4
leaq 0x454a(%rip), %rsi      # 0xb238
movb $0x0, %al
callq 0x4260
callq 0x60d0
cmpq $0x0, 0x960e(%rip)      # 0x10310
jne 0x6d15
movq 0x82ad(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x95fb(%rip)      # 0x10310
movq 0x95f4(%rip), %rdi      # 0x10310
leaq 0x46a1(%rip), %rsi      # 0xb3c4
movb $0x0, %al
callq 0x4260
movl $0x2, 0x8494(%rip)      # 0xf1c8
jmp 0x6e4f
cmpl $0x3, -0x4(%rbp)
jne 0x6dd7
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0xaf38(%rip)     # 0x11c88
cmpq $0x0, 0x95b8(%rip)      # 0x10310
jne 0x6d6b
movq 0x8257(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x95a5(%rip)      # 0x10310
movq 0x959e(%rip), %rdi      # 0x10310
movl 0x843c(%rip), %edx      # 0xf1b4
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x8431(%rip)      # 0xf1b4
leaq 0x44ae(%rip), %rsi      # 0xb238
movb $0x0, %al
callq 0x4260
callq 0x60d0
cmpq $0x0, 0x9572(%rip)      # 0x10310
jne 0x6db1
movq 0x8211(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x955f(%rip)      # 0x10310
movq 0x9558(%rip), %rdi      # 0x10310
movsd -0x10(%rbp), %xmm0
leaq 0x462b(%rip), %rsi      # 0xb3ef
movb $0x1, %al
callq 0x4260
movl $0x3, 0x83f3(%rip)      # 0xf1c8
jmp 0x6e4d
cmpq $0x0, 0x9531(%rip)      # 0x10310
jne 0x6df2
movq 0x81d0(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x951e(%rip)      # 0x10310
movq 0x9517(%rip), %rdi      # 0x10310
movl 0x83b5(%rip), %edx      # 0xf1b4
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x83aa(%rip)      # 0xf1b4
leaq 0x4427(%rip), %rsi      # 0xb238
movb $0x0, %al
callq 0x4260
callq 0x60d0
cmpq $0x0, 0x94eb(%rip)      # 0x10310
jne 0x6e38
movq 0x818a(%rip), %rax      # 0xefb8
movq (%rax), %rax
movq %rax, 0x94d8(%rip)      # 0x10310
movq 0x94d1(%rip), %rdi      # 0x10310
leaq 0x45d8(%rip), %rsi      # 0xb41e
movb $0x0, %al
callq 0x4260
jmp 0x6e4f
jmp 0x6e51
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)