// File: /workspace/github_cpp_makefile_star2_O1/sundale[P]gcode/rs274ngc/interp_convert.cc
// Function: threading_pass(setup_struct*, block_struct*, int, double, double, double, double, double, double, double, int, int, double, double, double, double)
static void 
threading_pass(setup_pointer settings, block_pointer block,
	       int boring, double safe_x, double depth, double end_depth, 
	       double start_y, double start_z, double zoff, double taper_dist,
	       int entry_taper, int exit_taper, double taper_pitch, 
	       double pitch, double full_threadheight, double target_z) {
    STRAIGHT_TRAVERSE(block->line_number, boring?
		      safe_x + depth - end_depth:
		      safe_x - depth + end_depth,
		      start_y, start_z - zoff, AABBCC); //back
    if(taper_dist && entry_taper) {
	DISABLE_FEED_OVERRIDE();
	START_SPEED_FEED_SYNCH(taper_pitch, 0);
	STRAIGHT_FEED(block->line_number, boring? 
		      safe_x + depth - full_threadheight: 
		      safe_x - depth + full_threadheight,
		      start_y, start_z - zoff, AABBCC); //in
	STRAIGHT_FEED(block->line_number, boring? safe_x + depth: safe_x - depth, //angled in
		      start_y, start_z - zoff - taper_dist, AABBCC);
	START_SPEED_FEED_SYNCH(pitch, 0);
    } else {
	STRAIGHT_TRAVERSE(block->line_number, boring? safe_x + depth: safe_x - depth, 
			  start_y, start_z - zoff, AABBCC); //in
	DISABLE_FEED_OVERRIDE();
	START_SPEED_FEED_SYNCH(pitch, 0);
    }
        
    if(taper_dist && exit_taper) {
	STRAIGHT_FEED(block->line_number, boring? safe_x + depth: safe_x - depth,  //over
		      start_y, target_z - zoff + taper_dist, AABBCC);
	START_SPEED_FEED_SYNCH(taper_pitch, 0);
	STRAIGHT_FEED(block->line_number, boring? 
		      safe_x + depth - full_threadheight: 
		      safe_x - depth + full_threadheight, 
		      start_y, target_z - zoff, AABBCC); //angled out
    } else {
	STRAIGHT_FEED(block->line_number, boring? safe_x + depth: safe_x - depth, 
		      start_y, target_z - zoff, AABBCC); //over
    }
    STOP_SPEED_FEED_SYNCH();
    STRAIGHT_TRAVERSE(block->line_number, boring? 
		      safe_x + depth - end_depth:
		      safe_x - depth + end_depth,
		      start_y, target_z - zoff, AABBCC); //out
    ENABLE_FEED_OVERRIDE();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movsd %xmm7, -0x68(%rbp)
movl %r8d, %r12d
movl %ecx, %r13d
movsd %xmm6, -0x48(%rbp)
movapd %xmm4, %xmm9
movapd %xmm3, %xmm8
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl 0x1d0(%rsi), %edi
movapd %xmm0, %xmm3
addsd %xmm1, %xmm3
subsd %xmm1, %xmm0
testl %edx, %edx
movsd %xmm0, -0x40(%rbp)
movsd %xmm3, -0x38(%rbp)
je 0x19737
movapd %xmm3, %xmm0
subsd %xmm2, %xmm0
movapd %xmm0, %xmm2
jmp 0x1973b
addsd %xmm0, %xmm2
movsd 0x20(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x18(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x10(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd %xmm5, -0x80(%rbp)
subsd %xmm5, %xmm9
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd 0x80(%rbx), %xmm0
movsd %xmm0, (%rsp)
movsd %xmm2, -0x88(%rbp)
movapd %xmm2, %xmm0
movsd %xmm8, -0x30(%rbp)
movapd %xmm8, %xmm1
movsd %xmm9, -0x58(%rbp)
movapd %xmm9, %xmm2
callq 0xa8d0
xorpd %xmm0, %xmm0
movsd -0x48(%rbp), %xmm1
ucomisd %xmm0, %xmm1
setnp %al
sete %cl
andb %al, %cl
testl %r13d, %r13d
sete %al
orb %cl, %al
jne 0x19805
callq 0xa320
movsd -0x68(%rbp), %xmm0
xorl %edi, %edi
callq 0xaef0
movsd 0x80(%rbx), %xmm9
testl %r15d, %r15d
je 0x1985a
movsd -0x38(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x40(%rbp), %xmm8
jmp 0x1986f
movl 0x1d0(%r14), %edi
movsd -0x40(%rbp), %xmm0
testl %r15d, %r15d
je 0x1981b
movsd -0x38(%rbp), %xmm0
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd 0x80(%rbx), %xmm1
movsd %xmm1, (%rsp)
movsd -0x30(%rbp), %xmm1
movsd -0x58(%rbp), %xmm2
callq 0xa8d0
callq 0xa320
jmp 0x198f3
movsd -0x40(%rbp), %xmm8
movapd %xmm8, %xmm0
addsd -0x50(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x58(%rbp), %xmm2
movl 0x1d0(%r14), %edi
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd %xmm9, (%rsp)
je 0x198a2
movsd -0x38(%rbp), %xmm8
movsd %xmm8, -0x70(%rbp)
callq 0xa6d0
movl 0x1d0(%r14), %edi
movsd -0x58(%rbp), %xmm2
subsd -0x48(%rbp), %xmm2
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd 0x80(%rbx), %xmm0
movsd %xmm0, (%rsp)
movsd -0x70(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0xa6d0
movsd -0x48(%rbp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
setnp %al
sete %r13b
andb %al, %r13b
movsd -0x78(%rbp), %xmm0
xorl %edi, %edi
callq 0xaef0
testl %r12d, %r12d
sete %al
movsd -0x40(%rbp), %xmm0
testl %r15d, %r15d
movsd -0x38(%rbp), %xmm1
je 0x1992f
movapd %xmm1, %xmm0
movl 0x1d0(%r14), %edi
movsd -0x60(%rbp), %xmm2
subsd -0x80(%rbp), %xmm2
orb %al, %r13b
movsd -0x30(%rbp), %xmm1
movsd %xmm2, -0x60(%rbp)
jne 0x199ae
movsd -0x48(%rbp), %xmm8
addsd %xmm2, %xmm8
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd 0x80(%rbx), %xmm2
movsd %xmm2, (%rsp)
movapd %xmm8, %xmm2
callq 0xa6d0
movsd -0x68(%rbp), %xmm0
xorl %edi, %edi
callq 0xaef0
movl 0x1d0(%r14), %edi
testl %r15d, %r15d
je 0x199d8
movsd -0x38(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
jmp 0x199e2
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd 0x80(%rbx), %xmm8
movsd %xmm8, (%rsp)
jmp 0x19a12
movsd -0x40(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd 0x80(%rbx), %xmm1
movsd %xmm1, (%rsp)
movsd -0x30(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
callq 0xa6d0
callq 0xa5f0
movl 0x1d0(%r14), %edi
movsd 0x8(%rbx), %xmm3
movsd 0x20(%rbx), %xmm4
movsd 0x38(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x68(%rbx), %xmm7
movsd 0x80(%rbx), %xmm0
movsd %xmm0, (%rsp)
movsd -0x88(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
callq 0xa8d0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa560
nop