.text .LC0: .string "Enter x: " .LC1: .string "%d" .LC2: .string "sum is %d\n" .text .globl main main: pushl %ebp movl %esp, %ebp andl $-16, %esp subl $32, %esp movl $.LC0, (%esp) call printf leal 24(%esp), %eax movl %eax, 4(%esp) movl $.LC1, (%esp) call __isoc99_scanf movl 24(%esp), %eax movl %eax, (%esp) call loopsum movl %eax, 28(%esp) movl 28(%esp), %eax movl %eax, 4(%esp) movl $.LC2, (%esp) call printf movl $0, %eax leave ret .globl loopsum loopsum: