// File: /workspace/github_cpp_makefile_star2_O1/sundale[P]gcode/saicanon.cc
// Function: USE_LENGTH_UNITS(int)
void USE_LENGTH_UNITS(CANON_UNITS in_unit)
{
  if (in_unit == CANON_UNITS_INCHES)
    {
      PRINT0("USE_LENGTH_UNITS(CANON_UNITS_INCHES)\n");
      if (_length_unit_type == CANON_UNITS_MM)
        {
          _length_unit_type = CANON_UNITS_INCHES;
          _length_unit_factor = 25.4;
          _program_origin_x = (_program_origin_x / 25.4);
          _program_origin_y = (_program_origin_y / 25.4);
          _program_origin_z = (_program_origin_z / 25.4);
          _program_position_x = (_program_position_x / 25.4);
          _program_position_y = (_program_position_y / 25.4);
          _program_position_z = (_program_position_z / 25.4);
        }
    }
  else if (in_unit == CANON_UNITS_MM)
    {
      PRINT0("USE_LENGTH_UNITS(CANON_UNITS_MM)\n");
      if (_length_unit_type == CANON_UNITS_INCHES)
        {
          _length_unit_type = CANON_UNITS_MM;
          _length_unit_factor = 1.0;
          _program_origin_x = (_program_origin_x * 25.4);
          _program_origin_y = (_program_origin_y * 25.4);
          _program_origin_z = (_program_origin_z * 25.4);
          _program_position_x = (_program_position_x * 25.4);
          _program_position_y = (_program_position_y * 25.4);
          _program_position_z = (_program_position_z * 25.4);
        }
    }
  else
    PRINT0("USE_LENGTH_UNITS(UNKNOWN)\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8ae0(%rip), %rax      # 0xe2f0
cmpl $0x2, %edi
je 0x592a
cmpl $0x1, %edi
jne 0x5a33
testq %rax, %rax
jne 0x5838
movq 0x778a(%rip), %rax      # 0xcfb8
movq (%rax), %rax
movq %rax, 0x8ab8(%rip)      # 0xe2f0
movq 0x8ab1(%rip), %rdi      # 0xe2f0
movl 0x7967(%rip), %edx      # 0xd1ac
leal 0x1(%rdx), %eax
movl %eax, 0x795e(%rip)      # 0xd1ac
leaq 0x39cb(%rip), %rsi      # 0x9220
xorl %eax, %eax
callq 0x4240
callq 0x5504
cmpq $0x0, 0x8a87(%rip)      # 0xe2f0
jne 0x587c
movq 0x7746(%rip), %rax      # 0xcfb8
movq (%rax), %rax
movq %rax, 0x8a74(%rip)      # 0xe2f0
movq 0x8a6d(%rip), %rcx      # 0xe2f0
leaq 0x39ea(%rip), %rdi      # 0x9274
movl $0x25, %esi
movl $0x1, %edx
callq 0x42f0
cmpb $0x0, 0xa3b0(%rip)      # 0xfc50
jne 0x5a31
movb $0x1, 0xa3a3(%rip)      # 0xfc50
movsd 0xa343(%rip), %xmm0     # 0xfbf8
movsd 0x392b(%rip), %xmm1     # 0x91e8
divsd %xmm1, %xmm0
movsd %xmm0, 0xa32f(%rip)     # 0xfbf8
movsd 0xa337(%rip), %xmm0     # 0xfc08
divsd %xmm1, %xmm0
movsd %xmm0, 0xa32b(%rip)     # 0xfc08
movsd 0xa333(%rip), %xmm0     # 0xfc18
divsd %xmm1, %xmm0
movsd %xmm0, 0xa327(%rip)     # 0xfc18
movsd 0xa2f7(%rip), %xmm0     # 0xfbf0
divsd %xmm1, %xmm0
movsd %xmm0, 0xa2eb(%rip)     # 0xfbf0
movsd 0xa2f3(%rip), %xmm0     # 0xfc00
divsd %xmm1, %xmm0
movsd %xmm0, 0xa2e7(%rip)     # 0xfc00
movsd 0xa2ef(%rip), %xmm0     # 0xfc10
divsd %xmm1, %xmm0
jmp 0x5a29
testq %rax, %rax
jne 0x5940
movq 0x7682(%rip), %rax      # 0xcfb8
movq (%rax), %rax
movq %rax, 0x89b0(%rip)      # 0xe2f0
movq 0x89a9(%rip), %rdi      # 0xe2f0
movl 0x785f(%rip), %edx      # 0xd1ac
leal 0x1(%rdx), %eax
movl %eax, 0x7856(%rip)      # 0xd1ac
leaq 0x38c3(%rip), %rsi      # 0x9220
xorl %eax, %eax
callq 0x4240
callq 0x5504
cmpq $0x0, 0x897f(%rip)      # 0xe2f0
jne 0x5984
movq 0x763e(%rip), %rax      # 0xcfb8
movq (%rax), %rax
movq %rax, 0x896c(%rip)      # 0xe2f0
movq 0x8965(%rip), %rcx      # 0xe2f0
leaq 0x3908(%rip), %rdi      # 0x929a
movl $0x21, %esi
movl $0x1, %edx
callq 0x42f0
cmpb $0x1, 0xa2a8(%rip)      # 0xfc50
jne 0x5a31
movb $0x0, 0xa29b(%rip)      # 0xfc50
movsd 0x382b(%rip), %xmm0     # 0x91e8
movsd 0xa233(%rip), %xmm1     # 0xfbf8
mulsd %xmm0, %xmm1
movsd %xmm1, 0xa227(%rip)     # 0xfbf8
movsd 0xa22f(%rip), %xmm1     # 0xfc08
mulsd %xmm0, %xmm1
movsd %xmm1, 0xa223(%rip)     # 0xfc08
movsd 0xa22b(%rip), %xmm1     # 0xfc18
mulsd %xmm0, %xmm1
movsd %xmm1, 0xa21f(%rip)     # 0xfc18
movsd 0xa1ef(%rip), %xmm1     # 0xfbf0
mulsd %xmm0, %xmm1
movsd %xmm1, 0xa1e3(%rip)     # 0xfbf0
movsd 0xa1eb(%rip), %xmm1     # 0xfc00
mulsd %xmm0, %xmm1
movsd %xmm1, 0xa1df(%rip)     # 0xfc00
mulsd 0xa1e7(%rip), %xmm0     # 0xfc10
movsd %xmm0, 0xa1df(%rip)     # 0xfc10
popq %rbp
retq
testq %rax, %rax
jne 0x5a49
movq 0x7579(%rip), %rax      # 0xcfb8
movq (%rax), %rax
movq %rax, 0x88a7(%rip)      # 0xe2f0
movq 0x88a0(%rip), %rdi      # 0xe2f0
movl 0x7756(%rip), %edx      # 0xd1ac
leal 0x1(%rdx), %eax
movl %eax, 0x774d(%rip)      # 0xd1ac
leaq 0x37ba(%rip), %rsi      # 0x9220
xorl %eax, %eax
callq 0x4240
callq 0x5504
cmpq $0x0, 0x8876(%rip)      # 0xe2f0
jne 0x5a8d
movq 0x7535(%rip), %rax      # 0xcfb8
movq (%rax), %rax
movq %rax, 0x8863(%rip)      # 0xe2f0
movq 0x885c(%rip), %rcx      # 0xe2f0
leaq 0x3821(%rip), %rdi      # 0x92bc
movl $0x1a, %esi
movl $0x1, %edx
popq %rbp
jmp 0x42f0