// File: /workspace/github_cpp_makefile_star2_O3/sundale[P]gcode/rs274ngc/interp_queue.cc
// Function: dequeue_canons(setup_struct*)
void dequeue_canons(setup_pointer settings) {

    if(debug_qc) printf("dequeueing: endpoint is now invalid\n");
    endpoint_valid = 0;

    if(qc().empty()) return;

    for(unsigned int i = 0; i<qc().size(); i++) {
        queued_canon &q = qc()[i];

        switch(q.type) {
        case QARC_FEED:
            if(debug_qc) printf("issuing arc feed lineno %d\n", q.data.arc_feed.line_number);
            ARC_FEED(q.data.arc_feed.line_number, 
                     latheorigin_z(settings, q.data.arc_feed.end1), 
                     latheorigin_x(settings, q.data.arc_feed.end2), 
                     latheorigin_z(settings, q.data.arc_feed.center1),
                     latheorigin_x(settings, q.data.arc_feed.center2), 
                     q.data.arc_feed.turn, 
                     q.data.arc_feed.end3,
                     q.data.arc_feed.a, q.data.arc_feed.b, q.data.arc_feed.c, 
                     q.data.arc_feed.u, q.data.arc_feed.v, q.data.arc_feed.w);
            break;
        case QSTRAIGHT_FEED:
            if(debug_qc) printf("issuing straight feed lineno %d\n", q.data.straight_feed.line_number);
            STRAIGHT_FEED(q.data.straight_feed.line_number, 
                          latheorigin_x(settings, q.data.straight_feed.x), 
                          q.data.straight_feed.y, 
                          latheorigin_z(settings, q.data.straight_feed.z),
                          q.data.straight_feed.a, q.data.straight_feed.b, q.data.straight_feed.c, 
                          q.data.straight_feed.u, q.data.straight_feed.v, q.data.straight_feed.w);
            break;
        case QSTRAIGHT_TRAVERSE:
            if(debug_qc) printf("issuing straight traverse lineno %d\n", q.data.straight_traverse.line_number);
            STRAIGHT_TRAVERSE(q.data.straight_traverse.line_number, 
                              latheorigin_x(settings, q.data.straight_traverse.x),
                              q.data.straight_traverse.y,
                              latheorigin_z(settings, q.data.straight_traverse.z),
                              q.data.straight_traverse.a, q.data.straight_traverse.b, q.data.straight_traverse.c, 
                              q.data.straight_traverse.u, q.data.straight_traverse.v, q.data.straight_traverse.w);
            break;
        case QSET_FEED_RATE:
            if(debug_qc) printf("issuing set feed rate\n");
            SET_FEED_RATE(q.data.set_feed_rate.feed);
            break;
        case QDWELL:
            if(debug_qc) printf("issuing dwell\n");
            DWELL(q.data.dwell.time);
            break;
        case QSET_FEED_MODE:
            if(debug_qc) printf("issuing set feed mode\n");
            SET_FEED_MODE(q.data.set_feed_mode.mode);
            break;
        case QMIST_ON:
            if(debug_qc) printf("issuing mist on\n");
            MIST_ON();
            break;
        case QMIST_OFF:
            if(debug_qc) printf("issuing mist off\n");
            MIST_OFF();
            break;
        case QFLOOD_ON:
            if(debug_qc) printf("issuing flood on\n");
            FLOOD_ON();
            break;
        case QFLOOD_OFF:
            if(debug_qc) printf("issuing flood off\n");
            FLOOD_OFF();
            break;
        case QSTART_SPINDLE_CLOCKWISE:
            if(debug_qc) printf("issuing spindle clockwise\n");
            START_SPINDLE_CLOCKWISE();
            break;
        case QSTART_SPINDLE_COUNTERCLOCKWISE:
            if(debug_qc) printf("issuing spindle counterclockwise\n");
            START_SPINDLE_COUNTERCLOCKWISE();
            break;
        case QSTOP_SPINDLE_TURNING:
            if(debug_qc) printf("issuing stop spindle\n");
            STOP_SPINDLE_TURNING();
            break;
        case QSET_SPINDLE_MODE:
            if(debug_qc) printf("issuing set spindle mode\n");
            SET_SPINDLE_MODE(q.data.set_spindle_mode.mode);
            break;
        case QSET_SPINDLE_SPEED:
            if(debug_qc) printf("issuing set spindle speed\n");
            SET_SPINDLE_SPEED(q.data.set_spindle_speed.speed);
            break;
        case QCOMMENT:
            if(debug_qc) printf("issuing comment\n");
            COMMENT(q.data.comment.comment);
            free(q.data.comment.comment);
            break;
        case QM_USER_COMMAND:
            if(debug_qc) printf("issuing mcommand\n");
            {int index=q.data.mcommand.index;
              (*(USER_DEFINED_FUNCTION[index - 100])) (index -100,
                                                    q.data.mcommand.p_number,
                                                    q.data.mcommand.q_number);
            }
            break;
        }
    }
    qc().clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movb $0x0, 0x46898(%rip)     # 0x60390
callq 0xa210
movq 0x4686c(%rip), %rax     # 0x60370
cmpq 0x4686d(%rip), %rax     # 0x60378
je 0x19f4d
movq %rbx, -0x30(%rbp)
callq 0xa210
movq 0x46857(%rip), %rax     # 0x60378
cmpq 0x46848(%rip), %rax     # 0x60370
je 0x19f31
movl $0x1, %r14d
xorl %ebx, %ebx
movabsq $-0x1111111111111111, %r15 # imm = 0xEEEEEEEEEEEEEEEF
leaq 0x1cc45(%rip), %r12     # 0x3678c
callq 0xa210
movq 0x4681d(%rip), %r13     # 0x60370
imulq $0x78, %rbx, %rcx
movl (%r13,%rcx), %eax
cmpq $0x10, %rax
ja 0x19f07
addq %rcx, %r13
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movsd 0x28(%r13), %xmm0
movq -0x30(%rbp), %rcx
cmpl $0x3, 0xc67c(%rcx)
jne 0x19e87
movl 0x620(%rcx), %eax
movsd 0x618(%rcx), %xmm3
cmpl $0x6, %eax
ja 0x19baa
movl $0x46, %ecx
btl %eax, %ecx
jae 0x19baa
subsd %xmm3, %xmm0
cmpl $0x8, %eax
ja 0x19bbd
movl $0x118, %ecx            # imm = 0x118
btl %eax, %ecx
jae 0x19bbd
addsd %xmm3, %xmm0
movsd 0x38(%r13), %xmm2
cmpl $0x7, %eax
ja 0x19bd6
movl $0x8c, %ecx
btl %eax, %ecx
jae 0x19bd6
subsd %xmm3, %xmm2
movsd 0x30(%r13), %xmm1
cmpl $0x5, %eax
ja 0x19e93
movl $0x32, %ecx
btl %eax, %ecx
jae 0x19e93
addsd %xmm3, %xmm2
jmp 0x19e93
movslq 0x8(%r13), %rax
leaq -0x64(%rax), %rdi
movsd 0x10(%r13), %xmm0
movsd 0x18(%r13), %xmm1
movq 0x273c1(%rip), %rcx     # 0x40fd8
callq *-0x320(%rcx,%rax,8)
jmp 0x19f07
movsd 0x8(%r13), %xmm0
callq 0xa4f0
jmp 0x19f07
callq 0xaf20
jmp 0x19f07
movsd 0x8(%r13), %xmm0
callq 0xa040
jmp 0x19f07
callq 0xabb0
jmp 0x19f07
callq 0xa710
jmp 0x19f07
movl 0x8(%r13), %edi
movsd 0x18(%r13), %xmm0
movq -0x30(%rbp), %rcx
cmpl $0x3, 0xc67c(%rcx)
jne 0x19e38
movl 0x620(%rcx), %eax
movsd 0x618(%rcx), %xmm4
cmpl $0x7, %eax
ja 0x19c9d
movl $0x8c, %ecx
btl %eax, %ecx
jae 0x19c9d
subsd %xmm4, %xmm0
cmpl $0x5, %eax
ja 0x19cb0
movl $0x32, %ecx
btl %eax, %ecx
jae 0x19cb0
addsd %xmm4, %xmm0
movsd 0x20(%r13), %xmm1
cmpl $0x6, %eax
ja 0x19cc9
movl $0x46, %ecx
btl %eax, %ecx
jae 0x19cc9
subsd %xmm4, %xmm1
cmpl $0x8, %eax
ja 0x19cdc
movl $0x118, %ecx            # imm = 0x118
btl %eax, %ecx
jae 0x19cdc
addsd %xmm4, %xmm1
movsd 0x28(%r13), %xmm2
cmpl $0x7, %eax
ja 0x19cf5
movl $0x8c, %ecx
btl %eax, %ecx
jae 0x19cf5
subsd %xmm4, %xmm2
cmpl $0x5, %eax
ja 0x19d08
movl $0x32, %ecx
btl %eax, %ecx
jae 0x19d08
addsd %xmm4, %xmm2
movsd 0x30(%r13), %xmm3
cmpl $0x6, %eax
ja 0x19d21
movl $0x46, %ecx
btl %eax, %ecx
jae 0x19d21
subsd %xmm4, %xmm3
cmpl $0x8, %eax
ja 0x19e4a
movl $0x118, %ecx            # imm = 0x118
btl %eax, %ecx
jae 0x19e4a
addsd %xmm4, %xmm3
jmp 0x19e4a
movq 0x8(%r13), %rdi
callq 0xa800
movq 0x8(%r13), %rdi
callq 0xacf0
jmp 0x19f07
movsd 0x8(%r13), %xmm0
callq 0xab70
jmp 0x19f07
callq 0xa0f0
jmp 0x19f07
movsd 0x28(%r13), %xmm0
movq -0x30(%rbp), %rcx
cmpl $0x3, 0xc67c(%rcx)
jne 0x19ec8
movl 0x620(%rcx), %eax
movsd 0x618(%rcx), %xmm3
cmpl $0x6, %eax
ja 0x19daa
movl $0x46, %ecx
btl %eax, %ecx
jae 0x19daa
subsd %xmm3, %xmm0
cmpl $0x8, %eax
ja 0x19dbd
movl $0x118, %ecx            # imm = 0x118
btl %eax, %ecx
jae 0x19dbd
addsd %xmm3, %xmm0
movsd 0x38(%r13), %xmm2
cmpl $0x7, %eax
ja 0x19dd6
movl $0x8c, %ecx
btl %eax, %ecx
jae 0x19dd6
subsd %xmm3, %xmm2
movsd 0x30(%r13), %xmm1
cmpl $0x5, %eax
ja 0x19ed4
movl $0x32, %ecx
btl %eax, %ecx
jae 0x19ed4
addsd %xmm3, %xmm2
jmp 0x19ed4
movl 0x8(%r13), %edi
callq 0xb1e0
jmp 0x19f07
movsd 0x8(%r13), %xmm0
callq 0xab80
jmp 0x19f07
callq 0xb260
jmp 0x19f07
callq 0xaba0
jmp 0x19f07
callq 0xa7e0
jmp 0x19f07
movsd 0x20(%r13), %xmm1
movsd 0x28(%r13), %xmm2
movsd 0x30(%r13), %xmm3
movl 0x38(%r13), %esi
movsd 0x40(%r13), %xmm4
movsd 0x48(%r13), %xmm5
movsd 0x50(%r13), %xmm6
movsd 0x58(%r13), %xmm7
movups 0x60(%r13), %xmm8
movsd 0x70(%r13), %xmm9
movsd %xmm9, 0x10(%rsp)
movups %xmm8, (%rsp)
callq 0xb520
jmp 0x19f07
movsd 0x30(%r13), %xmm1
movsd 0x38(%r13), %xmm2
movl 0x8(%r13), %edi
movsd 0x40(%r13), %xmm3
movsd 0x48(%r13), %xmm4
movsd 0x50(%r13), %xmm5
movsd 0x58(%r13), %xmm6
movsd 0x60(%r13), %xmm7
movsd 0x68(%r13), %xmm8
movsd %xmm8, (%rsp)
callq 0xa8d0
jmp 0x19f07
movsd 0x30(%r13), %xmm1
movsd 0x38(%r13), %xmm2
movl 0x8(%r13), %edi
movsd 0x40(%r13), %xmm3
movsd 0x48(%r13), %xmm4
movsd 0x50(%r13), %xmm5
movsd 0x58(%r13), %xmm6
movsd 0x60(%r13), %xmm7
movsd 0x68(%r13), %xmm8
movsd %xmm8, (%rsp)
callq 0xa6d0
movl %r14d, %ebx
callq 0xa210
movq 0x46462(%rip), %rax     # 0x60378
subq 0x46453(%rip), %rax     # 0x60370
sarq $0x3, %rax
imulq %r15, %rax
incl %r14d
cmpq %rbx, %rax
ja 0x19b47
callq 0xa210
movq 0x46433(%rip), %rax     # 0x60370
cmpq %rax, 0x46434(%rip)     # 0x60378
je 0x19f4d
movq %rax, 0x4642b(%rip)     # 0x60378
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq