Stretching immediatly before any weight training is bad, there is a certain amount of time you should leave it but i cant remember what it is... Your best way of warming up legs is standing on one leg and just swinging the other gradually high/faster. and hold your arms up and air squat. And make sure you build up gadually, i always go bar, 40, 50,65,85 etc. Also if you havent squatted in a while then there always going to hurt like f**kkkkkkkkkkk. I rememebr when i first started squatting and would literally fall down the stairs when i got out of bed the next day,