// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %rdi, -0x40(%rbp)
movb $0x0, 0x42670(%rip)     # 0x5c450
callq 0xb240
movq 0x42644(%rip), %rax     # 0x5c430
cmpq 0x42645(%rip), %rax     # 0x5c438
je 0x1a0a1
xorl %r15d, %r15d
pushq $0x78
popq %r12
leaq 0x18991(%rip), %r13     # 0x32798
movl %r15d, %r15d
callq 0xb240
movq 0x42622(%rip), %rax     # 0x5c438
subq 0x42613(%rip), %rax     # 0x5c430
cqto
idivq %r12
movq %rax, %r14
callq 0xb240
movq 0x425ff(%rip), %rbx     # 0x5c430
cmpq %r15, %r14
jbe 0x1a091
imulq $0x78, %r15, %rcx
movl (%rbx,%rcx), %eax
cmpq $0x10, %rax
ja 0x1a089
addq %rcx, %rbx
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movl 0x8(%rbx), %r14d
movsd 0x28(%rbx), %xmm0
movq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x1a0f3
movsd %xmm0, -0x38(%rbp)
movsd 0x30(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x38(%rbx), %xmm0
movq %r12, %rdi
pushq $0x78
popq %r12
callq 0x1a0b0
movaps %xmm0, %xmm2
movsd 0x40(%rbx), %xmm3
movsd 0x48(%rbx), %xmm4
movsd 0x50(%rbx), %xmm5
movsd 0x58(%rbx), %xmm6
movsd 0x60(%rbx), %xmm7
movsd 0x68(%rbx), %xmm0
movsd %xmm0, (%rsp)
movl %r14d, %edi
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0xb970
jmp 0x1a089
movslq 0x8(%rbx), %rax
leaq -0x64(%rax), %rdi
movsd 0x10(%rbx), %xmm0
movsd 0x18(%rbx), %xmm1
movq 0x230f5(%rip), %rcx     # 0x3cfd8
callq *-0x320(%rcx,%rax,8)
jmp 0x1a089
movsd 0x8(%rbx), %xmm0
callq 0xb530
jmp 0x1a089
callq 0xc050
jmp 0x1a089
movsd 0x8(%rbx), %xmm0
callq 0xb040
jmp 0x1a089
callq 0xbca0
jmp 0x1a089
callq 0xb760
jmp 0x1a089
movl 0x8(%rbx), %eax
movl %eax, -0x38(%rbp)
movsd 0x18(%rbx), %xmm0
movq -0x40(%rbp), %r14
movq %r14, %rdi
callq 0x1a0b0
movsd %xmm0, -0x30(%rbp)
movsd 0x20(%rbx), %xmm0
movq %r14, %rdi
callq 0x1a0f3
movsd %xmm0, -0x50(%rbp)
movsd 0x28(%rbx), %xmm0
movq %r14, %rdi
callq 0x1a0b0
movsd %xmm0, -0x48(%rbp)
movsd 0x30(%rbx), %xmm0
movq %r14, %rdi
callq 0x1a0f3
movaps %xmm0, %xmm3
movl 0x38(%rbx), %esi
movsd 0x40(%rbx), %xmm4
movsd 0x48(%rbx), %xmm5
movsd 0x50(%rbx), %xmm6
movsd 0x58(%rbx), %xmm7
movups 0x60(%rbx), %xmm0
movsd 0x70(%rbx), %xmm1
movsd %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl -0x38(%rbp), %edi
movsd -0x30(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
callq 0xc690
jmp 0x1a089
movq 0x8(%rbx), %rdi
callq 0xb870
movq 0x8(%rbx), %rdi
callq 0xbde0
jmp 0x1a089
movsd 0x8(%rbx), %xmm0
callq 0xbc60
jmp 0x1a089
callq 0xb100
jmp 0x1a089
movl 0x8(%rbx), %r14d
movsd 0x28(%rbx), %xmm0
movq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x1a0f3
movsd %xmm0, -0x38(%rbp)
movsd 0x30(%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x38(%rbx), %xmm0
movq %r12, %rdi
pushq $0x78
popq %r12
callq 0x1a0b0
movaps %xmm0, %xmm2
movsd 0x40(%rbx), %xmm3
movsd 0x48(%rbx), %xmm4
movsd 0x50(%rbx), %xmm5
movsd 0x58(%rbx), %xmm6
movsd 0x60(%rbx), %xmm7
movsd 0x68(%rbx), %xmm0
movsd %xmm0, (%rsp)
movl %r14d, %edi
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
callq 0xb720
jmp 0x1a089
movl 0x8(%rbx), %edi
callq 0xc340
jmp 0x1a089
movsd 0x8(%rbx), %xmm0
callq 0xbc70
jmp 0x1a089
callq 0xc3c0
jmp 0x1a089
callq 0xbc90
jmp 0x1a089
callq 0xb850
incl %r15d
jmp 0x19e07
cmpq %rbx, 0x423a0(%rip)     # 0x5c438
je 0x1a0a1
movq %rbx, 0x42397(%rip)     # 0x5c438
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq