// File: /workspace/github_cpp_makefile_star2_O2/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 0x18e11
movapd %xmm3, %xmm0
subsd %xmm2, %xmm0
movapd %xmm0, %xmm2
jmp 0x18e15
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 0xb970
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 0x18edf
callq 0xb360
movsd -0x68(%rbp), %xmm0
xorl %edi, %edi
callq 0xc020
movsd 0x80(%rbx), %xmm9
testl %r15d, %r15d
je 0x18f34
movsd -0x38(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x40(%rbp), %xmm8
jmp 0x18f49
movl 0x1d0(%r14), %edi
movsd -0x40(%rbp), %xmm0
testl %r15d, %r15d
je 0x18ef5
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 0xb970
callq 0xb360
jmp 0x18fcd
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 0x18f7c
movsd -0x38(%rbp), %xmm8
movsd %xmm8, -0x70(%rbp)
callq 0xb720
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 0xb720
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 0xc020
testl %r12d, %r12d
sete %al
movsd -0x40(%rbp), %xmm0
testl %r15d, %r15d
movsd -0x38(%rbp), %xmm1
je 0x19009
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 0x19088
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 0xb720
movsd -0x68(%rbp), %xmm0
xorl %edi, %edi
callq 0xc020
movl 0x1d0(%r14), %edi
testl %r15d, %r15d
je 0x190b2
movsd -0x38(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
jmp 0x190bc
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 0x190ec
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 0xb720
callq 0xb630
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 0xb970
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb5b0
nop