fork(9) download
  1. .file "sample.c"
  2. .text
  3. .globl is_all_zero
  4. .type is_all_zero, @function
  5. is_all_zero:
  6. .LFB0:
  7. .cfi_startproc
  8. pushl %ebp
  9. .cfi_def_cfa_offset 8
  10. .cfi_offset 5, -8
  11. movl %esp, %ebp
  12. .cfi_def_cfa_register 5
  13. subl $16, %esp
  14. movl $0, -4(%ebp)
  15. jmp .L2
  16. .L5:
  17. movl 8(%ebp), %edx
  18. movl -4(%ebp), %eax
  19. addl %edx, %eax
  20. movzbl (%eax), %eax
  21. testb %al, %al
  22. je .L3
  23. movl $0, %eax
  24. jmp .L4
  25. .L3:
  26. addl $1, -4(%ebp)
  27. .L2:
  28. cmpl $99, -4(%ebp)
  29. jbe .L5
  30. movl $1, %eax
  31. .L4:
  32. leave
  33. .cfi_restore 5
  34. .cfi_def_cfa 4, 4
  35. ret
  36. .cfi_endproc
  37. .LFE0:
  38. .size is_all_zero, .-is_all_zero
  39. .globl main
  40. .type main, @function
  41. main:
  42. .LFB1:
  43. .cfi_startproc
  44. leal 4(%esp), %ecx
  45. .cfi_def_cfa 1, 0
  46. andl $-16, %esp
  47. pushl -4(%ecx)
  48. pushl %ebp
  49. .cfi_escape 0x10,0x5,0x2,0x75,0
  50. movl %esp, %ebp
  51. pushl %ecx
  52. .cfi_escape 0xf,0x3,0x75,0x7c,0x6
  53. subl $372, %esp
  54. movl $0, -12(%ebp)
  55. movl stdin, %eax
  56. subl $4, %esp
  57. pushl %eax
  58. pushl $101
  59. leal -233(%ebp), %eax
  60. pushl %eax
  61. call fgets
  62. addl $16, %esp
  63. movl $0, -16(%ebp)
  64. jmp .L7
  65. .L8:
  66. leal -233(%ebp), %edx
  67. movl -16(%ebp), %eax
  68. addl %edx, %eax
  69. movzbl (%eax), %eax
  70. movsbl %al, %eax
  71. subl $48, %eax
  72. testl %eax, %eax
  73. setne %dl
  74. leal -132(%ebp), %ecx
  75. movl -16(%ebp), %eax
  76. addl %ecx, %eax
  77. movb %dl, (%eax)
  78. addl $1, -16(%ebp)
  79. .L7:
  80. cmpl $99, -16(%ebp)
  81. jbe .L8
  82. movl $0, -20(%ebp)
  83. jmp .L9
  84. .L12:
  85. movl $0, -24(%ebp)
  86. movl $0, -28(%ebp)
  87. jmp .L10
  88. .L11:
  89. sall -24(%ebp)
  90. leal -132(%ebp), %edx
  91. movl -28(%ebp), %eax
  92. addl %edx, %eax
  93. movzbl (%eax), %eax
  94. movzbl %al, %eax
  95. addl %eax, -24(%ebp)
  96. movl -24(%ebp), %ecx
  97. movl $1717986919, %edx
  98. movl %ecx, %eax
  99. imull %edx
  100. sarl $2, %edx
  101. movl %ecx, %eax
  102. sarl $31, %eax
  103. subl %eax, %edx
  104. movl %edx, %eax
  105. testl %eax, %eax
  106. setne %dl
  107. leal -132(%ebp), %ecx
  108. movl -28(%ebp), %eax
  109. addl %ecx, %eax
  110. movb %dl, (%eax)
  111. movl -24(%ebp), %ecx
  112. movl $1717986919, %edx
  113. movl %ecx, %eax
  114. imull %edx
  115. sarl $2, %edx
  116. movl %ecx, %eax
  117. sarl $31, %eax
  118. subl %eax, %edx
  119. movl %edx, %eax
  120. sall $2, %eax
  121. addl %edx, %eax
  122. addl %eax, %eax
  123. subl %eax, %ecx
  124. movl %ecx, %eax
  125. movl %eax, -24(%ebp)
  126. addl $1, -28(%ebp)
  127. .L10:
  128. cmpl $99, -28(%ebp)
  129. jbe .L11
  130. movl -20(%ebp), %eax
  131. movl -24(%ebp), %edx
  132. movl %edx, -368(%ebp,%eax,4)
  133. movl -20(%ebp), %eax
  134. addl $1, %eax
  135. movl %eax, -12(%ebp)
  136. addl $1, -20(%ebp)
  137. .L9:
  138. subl $12, %esp
  139. leal -132(%ebp), %eax
  140. pushl %eax
  141. call is_all_zero
  142. addl $16, %esp
  143. xorl $1, %eax
  144. testb %al, %al
  145. jne .L12
  146. movl $0, -32(%ebp)
  147. jmp .L13
  148. .L14:
  149. movl -12(%ebp), %eax
  150. subl -32(%ebp), %eax
  151. subl $1, %eax
  152. movl -368(%ebp,%eax,4), %eax
  153. addl $48, %eax
  154. subl $12, %esp
  155. pushl %eax
  156. call putchar
  157. addl $16, %esp
  158. addl $1, -32(%ebp)
  159. .L13:
  160. movl -12(%ebp), %eax
  161. cmpl %eax, -32(%ebp)
  162. jb .L14
  163. movl $0, %eax
  164. movl -4(%ebp), %ecx
  165. .cfi_def_cfa 1, 0
  166. leave
  167. .cfi_restore 5
  168. leal -4(%ecx), %esp
  169. .cfi_def_cfa 4, 4
  170. ret
  171. .cfi_endproc
Success #stdin #stdout 0s 1784KB
stdin
1000101101001010011010111110000001011110000000101101011100111000111110001000010000001100100001111101
stdout
689734180926032001661703080061