Is this 64bit asm?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
-- Haskell source
module Main where

import Data.Word
import Data.Bits

one = 1 :: Word64

foo = one `shiftL` 62 :: Word64

main = print foo

-- Generated code:

.data
	.align 4
.globl _Main_one_closure
_Main_one_closure:
	.long	_Main_one_info
	.long	0
	.long	0
	.long	0
.text
	.align 4,0x90
	.long	0
	.long	22
.globl _Main_one_info
_Main_one_info:
.Lc180:
	leal -8(%ebp),%eax
	cmpl 84(%ebx),%eax
	jb .Lc182
	addl $20,%edi
	cmpl 92(%ebx),%edi
	ja .Lc184
	movl $_stg_CAF_BLACKHOLE_info,-16(%edi)
	movl 96(%ebx),%eax
	movl %eax,-12(%edi)
	pushl %esi
	pushl %ebx
	call _newCAF
	addl $8,%esp
	leal -16(%edi),%eax
	movl %eax,4(%esi)
	movl $_stg_IND_STATIC_info,(%esi)
	movl $_stg_bh_upd_frame_info,-8(%ebp)
	leal -16(%edi),%eax
	movl %eax,-4(%ebp)
	pushl $1
	call _hs_intToInt64
	addl $4,%esp
	pushl %edx
	pushl %eax
	call _hs_int64ToWord64
	addl $8,%esp
	movl $_base_GHCziWord_W64zh_con_info,-8(%edi)
	movl %eax,-4(%edi)
	movl %edx,(%edi)
	leal -7(%edi),%esi
	addl $-8,%ebp
	jmp *0(%ebp)
.Lc184:
	movl $20,112(%ebx)
.Lc182:
	jmp *-12(%ebx)
.section .data
	.align 4
.globl _Main_foo_srt
_Main_foo_srt:
	.long	_Main_one_closure
.data
	.align 4
.globl _Main_foo_closure
_Main_foo_closure:
	.long	_Main_foo_info
	.long	0
	.long	0
	.long	0
.text
	.align 4,0x90
	.long	0
	.long	32
_s17D_info:
.Lc18t:
	addl $12,%edi
	cmpl 92(%ebx),%edi
	ja .Lc18A
	movl $_base_GHCziWord_W64zh_con_info,-8(%edi)
	movl 72(%ebx),%ecx
	movl 76(%ebx),%eax
	movl %ecx,-4(%edi)
	movl %eax,(%edi)
	leal -7(%edi),%esi
	addl $4,%ebp
	jmp *0(%ebp)
.Lc18A:
	movl $12,112(%ebx)
	jmp _stg_gc_l1
.text
	.align 4,0x90
	.long	0
	.long	32
_s18c_info:
.Lc18G:
	movl $62,-4(%ebp)
	movl 3(%esi),%ecx
	movl 7(%esi),%eax
	movl %ecx,-12(%ebp)
	movl %eax,-8(%ebp)
	movl $_s17D_info,0(%ebp)
	addl $-12,%ebp
	jmp _base_GHCziWord_shiftL64zh_info
.text
	.align 4,0x90
	.long	_Main_foo_srt-(_Main_foo_info)+0
	.long	0
	.long	65558
.globl _Main_foo_info
_Main_foo_info:
.Lc18R:
	leal -24(%ebp),%eax
	cmpl 84(%ebx),%eax
	jb .Lc18T
	addl $8,%edi
	cmpl 92(%ebx),%edi
	ja .Lc18V
	movl $_stg_CAF_BLACKHOLE_info,-4(%edi)
	movl 96(%ebx),%eax
	movl %eax,0(%edi)
	pushl %esi
	pushl %ebx
	call _newCAF
	addl $8,%esp
	leal -4(%edi),%eax
	movl %eax,4(%esi)
	movl $_stg_IND_STATIC_info,(%esi)
	movl $_stg_bh_upd_frame_info,-8(%ebp)
	leal -4(%edi),%eax
	movl %eax,-4(%ebp)
	movl $_Main_one_closure,%esi
	movl $_s18c_info,-12(%ebp)
	addl $-12,%ebp
	testl $3,%esi
	jne _s18c_info
	jmp *(%esi)
.Lc18V:
	movl $8,112(%ebx)
.Lc18T:
	jmp *-12(%ebx)
.section .data
	.align 4
.globl _Main_main2_srt
_Main_main2_srt:
	.long	_base_GHCziNum_zdwzdcshowsPrec_closure
	.long	_Main_foo_closure
.data
	.align 4
.globl _Main_main2_closure
_Main_main2_closure:
	.long	_Main_main2_info
	.long	0
	.long	0
	.long	0
.text
	.align 4,0x90
	.long	_Main_main2_srt-(_s194_info)+0
	.long	0
	.long	65568
_s194_info:
.Lc19l:
	movl $_ghczmprim_GHCziTypes_ZMZN_closure+1,0(%ebp)
	movl %esi,-4(%ebp)
	movl $0,-8(%ebp)
	addl $-8,%ebp
	jmp _base_GHCziNum_zdwzdcshowsPrec_info
.text
	.align 4,0x90
	.long	_Main_main2_srt-(_s195_info)+0
	.long	0
	.long	65568
_s195_info:
.Lc19q:
	movl 3(%esi),%ecx
	movl 7(%esi),%eax
	movl %ecx,-8(%ebp)
	movl %eax,-4(%ebp)
	movl $_s194_info,0(%ebp)
	addl $-8,%ebp
	jmp _integerzmgmp_GHCziInteger_word64ToInteger_info
.text
	.align 4,0x90
	.long	_Main_main2_srt-(_Main_main2_info)+0
	.long	0
	.long	196630
.globl _Main_main2_info
_Main_main2_info:
.Lc19B:
	leal -20(%ebp),%eax
	cmpl 84(%ebx),%eax
	jb .Lc19D
	addl $8,%edi
	cmpl 92(%ebx),%edi
	ja .Lc19F
	movl $_stg_CAF_BLACKHOLE_info,-4(%edi)
	movl 96(%ebx),%eax
	movl %eax,0(%edi)
	pushl %esi
	pushl %ebx
	call _newCAF
	addl $8,%esp
	leal -4(%edi),%eax
	movl %eax,4(%esi)
	movl $_stg_IND_STATIC_info,(%esi)
	movl $_stg_bh_upd_frame_info,-8(%ebp)
	leal -4(%edi),%eax
	movl %eax,-4(%ebp)
	movl $_Main_foo_closure,%esi
	movl $_s195_info,-12(%ebp)
	addl $-12,%ebp
	testl $3,%esi
	jne _s195_info
	jmp *(%esi)
.Lc19F:
	movl $8,112(%ebx)
.Lc19D:
	jmp *-12(%ebx)
.section .data
	.align 4
.globl _Main_main1_srt
_Main_main1_srt:
	.long	_Main_main2_closure
	.long	_base_GHCziIOziHandleziFD_stdout_closure
	.long	_base_GHCziIOziHandleziText_hPutStr2_closure
.data
	.align 4
.globl _Main_main1_closure
_Main_main1_closure:
	.long	_Main_main1_info
	.long	0
.text
	.align 4,0x90
	.long	_Main_main1_srt-(_Main_main1_info)+0
	.long	65539
	.long	0
	.long	458767
.globl _Main_main1_info
_Main_main1_info:
.Lc19Y:
	leal -12(%ebp),%eax
	cmpl 84(%ebx),%eax
	jb .Lc1a1
	movl $_ghczmprim_GHCziBool_True_closure+2,-4(%ebp)
	movl $_Main_main2_closure,-8(%ebp)
	movl $_base_GHCziIOziHandleziFD_stdout_closure,-12(%ebp)
	addl $-12,%ebp
	jmp _base_GHCziIOziHandleziText_hPutStr2_info
.Lc1a1:
	movl $_Main_main1_closure,%esi
	jmp *-8(%ebx)
.section .data
	.align 4
.globl _Main_main_srt
_Main_main_srt:
	.long	_Main_main1_closure
.data
	.align 4
.globl _Main_main_closure
_Main_main_closure:
	.long	_Main_main_info
	.long	0
.text
	.align 4,0x90
	.long	_Main_main_srt-(_Main_main_info)+0
	.long	65539
	.long	0
	.long	65551
.globl _Main_main_info
_Main_main_info:
.Lc1af:
	jmp _Main_main1_info
.section .data
	.align 4
.globl _Main_main3_srt
_Main_main3_srt:
	.long	_base_GHCziTopHandler_runMainIO1_closure
	.long	_Main_main1_closure
.data
	.align 4
.globl _Main_main3_closure
_Main_main3_closure:
	.long	_Main_main3_info
	.long	0
.text
	.align 4,0x90
	.long	_Main_main3_srt-(_Main_main3_info)+0
	.long	65539
	.long	0
	.long	196623
.globl _Main_main3_info
_Main_main3_info:
.Lc1at:
	leal -4(%ebp),%eax
	cmpl 84(%ebx),%eax
	jb .Lc1aw
	movl $_Main_main1_closure+1,-4(%ebp)
	addl $-4,%ebp
	jmp _base_GHCziTopHandler_runMainIO1_info
.Lc1aw:
	movl $_Main_main3_closure,%esi
	jmp *-8(%ebx)
.section .data
	.align 4
.globl _ZCMain_main_srt
_ZCMain_main_srt:
	.long	_Main_main3_closure
.data
	.align 4
.globl _ZCMain_main_closure
_ZCMain_main_closure:
	.long	_ZCMain_main_info
	.long	0
.text
	.align 4,0x90
	.long	_ZCMain_main_srt-(_ZCMain_main_info)+0
	.long	65539
	.long	0
	.long	65551
.globl _ZCMain_main_info
_ZCMain_main_info:
.Lc1aK:
	jmp _Main_main3_info
.data
	.align 4
__module_registered:
	.long	0
.text
	.align 4,0x90
.globl ___stginit_Main_
___stginit_Main_:
.Lc1aU:
	cmpl $0,__module_registered
	jne .Lc1aV
.Lc1aW:
	movl $1,__module_registered
	addl $-4,%ebp
	movl $___stginit_base_DataziWord_,(%ebp)
	addl $-4,%ebp
	movl $___stginit_base_DataziBits_,(%ebp)
	addl $-4,%ebp
	movl $___stginit_base_Prelude_,(%ebp)
	addl $-4,%ebp
	movl $___stginit_base_GHCziTopHandler_,(%ebp)
.Lc1aV:
	addl $4,%ebp
	jmp *-4(%ebp)
.text
	.align 4,0x90
.globl ___stginit_Main
___stginit_Main:
.Lc1b0:
	jmp ___stginit_Main_
.text
	.align 4,0x90
.globl ___stginit_ZCMain
___stginit_ZCMain:
.Lc1b4:
	addl $4,%ebp
	jmp *-4(%ebp)
.ident "GHC 7.0.2"