movl DWORD[%ebp+8], %eax
AS assembler is not accepting this line with following error:
junk [%ebp+8] after expression
How to properly rewrite it in AT&T syntax?
You'd write it as:
movl %eax, 8(%ebp)