// File: 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
subq $0x30, %rsp
movsd %xmm0, -0x8(%rbp)
callq 0x103d0
movq %rax, %rdi
callq 0x11220
testb $0x1, %al
jne 0x351c0
jmp 0x351dc
cmpl $0x0, 0x71849(%rip)     # 0xa6a10
je 0x351d7
leaq 0x4670a(%rip), %rdi     # 0x7b8da
movb $0x0, %al
callq 0x10060
jmp 0x35431
cmpl $0x0, 0x7182d(%rip)     # 0xa6a10
je 0x351f8
movsd -0x8(%rbp), %xmm0
leaq 0x4670a(%rip), %rdi     # 0x7b8fb
movb $0x1, %al
callq 0x10060
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x20(%rbp)
callq 0x103d0
movq %rax, %rdi
callq 0x12150
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x35431
callq 0x103d0
movq %rax, %rdi
movl -0xc(%rbp), %eax
movl %eax, %esi
callq 0x122b0
movq %rax, -0x18(%rbp)
movsd -0x8(%rbp), %xmm1
movsd 0x717da(%rip), %xmm0    # 0xa6a20
mulsd %xmm1, %xmm0
movsd %xmm0, 0x717ce(%rip)    # 0xa6a20
movsd -0x8(%rbp), %xmm1
movsd 0x717c9(%rip), %xmm0    # 0xa6a28
mulsd %xmm1, %xmm0
movsd %xmm0, 0x717bd(%rip)    # 0xa6a28
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x353ab
jmp 0x3527e
movl -0x24(%rbp), %eax
subl $0x1, %eax
je 0x35337
jmp 0x3528c
movl -0x24(%rbp), %eax
subl $0x2, %eax
jne 0x3541f
jmp 0x3529a
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x40(%rax), %xmm0
movsd %xmm0, 0x40(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x28(%rax), %xmm0
movsd %xmm0, 0x28(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x30(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x60(%rax), %xmm0
movsd %xmm0, 0x60(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x68(%rax), %xmm0
movsd %xmm0, 0x68(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x70(%rax), %xmm0
movsd %xmm0, 0x70(%rax)
jmp 0x35421
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x28(%rax), %xmm0
movsd %xmm0, 0x28(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x30(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x38(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x58(%rax), %xmm0
movsd %xmm0, 0x58(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x60(%rax), %xmm0
movsd %xmm0, 0x60(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x68(%rax), %xmm0
movsd %xmm0, 0x68(%rax)
jmp 0x35421
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x28(%rax), %xmm0
movsd %xmm0, 0x28(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, 0x30(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x38(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x58(%rax), %xmm0
movsd %xmm0, 0x58(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x60(%rax), %xmm0
movsd %xmm0, 0x60(%rax)
movsd -0x8(%rbp), %xmm0
movq -0x18(%rbp), %rax
mulsd 0x68(%rax), %xmm0
movsd %xmm0, 0x68(%rax)
jmp 0x35421
jmp 0x35421
jmp 0x35423
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x351ff
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)