1 	.file   "t4.c"
  2 	.text
  3 	.globl  _mod
  4 	.def    _mod; .scl 2; .type 32; .endef
  5 _mod:
  6 	pushl   %ebp
  7 	movl    %esp, %ebp
  8 	subl    $0, %esp
  9 	pushl   8(%ebp) 	# x, 0
 10 	pushl   8(%ebp) 	# x, 0
 11 	pushl   12(%ebp) 	# y, 4
 12 	popl    %ecx
 13 	popl    %eax
 14 	cltd
 15 	idivl   %ecx
 16 	pushl   %eax
 17 	pushl   12(%ebp) 	# y, 4
 18 	popl    %ecx
 19 	popl    %eax
 20 	imull   %ecx, %eax
 21 	pushl   %eax
 22 	popl    %ecx
 23 	popl    %eax
 24 	subl    %ecx, %eax
 25 	pushl   %eax
 26 	popl    %eax 	# return value
 27 	jmp     L.XCC.RE.mod
 28 L.XCC.RE.mod:
 29 	movl    %ebp, %esp
 30 	popl    %ebp
 31 	ret
 32 	.text
 33 	.globl  _swap
 34 	.def    _swap; .scl 2; .type 32; .endef
 35 _swap:
 36 	pushl   %ebp
 37 	movl    %esp, %ebp
 38 	subl    $4, %esp
 39 	pushl   8(%ebp) 	# a, 0
 40 	popl    %eax
 41 	movl    0(%eax), %eax 	# deref
 42 	pushl   %eax
 43 	leal    -4(%ebp), %eax 	# tmp, 0
 44 	pushl   %eax
 45 	popl    %eax
 46 	movl    0(%esp), %ecx
 47 	movl    %ecx, 0(%eax)
 48 	addl    $4, %esp
 49 	pushl   12(%ebp) 	# b, 4
 50 	popl    %eax
 51 	movl    0(%eax), %eax 	# deref
 52 	pushl   %eax
 53 	pushl   8(%ebp) 	# a, 0
 54 	popl    %eax
 55 	movl    0(%esp), %ecx
 56 	movl    %ecx, 0(%eax)
 57 	addl    $4, %esp
 58 	pushl   -4(%ebp) 	# tmp, 0
 59 	pushl   12(%ebp) 	# b, 4
 60 	popl    %eax
 61 	movl    0(%esp), %ecx
 62 	movl    %ecx, 0(%eax)
 63 	addl    $4, %esp
 64 L.XCC.RE.swap:
 65 	movl    %ebp, %esp
 66 	popl    %ebp
 67 	ret
 68 	.text
 69 	.globl  _bubble_sort
 70 	.def    _bubble_sort; .scl 2; .type 32; .endef
 71 _bubble_sort:
 72 	pushl   %ebp
 73 	movl    %esp, %ebp
 74 	subl    $8, %esp
 75 	pushl   12(%ebp) 	# size, 4
 76 	pushl   $1
 77 	popl    %ecx
 78 	popl    %eax
 79 	subl    %ecx, %eax
 80 	pushl   %eax
 81 	leal    -4(%ebp), %eax 	# i, 0
 82 	pushl   %eax
 83 	popl    %eax
 84 	movl    0(%esp), %ecx
 85 	movl    %ecx, 0(%eax)
 86 	addl    $4, %esp
 87 L.XCC.CL0:
 88 	pushl   $0
 89 	pushl   -4(%ebp) 	# i, 0
 90 	popl    %ecx
 91 	popl    %eax
 92 	cmpl    %ecx, %eax
 93 	setl    %al
 94 	movzbl  %al, %eax
 95 	pushl   %eax
 96 	popl    %eax
 97 	cmpl    $0, %eax
 98 	je      L.XCC.CL1
 99 	pushl   $0
100 	leal    -8(%ebp), %eax 	# j, 4
101 	pushl   %eax
102 	popl    %eax
103 	movl    0(%esp), %ecx
104 	movl    %ecx, 0(%eax)
105 	addl    $4, %esp
106 L.XCC.CL2:
107 	pushl   -8(%ebp) 	# j, 4
108 	pushl   -4(%ebp) 	# i, 0
109 	popl    %ecx
110 	popl    %eax
111 	cmpl    %ecx, %eax
112 	setl    %al
113 	movzbl  %al, %eax
114 	pushl   %eax
115 	popl    %eax
116 	cmpl    $0, %eax
117 	je      L.XCC.CL3
118 	pushl   8(%ebp) 	# data, 0
119 	pushl   -8(%ebp) 	# j, 4
120 	pushl   $1
121 	popl    %ecx
122 	popl    %eax
123 	addl    %ecx, %eax
124 	pushl   %eax
125 	popl    %eax
126 	imull   $4, %eax
127 	pushl   %eax
128 	popl    %ecx
129 	popl    %eax
130 	addl    %ecx, %eax
131 	pushl   %eax
132 	popl    %eax
133 	movl    0(%eax), %eax 	# deref
134 	pushl   %eax
135 	pushl   8(%ebp) 	# data, 0
136 	pushl   -8(%ebp) 	# j, 4
137 	popl    %eax
138 	imull   $4, %eax
139 	pushl   %eax
140 	popl    %ecx
141 	popl    %eax
142 	addl    %ecx, %eax
143 	pushl   %eax
144 	popl    %eax
145 	movl    0(%eax), %eax 	# deref
146 	pushl   %eax
147 	popl    %ecx
148 	popl    %eax
149 	cmpl    %ecx, %eax
150 	setl    %al
151 	movzbl  %al, %eax
152 	pushl   %eax
153 	popl    %eax
154 	cmpl    $0, %eax
155 	je      L.XCC.CL4
156 	pushl   8(%ebp) 	# data, 0
157 	pushl   -8(%ebp) 	# j, 4
158 	pushl   $1
159 	popl    %ecx
160 	popl    %eax
161 	addl    %ecx, %eax
162 	pushl   %eax
163 	popl    %eax
164 	imull   $4, %eax
165 	pushl   %eax
166 	popl    %ecx
167 	popl    %eax
168 	addl    %ecx, %eax
169 	pushl   %eax
170 	pushl   8(%ebp) 	# data, 0
171 	pushl   -8(%ebp) 	# j, 4
172 	popl    %eax
173 	imull   $4, %eax
174 	pushl   %eax
175 	popl    %ecx
176 	popl    %eax
177 	addl    %ecx, %eax
178 	pushl   %eax
179 	pushl   $_swap
180 	popl    %eax
181 	call    *%eax
182 	addl    $8, %esp 	# pop args
183 	pushl   %eax
184 	addl    $4, %esp
185 L.XCC.CL4:
186 	pushl   -8(%ebp) 	# j, 4
187 	pushl   $1
188 	popl    %ecx
189 	popl    %eax
190 	addl    %ecx, %eax
191 	pushl   %eax
192 	leal    -8(%ebp), %eax 	# j, 4
193 	pushl   %eax
194 	popl    %eax
195 	movl    0(%esp), %ecx
196 	movl    %ecx, 0(%eax)
197 	addl    $4, %esp
198 	jmp     L.XCC.CL2
199 L.XCC.CL3:
200 	pushl   -4(%ebp) 	# i, 0
201 	pushl   $1
202 	popl    %ecx
203 	popl    %eax
204 	subl    %ecx, %eax
205 	pushl   %eax
206 	leal    -4(%ebp), %eax 	# i, 0
207 	pushl   %eax
208 	popl    %eax
209 	movl    0(%esp), %ecx
210 	movl    %ecx, 0(%eax)
211 	addl    $4, %esp
212 	jmp     L.XCC.CL0
213 L.XCC.CL1:
214 L.XCC.RE.bubble_sort:
215 	movl    %ebp, %esp
216 	popl    %ebp
217 	ret
218 	.text
219 	.globl  _make_array
220 	.def    _make_array; .scl 2; .type 32; .endef
221 _make_array:
222 	pushl   %ebp
223 	movl    %esp, %ebp
224 	subl    $8, %esp
225 	pushl   $0
226 	leal    -4(%ebp), %eax 	# i, 0
227 	pushl   %eax
228 	popl    %eax
229 	movl    0(%esp), %ecx
230 	movl    %ecx, 0(%eax)
231 	addl    $4, %esp
232 	pushl   16(%ebp) 	# seed, 8
233 	pushl   $_srandom
234 	popl    %eax
235 	call    *%eax
236 	addl    $4, %esp 	# pop args
237 	pushl   %eax
238 	addl    $4, %esp
239 L.XCC.CL5:
240 	pushl   -4(%ebp) 	# i, 0
241 	pushl   12(%ebp) 	# size, 4
242 	popl    %ecx
243 	popl    %eax
244 	cmpl    %ecx, %eax
245 	setl    %al
246 	movzbl  %al, %eax
247 	pushl   %eax
248 	popl    %eax
249 	cmpl    $0, %eax
250 	je      L.XCC.CL6
251 	pushl   $_random
252 	popl    %eax
253 	call    *%eax
254 	addl    $0, %esp 	# pop args
255 	pushl   %eax
256 	leal    -8(%ebp), %eax 	# j, 4
257 	pushl   %eax
258 	popl    %eax
259 	movl    0(%esp), %ecx
260 	movl    %ecx, 0(%eax)
261 	addl    $4, %esp
262 	pushl   12(%ebp) 	# size, 4
263 	pushl   -8(%ebp) 	# j, 4
264 	pushl   $_mod
265 	popl    %eax
266 	call    *%eax
267 	addl    $8, %esp 	# pop args
268 	pushl   %eax
269 	pushl   8(%ebp) 	# data, 0
270 	pushl   -4(%ebp) 	# i, 0
271 	popl    %eax
272 	imull   $4, %eax
273 	pushl   %eax
274 	popl    %ecx
275 	popl    %eax
276 	addl    %ecx, %eax
277 	pushl   %eax
278 	popl    %eax
279 	movl    0(%esp), %ecx
280 	movl    %ecx, 0(%eax)
281 	addl    $4, %esp
282 	pushl   -4(%ebp) 	# i, 0
283 	pushl   $1
284 	popl    %ecx
285 	popl    %eax
286 	addl    %ecx, %eax
287 	pushl   %eax
288 	leal    -4(%ebp), %eax 	# i, 0
289 	pushl   %eax
290 	popl    %eax
291 	movl    0(%esp), %ecx
292 	movl    %ecx, 0(%eax)
293 	addl    $4, %esp
294 	jmp     L.XCC.CL5
295 L.XCC.CL6:
296 L.XCC.RE.make_array:
297 	movl    %ebp, %esp
298 	popl    %ebp
299 	ret
300 	.section .rdata,"dr"
301 L.XCC.STR0:
302 	.ascii  "%d\n\0"
303 	.def    ___main; .scl 2; .type 32; .endef
304 	.text
305 	.globl  _main
306 	.def    _main; .scl 2; .type 32; .endef
307 _main:
308 	pushl   %ebp
309 	movl    %esp, %ebp
310 	subl    $12, %esp
311 	pushl   12(%ebp) 	# argv, 4
312 	pushl   $1
313 	popl    %eax
314 	imull   $4, %eax
315 	pushl   %eax
316 	popl    %ecx
317 	popl    %eax
318 	addl    %ecx, %eax
319 	pushl   %eax
320 	popl    %eax
321 	movl    0(%eax), %eax 	# deref
322 	pushl   %eax
323 	pushl   $_atoi
324 	popl    %eax
325 	call    *%eax
326 	addl    $4, %esp 	# pop args
327 	pushl   %eax
328 	leal    -12(%ebp), %eax 	# size, 8
329 	pushl   %eax
330 	popl    %eax
331 	movl    0(%esp), %ecx
332 	movl    %ecx, 0(%eax)
333 	addl    $4, %esp
334 	pushl   $4
335 	pushl   -12(%ebp) 	# size, 8
336 	popl    %ecx
337 	popl    %eax
338 	imull   %ecx, %eax
339 	pushl   %eax
340 	pushl   $_malloc
341 	popl    %eax
342 	call    *%eax
343 	addl    $4, %esp 	# pop args
344 	pushl   %eax
345 	leal    -8(%ebp), %eax 	# p, 4
346 	pushl   %eax
347 	popl    %eax
348 	movl    0(%esp), %ecx
349 	movl    %ecx, 0(%eax)
350 	addl    $4, %esp
351 	pushl   $0
352 	pushl   -12(%ebp) 	# size, 8
353 	pushl   -8(%ebp) 	# p, 4
354 	pushl   $_make_array
355 	popl    %eax
356 	call    *%eax
357 	addl    $12, %esp 	# pop args
358 	pushl   %eax
359 	addl    $4, %esp
360 	pushl   -12(%ebp) 	# size, 8
361 	pushl   -8(%ebp) 	# p, 4
362 	pushl   $_bubble_sort
363 	popl    %eax
364 	call    *%eax
365 	addl    $8, %esp 	# pop args
366 	pushl   %eax
367 	addl    $4, %esp
368 	pushl   $0
369 	leal    -4(%ebp), %eax 	# i, 0
370 	pushl   %eax
371 	popl    %eax
372 	movl    0(%esp), %ecx
373 	movl    %ecx, 0(%eax)
374 	addl    $4, %esp
375 L.XCC.CL7:
376 	pushl   -4(%ebp) 	# i, 0
377 	pushl   -12(%ebp) 	# size, 8
378 	popl    %ecx
379 	popl    %eax
380 	cmpl    %ecx, %eax
381 	setl    %al
382 	movzbl  %al, %eax
383 	pushl   %eax
384 	popl    %eax
385 	cmpl    $0, %eax
386 	je      L.XCC.CL8
387 	pushl   -8(%ebp) 	# p, 4
388 	pushl   -4(%ebp) 	# i, 0
389 	popl    %eax
390 	imull   $4, %eax
391 	pushl   %eax
392 	popl    %ecx
393 	popl    %eax
394 	addl    %ecx, %eax
395 	pushl   %eax
396 	popl    %eax
397 	movl    0(%eax), %eax 	# deref
398 	pushl   %eax
399 	pushl   $L.XCC.STR0 	# "%d\n"
400 	pushl   $_printf
401 	popl    %eax
402 	call    *%eax
403 	addl    $8, %esp 	# pop args
404 	pushl   %eax
405 	addl    $4, %esp
406 	pushl   -4(%ebp) 	# i, 0
407 	pushl   $1
408 	popl    %ecx
409 	popl    %eax
410 	addl    %ecx, %eax
411 	pushl   %eax
412 	leal    -4(%ebp), %eax 	# i, 0
413 	pushl   %eax
414 	popl    %eax
415 	movl    0(%esp), %ecx
416 	movl    %ecx, 0(%eax)
417 	addl    $4, %esp
418 	jmp     L.XCC.CL7
419 L.XCC.CL8:
420 L.XCC.RE.main:
421 	movl    %ebp, %esp
422 	popl    %ebp
423 	ret
424 	.ident  "XCC ver 0.3.2 ($Revision: 1.14 $)"