// File: /workspace/github_cpp_makefile_star2_O3/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 0x46a0c(%rip), %rax     # 0x60370
cmpq 0x46a0d(%rip), %rax     # 0x60378
je 0x19ad2
callq 0xa210
movq 0x469fb(%rip), %rax     # 0x60378
cmpq 0x469ec(%rip), %rax     # 0x60370
je 0x19ad2
movl $0x1, %ebx
xorl %r15d, %r15d
movabsq $-0x1111111111111111, %r14 # imm = 0xEEEEEEEEEEEEEEEF
callq 0xa210
movq 0x469c8(%rip), %rcx     # 0x60370
imulq $0x78, %r15, %rdx
leaq (%rcx,%rdx), %rax
movsd 0x469e8(%rip), %xmm0    # 0x603a0
movsd -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x469d7(%rip)    # 0x603a0
movsd 0x469df(%rip), %xmm0    # 0x603b0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x469d3(%rip)    # 0x603b0
cmpl $0x2, (%rcx,%rdx)
jae 0x19a05
movl $0x68, %ecx
movl $0x60, %edx
movl $0x58, %esi
movl $0x38, %edi
movl $0x30, %r8d
movl $0x28, %r9d
jmp 0x19a4c
jne 0x19aa9
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 0x468c0(%rip), %rax     # 0x60378
subq 0x468b1(%rip), %rax     # 0x60370
sarq $0x3, %rax
imulq %r14, %rax
incl %ebx
cmpq %r15, %rax
ja 0x1999c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq