Why are the disassemblies of these two simple statements slightly different?
===

I wrote two simple programs that store the same integer value to two different variables, and I'm wondering why the disassembly is slightly different between both programs. 

First program:

    int y;
    int x = (y = 2);

Disassembly:

    0000003a  mov         dword ptr [ebp-40h],2 
    00000041  mov         eax,dword ptr [ebp-40h] 
    00000044  mov         dword ptr [ebp-44h],eax

Second program:

    int x = 2, y = 2;

Disassembly:

    0000003a  mov         dword ptr [ebp-40h],2 
    00000041  mov         dword ptr [ebp-44h],2 

The second line in the first program, which is clearly the only change, simply copies the value pointed to by `[ebp-40h]` into the `eax` registry, right? Maybe it's a dumb question, but why are these slightly different? I'm not very familiar with assembly, to say the least, so I take it that you have to move a value into a registry before pointing to it? (or whatever the third line does. I think it's pointing...)

For the sake of readability, I plan to never instantiate variables in serious code like I did in the first program. 