// File: /workspace/github_cpp_makefile_star2_O1/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 $0x18, %rsp
movq %rdi, %rbx
movb $0x0, 0x48a04(%rip)     # 0x63390
callq 0xa210
movq 0x489d8(%rip), %rax     # 0x63370
cmpq 0x489d9(%rip), %rax     # 0x63378
je 0x1ad88
callq 0xa210
movq 0x489c7(%rip), %rax     # 0x63378
cmpq 0x489b8(%rip), %rax     # 0x63370
je 0x1ad6c
movl $0x1, %r14d
xorl %r15d, %r15d
leaq 0x1edbe(%rip), %r12     # 0x3978c
callq 0xa210
movq 0x48996(%rip), %r13     # 0x63370
imulq $0x78, %r15, %rcx
movl (%r13,%rcx), %eax
cmpq $0x10, %rax
ja 0x1ad38
addq %rcx, %r13
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movsd 0x28(%r13), %xmm0
movl 0x620(%rbx), %eax
movsd 0x618(%rbx), %xmm1
movl 0xc67c(%rbx), %ecx
cmpl $0x3, %ecx
jne 0x1aa3e
cmpl $0x6, %eax
ja 0x1aa2b
movl $0x46, %edx
btl %eax, %edx
jae 0x1aa2b
subsd %xmm1, %xmm0
cmpl $0x8, %eax
ja 0x1aa3e
movl $0x118, %edx            # imm = 0x118
btl %eax, %edx
jae 0x1aa3e
addsd %xmm1, %xmm0
movsd 0x38(%r13), %xmm2
cmpl $0x3, %ecx
jne 0x1aa6f
cmpl $0x7, %eax
ja 0x1aa5c
movl $0x8c, %ecx
btl %eax, %ecx
jae 0x1aa5c
subsd %xmm1, %xmm2
cmpl $0x5, %eax
ja 0x1aa6f
movl $0x32, %ecx
btl %eax, %ecx
jae 0x1aa6f
addsd %xmm1, %xmm2
movl 0x8(%r13), %edi
movsd 0x30(%r13), %xmm1
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 0x1ad38
movslq 0x8(%r13), %rax
leaq -0x64(%rax), %rdi
movsd 0x10(%r13), %xmm0
movsd 0x18(%r13), %xmm1
movq 0x29510(%rip), %rcx     # 0x43fd8
callq *-0x320(%rcx,%rax,8)
jmp 0x1ad38
movsd 0x8(%r13), %xmm0
callq 0xa4f0
jmp 0x1ad38
callq 0xaf20
jmp 0x1ad38
movsd 0x8(%r13), %xmm0
callq 0xa040
jmp 0x1ad38
callq 0xabb0
jmp 0x1ad38
callq 0xa710
jmp 0x1ad38
movsd 0x18(%r13), %xmm0
movl 0x620(%rbx), %eax
movsd 0x618(%rbx), %xmm4
movl 0xc67c(%rbx), %ecx
cmpl $0x3, %ecx
jne 0x1ab57
cmpl $0x7, %eax
ja 0x1ab44
movl $0x8c, %edx
btl %eax, %edx
jae 0x1ab44
subsd %xmm4, %xmm0
cmpl $0x5, %eax
ja 0x1ab57
movl $0x32, %edx
btl %eax, %edx
jae 0x1ab57
addsd %xmm4, %xmm0
movsd 0x20(%r13), %xmm1
cmpl $0x3, %ecx
jne 0x1ab88
cmpl $0x6, %eax
ja 0x1ab75
movl $0x46, %edx
btl %eax, %edx
jae 0x1ab75
subsd %xmm4, %xmm1
cmpl $0x8, %eax
ja 0x1ab88
movl $0x118, %edx            # imm = 0x118
btl %eax, %edx
jae 0x1ab88
addsd %xmm4, %xmm1
movsd 0x28(%r13), %xmm2
cmpl $0x3, %ecx
jne 0x1abb9
cmpl $0x7, %eax
ja 0x1aba6
movl $0x8c, %edx
btl %eax, %edx
jae 0x1aba6
subsd %xmm4, %xmm2
cmpl $0x5, %eax
ja 0x1abb9
movl $0x32, %edx
btl %eax, %edx
jae 0x1abb9
addsd %xmm4, %xmm2
movl 0x8(%r13), %edi
movsd 0x30(%r13), %xmm3
cmpl $0x3, %ecx
jne 0x1abee
cmpl $0x6, %eax
ja 0x1abdb
movl $0x46, %ecx
btl %eax, %ecx
jae 0x1abdb
subsd %xmm4, %xmm3
cmpl $0x8, %eax
ja 0x1abee
movl $0x118, %ecx            # imm = 0x118
btl %eax, %ecx
jae 0x1abee
addsd %xmm4, %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 0x1ad38
movq 0x8(%r13), %rdi
callq 0xa800
movq 0x8(%r13), %rdi
callq 0xacf0
jmp 0x1ad38
movsd 0x8(%r13), %xmm0
callq 0xab70
jmp 0x1ad38
callq 0xa0f0
jmp 0x1ad38
movsd 0x28(%r13), %xmm0
movl 0x620(%rbx), %eax
movsd 0x618(%rbx), %xmm1
movl 0xc67c(%rbx), %ecx
cmpl $0x3, %ecx
jne 0x1aca1
cmpl $0x6, %eax
ja 0x1ac8e
movl $0x46, %edx
btl %eax, %edx
jae 0x1ac8e
subsd %xmm1, %xmm0
cmpl $0x8, %eax
ja 0x1aca1
movl $0x118, %edx            # imm = 0x118
btl %eax, %edx
jae 0x1aca1
addsd %xmm1, %xmm0
movsd 0x38(%r13), %xmm2
cmpl $0x3, %ecx
jne 0x1acd2
cmpl $0x7, %eax
ja 0x1acbf
movl $0x8c, %ecx
btl %eax, %ecx
jae 0x1acbf
subsd %xmm1, %xmm2
cmpl $0x5, %eax
ja 0x1acd2
movl $0x32, %ecx
btl %eax, %ecx
jae 0x1acd2
addsd %xmm1, %xmm2
movl 0x8(%r13), %edi
movsd 0x30(%r13), %xmm1
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
jmp 0x1ad38
movl 0x8(%r13), %edi
callq 0xb1e0
jmp 0x1ad38
movsd 0x8(%r13), %xmm0
callq 0xab80
jmp 0x1ad38
callq 0xb260
jmp 0x1ad38
callq 0xaba0
jmp 0x1ad38
callq 0xa7e0
movl %r14d, %r15d
callq 0xa210
movq 0x48631(%rip), %rax     # 0x63378
subq 0x48622(%rip), %rax     # 0x63370
sarq $0x3, %rax
movabsq $-0x1111111111111111, %rcx # imm = 0xEEEEEEEEEEEEEEEF
imulq %rcx, %rax
incl %r14d
cmpq %r15, %rax
ja 0x1a9ce
callq 0xa210
movq 0x485f8(%rip), %rax     # 0x63370
cmpq %rax, 0x485f9(%rip)     # 0x63378
je 0x1ad88
movq %rax, 0x485f0(%rip)     # 0x63378
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop