Add -masm=intel in C flags which will not work on Mac Os X. Put it in comments. Try to convert the Intel assembly to AT&T.