#JavaScript ES6 123
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
c=n=>{with(a=[]){for(i=k=1;i++<=n;)for(;!(n%i);n/=i)push(++k%2?pop()*i:i);k%2?0:push(pop()*pop());return isNaN(a[0])?[]:a}}
test=k=>{console.log("n = "+k);console.log(c(k))};
test(-1);
test(0);
test(2);
test(4);
test(64);
test(96);
test(32);
<!-- end snippet -->