// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
pushq %rax
movsd %xmm0, -0x20(%rbp)
callq 0xa210
movq 0x48b78(%rip), %rax     # 0x63370
cmpq 0x48b79(%rip), %rax     # 0x63378
je 0x1a966
callq 0xa210
movq 0x48b67(%rip), %rax     # 0x63378
cmpq 0x48b58(%rip), %rax     # 0x63370
je 0x1a966
movl $0x1, %ebx
xorl %r15d, %r15d
movabsq $-0x1111111111111111, %r14 # imm = 0xEEEEEEEEEEEEEEEF
callq 0xa210
movq 0x48b34(%rip), %rcx     # 0x63370
imulq $0x78, %r15, %rdx
leaq (%rcx,%rdx), %rax
movsd 0x48b54(%rip), %xmm0    # 0x633a0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x48b43(%rip)    # 0x633a0
movsd 0x48b4b(%rip), %xmm0    # 0x633b0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x48b3f(%rip)    # 0x633b0
cmpl $0x2, (%rcx,%rdx)
jae 0x1a899
movl $0x68, %ecx
movl $0x60, %edx
movl $0x58, %esi
movl $0x38, %edi
movl $0x30, %r8d
movl $0x28, %r9d
jmp 0x1a8e0
jne 0x1a93d
movsd 0x18(%rax), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rax)
movsd 0x20(%rax), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
movl $0x70, %ecx
movl $0x68, %edx
movl $0x60, %esi
movl $0x30, %edi
movl $0x28, %r8d
movl $0x40, %r9d
movsd (%rax,%r9), %xmm0
movsd -0x20(%rbp), %xmm1
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)
movl %ebx, %r15d
callq 0xa210
movq 0x48a2c(%rip), %rax     # 0x63378
subq 0x48a1d(%rip), %rax     # 0x63370
sarq $0x3, %rax
imulq %r14, %rax
incl %ebx
cmpq %r15, %rax
ja 0x1a830
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq