// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/interp_queue.cc
// Function: qc_scale(double)
void qc_scale(double scale) {
    
    if(qc().empty()) {
        if(debug_qc) printf("not scaling because qc is empty\n");
        return;
    }

    if(debug_qc) printf("scaling qc by %f\n", scale);

    for(unsigned int i = 0; i<qc().size(); i++) {
        queued_canon &q = qc()[i];
        endpoint[0] *= scale;
        endpoint[1] *= scale;
        switch(q.type) {
        case QARC_FEED:
            q.data.arc_feed.end1 *= scale;
            q.data.arc_feed.end2 *= scale;
            q.data.arc_feed.end3 *= scale;
            q.data.arc_feed.center1 *= scale;
            q.data.arc_feed.center2 *= scale;
            q.data.arc_feed.u *= scale;
            q.data.arc_feed.v *= scale;
            q.data.arc_feed.w *= scale;
            break;
        case QSTRAIGHT_FEED:
            q.data.straight_feed.x *= scale;
            q.data.straight_feed.y *= scale;
            q.data.straight_feed.z *= scale;
            q.data.straight_feed.u *= scale;
            q.data.straight_feed.v *= scale;
            q.data.straight_feed.w *= scale;
            break;
        case QSTRAIGHT_TRAVERSE:
            q.data.straight_traverse.x *= scale;
            q.data.straight_traverse.y *= scale;
            q.data.straight_traverse.z *= scale;
            q.data.straight_traverse.u *= scale;
            q.data.straight_traverse.v *= scale;
            q.data.straight_traverse.w *= scale;
            break;
        default:
            ;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, -0x30(%rbp)
callq 0xb240
movq 0x427ad(%rip), %rax     # 0x5c430
cmpq 0x427ae(%rip), %rax     # 0x5c438
je 0x19db5
xorl %ebx, %ebx
pushq $0x68
popq %r15
pushq $0x60
popq %r12
pushq $0x30
popq %r13
pushq $0x28
popq %r14
movl %ebx, %ebx
callq 0xb240
movq 0x42788(%rip), %rax     # 0x5c438
subq 0x42779(%rip), %rax     # 0x5c430
cqto
pushq $0x78
popq %rcx
idivq %rcx
cmpq %rbx, %rax
jbe 0x19db5
callq 0xb240
movq 0x4275c(%rip), %rcx     # 0x5c430
imulq $0x78, %rbx, %rdx
leaq (%rcx,%rdx), %rax
movsd 0x4277c(%rip), %xmm0    # 0x5c460
movsd -0x30(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x4276b(%rip)    # 0x5c460
movsd 0x42773(%rip), %xmm0    # 0x5c470
mulsd %xmm1, %xmm0
movsd %xmm0, 0x42767(%rip)    # 0x5c470
cmpl $0x2, (%rcx,%rdx)
movq %r14, %r9
movq %r13, %r8
pushq $0x38
popq %rdi
pushq $0x58
popq %rsi
movq %r12, %rdx
movq %r15, %rcx
jb 0x19d56
jne 0x19dae
movsd 0x18(%rax), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rax)
movsd 0x20(%rax), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
pushq $0x40
popq %r9
movq %r14, %r8
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
pushq $0x70
popq %rcx
movsd (%rax,%r9), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax,%r9)
movsd (%rax,%r8), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax,%r8)
movsd (%rax,%rdi), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rdi)
movsd (%rax,%rsi), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rsi)
movsd (%rax,%rdx), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rdx)
movsd (%rax,%rcx), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx)
incl %ebx
jmp 0x19ca2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq