fork download
  1. .data
  2. x:
  3. .long 0
  4. s:
  5. .string "%d\n\0"
  6. y:
  7. .long 5
  8.  
  9. .text
  10. .global main
  11. main: # int main()
  12. # {
  13.  
  14. pushl y # printf("%d\n", y);
  15. pushl $s
  16. call printf
  17. addl $8, %esp
  18. loop: # for (;;) {
  19. pushl $x # scanf("%d", &x);
  20. pushl $s
  21. call scanf
  22. addl $8, %esp
  23.  
  24. movl x, %eax # if (x == 42) break;
  25. subl $42, %eax
  26. jz break
  27.  
  28. pushl x # printf("%d\n", x);
  29. pushl $s
  30. call printf
  31. addl $8, %esp
  32.  
  33. jmp loop # }
  34. break:
  35.  
  36. xor %eax, %eax # return 0;
  37. ret
  38. # }
  39.  
Success #stdin #stdout 0s 4524KB
stdin
1
2
10
42
11
stdout
5
1
2
10