-
Notifications
You must be signed in to change notification settings - Fork 8
/
fe25519_square.S
749 lines (575 loc) · 18.9 KB
/
fe25519_square.S
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
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
# qhasm: int64 rp
# qhasm: int64 xp
# qhasm: input rp
# qhasm: input xp
# qhasm: int64 r0
# qhasm: int64 r1
# qhasm: int64 r2
# qhasm: int64 r3
# qhasm: int64 r4
# qhasm: int64 c1
# qhasm: int64 c2
# qhasm: int64 c3
# qhasm: int64 c4
# qhasm: int64 c5
# qhasm: int64 c6
# qhasm: int64 c7
# qhasm: caller c1
# qhasm: caller c2
# qhasm: caller c3
# qhasm: caller c4
# qhasm: caller c5
# qhasm: caller c6
# qhasm: caller c7
# qhasm: stack64 c1_stack
# qhasm: stack64 c2_stack
# qhasm: stack64 c3_stack
# qhasm: stack64 c4_stack
# qhasm: stack64 c5_stack
# qhasm: stack64 c6_stack
# qhasm: stack64 c7_stack
# qhasm: stack64 x119_stack
# qhasm: stack64 x219_stack
# qhasm: stack64 x319_stack
# qhasm: stack64 x419_stack
# qhasm: int64 squarer01
# qhasm: int64 squarer11
# qhasm: int64 squarer21
# qhasm: int64 squarer31
# qhasm: int64 squarer41
# qhasm: int64 squarerax
# qhasm: int64 squarerdx
# qhasm: int64 squaret
# qhasm: int64 squareredmask
# qhasm: enter fe25519_square
.text
.p2align 5
.globl _fe25519_square
.globl fe25519_square
_fe25519_square:
fe25519_square:
mov %rsp,%r11
and $31,%r11
add $64,%r11
sub %r11,%rsp
# qhasm: c1_stack = c1
# asm 1: movq <c1=int64#9,>c1_stack=stack64#1
# asm 2: movq <c1=%r11,>c1_stack=0(%rsp)
movq %r11,0(%rsp)
# qhasm: c2_stack = c2
# asm 1: movq <c2=int64#10,>c2_stack=stack64#2
# asm 2: movq <c2=%r12,>c2_stack=8(%rsp)
movq %r12,8(%rsp)
# qhasm: c3_stack = c3
# asm 1: movq <c3=int64#11,>c3_stack=stack64#3
# asm 2: movq <c3=%r13,>c3_stack=16(%rsp)
movq %r13,16(%rsp)
# qhasm: c4_stack = c4
# asm 1: movq <c4=int64#12,>c4_stack=stack64#4
# asm 2: movq <c4=%r14,>c4_stack=24(%rsp)
movq %r14,24(%rsp)
# qhasm: c5_stack = c5
# asm 1: movq <c5=int64#13,>c5_stack=stack64#5
# asm 2: movq <c5=%r15,>c5_stack=32(%rsp)
movq %r15,32(%rsp)
# qhasm: c6_stack = c6
# asm 1: movq <c6=int64#14,>c6_stack=stack64#6
# asm 2: movq <c6=%rbx,>c6_stack=40(%rsp)
movq %rbx,40(%rsp)
# qhasm: c7_stack = c7
# asm 1: movq <c7=int64#15,>c7_stack=stack64#7
# asm 2: movq <c7=%rbp,>c7_stack=48(%rsp)
movq %rbp,48(%rsp)
# qhasm: squarerax = *(uint64 *)(xp + 0)
# asm 1: movq 0(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 0(<xp=%rsi),>squarerax=%rax
movq 0(%rsi),%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 0)
# asm 1: mulq 0(<xp=int64#2)
# asm 2: mulq 0(<xp=%rsi)
mulq 0(%rsi)
# qhasm: r0 = squarerax
# asm 1: mov <squarerax=int64#7,>r0=int64#4
# asm 2: mov <squarerax=%rax,>r0=%rcx
mov %rax,%rcx
# qhasm: squarer01 = squarerdx
# asm 1: mov <squarerdx=int64#3,>squarer01=int64#5
# asm 2: mov <squarerdx=%rdx,>squarer01=%r8
mov %rdx,%r8
# qhasm: squarerax = *(uint64 *)(xp + 0)
# asm 1: movq 0(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 0(<xp=%rsi),>squarerax=%rax
movq 0(%rsi),%rax
# qhasm: squarerax <<= 1
# asm 1: shl $1,<squarerax=int64#7
# asm 2: shl $1,<squarerax=%rax
shl $1,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 8)
# asm 1: mulq 8(<xp=int64#2)
# asm 2: mulq 8(<xp=%rsi)
mulq 8(%rsi)
# qhasm: r1 = squarerax
# asm 1: mov <squarerax=int64#7,>r1=int64#6
# asm 2: mov <squarerax=%rax,>r1=%r9
mov %rax,%r9
# qhasm: squarer11 = squarerdx
# asm 1: mov <squarerdx=int64#3,>squarer11=int64#8
# asm 2: mov <squarerdx=%rdx,>squarer11=%r10
mov %rdx,%r10
# qhasm: squarerax = *(uint64 *)(xp + 0)
# asm 1: movq 0(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 0(<xp=%rsi),>squarerax=%rax
movq 0(%rsi),%rax
# qhasm: squarerax <<= 1
# asm 1: shl $1,<squarerax=int64#7
# asm 2: shl $1,<squarerax=%rax
shl $1,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 16)
# asm 1: mulq 16(<xp=int64#2)
# asm 2: mulq 16(<xp=%rsi)
mulq 16(%rsi)
# qhasm: r2 = squarerax
# asm 1: mov <squarerax=int64#7,>r2=int64#9
# asm 2: mov <squarerax=%rax,>r2=%r11
mov %rax,%r11
# qhasm: squarer21 = squarerdx
# asm 1: mov <squarerdx=int64#3,>squarer21=int64#10
# asm 2: mov <squarerdx=%rdx,>squarer21=%r12
mov %rdx,%r12
# qhasm: squarerax = *(uint64 *)(xp + 0)
# asm 1: movq 0(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 0(<xp=%rsi),>squarerax=%rax
movq 0(%rsi),%rax
# qhasm: squarerax <<= 1
# asm 1: shl $1,<squarerax=int64#7
# asm 2: shl $1,<squarerax=%rax
shl $1,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 24)
# asm 1: mulq 24(<xp=int64#2)
# asm 2: mulq 24(<xp=%rsi)
mulq 24(%rsi)
# qhasm: r3 = squarerax
# asm 1: mov <squarerax=int64#7,>r3=int64#11
# asm 2: mov <squarerax=%rax,>r3=%r13
mov %rax,%r13
# qhasm: squarer31 = squarerdx
# asm 1: mov <squarerdx=int64#3,>squarer31=int64#12
# asm 2: mov <squarerdx=%rdx,>squarer31=%r14
mov %rdx,%r14
# qhasm: squarerax = *(uint64 *)(xp + 0)
# asm 1: movq 0(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 0(<xp=%rsi),>squarerax=%rax
movq 0(%rsi),%rax
# qhasm: squarerax <<= 1
# asm 1: shl $1,<squarerax=int64#7
# asm 2: shl $1,<squarerax=%rax
shl $1,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 32)
# asm 1: mulq 32(<xp=int64#2)
# asm 2: mulq 32(<xp=%rsi)
mulq 32(%rsi)
# qhasm: r4 = squarerax
# asm 1: mov <squarerax=int64#7,>r4=int64#13
# asm 2: mov <squarerax=%rax,>r4=%r15
mov %rax,%r15
# qhasm: squarer41 = squarerdx
# asm 1: mov <squarerdx=int64#3,>squarer41=int64#14
# asm 2: mov <squarerdx=%rdx,>squarer41=%rbx
mov %rdx,%rbx
# qhasm: squarerax = *(uint64 *)(xp + 8)
# asm 1: movq 8(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 8(<xp=%rsi),>squarerax=%rax
movq 8(%rsi),%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 8)
# asm 1: mulq 8(<xp=int64#2)
# asm 2: mulq 8(<xp=%rsi)
mulq 8(%rsi)
# qhasm: carry? r2 += squarerax
# asm 1: add <squarerax=int64#7,<r2=int64#9
# asm 2: add <squarerax=%rax,<r2=%r11
add %rax,%r11
# qhasm: squarer21 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer21=int64#10
# asm 2: adc <squarerdx=%rdx,<squarer21=%r12
adc %rdx,%r12
# qhasm: squarerax = *(uint64 *)(xp + 8)
# asm 1: movq 8(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 8(<xp=%rsi),>squarerax=%rax
movq 8(%rsi),%rax
# qhasm: squarerax <<= 1
# asm 1: shl $1,<squarerax=int64#7
# asm 2: shl $1,<squarerax=%rax
shl $1,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 16)
# asm 1: mulq 16(<xp=int64#2)
# asm 2: mulq 16(<xp=%rsi)
mulq 16(%rsi)
# qhasm: carry? r3 += squarerax
# asm 1: add <squarerax=int64#7,<r3=int64#11
# asm 2: add <squarerax=%rax,<r3=%r13
add %rax,%r13
# qhasm: squarer31 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer31=int64#12
# asm 2: adc <squarerdx=%rdx,<squarer31=%r14
adc %rdx,%r14
# qhasm: squarerax = *(uint64 *)(xp + 8)
# asm 1: movq 8(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 8(<xp=%rsi),>squarerax=%rax
movq 8(%rsi),%rax
# qhasm: squarerax <<= 1
# asm 1: shl $1,<squarerax=int64#7
# asm 2: shl $1,<squarerax=%rax
shl $1,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 24)
# asm 1: mulq 24(<xp=int64#2)
# asm 2: mulq 24(<xp=%rsi)
mulq 24(%rsi)
# qhasm: carry? r4 += squarerax
# asm 1: add <squarerax=int64#7,<r4=int64#13
# asm 2: add <squarerax=%rax,<r4=%r15
add %rax,%r15
# qhasm: squarer41 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer41=int64#14
# asm 2: adc <squarerdx=%rdx,<squarer41=%rbx
adc %rdx,%rbx
# qhasm: squarerax = *(uint64 *)(xp + 8)
# asm 1: movq 8(<xp=int64#2),>squarerax=int64#3
# asm 2: movq 8(<xp=%rsi),>squarerax=%rdx
movq 8(%rsi),%rdx
# qhasm: squarerax *= 38
# asm 1: imulq $38,<squarerax=int64#3,>squarerax=int64#7
# asm 2: imulq $38,<squarerax=%rdx,>squarerax=%rax
imulq $38,%rdx,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 32)
# asm 1: mulq 32(<xp=int64#2)
# asm 2: mulq 32(<xp=%rsi)
mulq 32(%rsi)
# qhasm: carry? r0 += squarerax
# asm 1: add <squarerax=int64#7,<r0=int64#4
# asm 2: add <squarerax=%rax,<r0=%rcx
add %rax,%rcx
# qhasm: squarer01 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer01=int64#5
# asm 2: adc <squarerdx=%rdx,<squarer01=%r8
adc %rdx,%r8
# qhasm: squarerax = *(uint64 *)(xp + 16)
# asm 1: movq 16(<xp=int64#2),>squarerax=int64#7
# asm 2: movq 16(<xp=%rsi),>squarerax=%rax
movq 16(%rsi),%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 16)
# asm 1: mulq 16(<xp=int64#2)
# asm 2: mulq 16(<xp=%rsi)
mulq 16(%rsi)
# qhasm: carry? r4 += squarerax
# asm 1: add <squarerax=int64#7,<r4=int64#13
# asm 2: add <squarerax=%rax,<r4=%r15
add %rax,%r15
# qhasm: squarer41 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer41=int64#14
# asm 2: adc <squarerdx=%rdx,<squarer41=%rbx
adc %rdx,%rbx
# qhasm: squarerax = *(uint64 *)(xp + 16)
# asm 1: movq 16(<xp=int64#2),>squarerax=int64#3
# asm 2: movq 16(<xp=%rsi),>squarerax=%rdx
movq 16(%rsi),%rdx
# qhasm: squarerax *= 38
# asm 1: imulq $38,<squarerax=int64#3,>squarerax=int64#7
# asm 2: imulq $38,<squarerax=%rdx,>squarerax=%rax
imulq $38,%rdx,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 24)
# asm 1: mulq 24(<xp=int64#2)
# asm 2: mulq 24(<xp=%rsi)
mulq 24(%rsi)
# qhasm: carry? r0 += squarerax
# asm 1: add <squarerax=int64#7,<r0=int64#4
# asm 2: add <squarerax=%rax,<r0=%rcx
add %rax,%rcx
# qhasm: squarer01 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer01=int64#5
# asm 2: adc <squarerdx=%rdx,<squarer01=%r8
adc %rdx,%r8
# qhasm: squarerax = *(uint64 *)(xp + 16)
# asm 1: movq 16(<xp=int64#2),>squarerax=int64#3
# asm 2: movq 16(<xp=%rsi),>squarerax=%rdx
movq 16(%rsi),%rdx
# qhasm: squarerax *= 38
# asm 1: imulq $38,<squarerax=int64#3,>squarerax=int64#7
# asm 2: imulq $38,<squarerax=%rdx,>squarerax=%rax
imulq $38,%rdx,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 32)
# asm 1: mulq 32(<xp=int64#2)
# asm 2: mulq 32(<xp=%rsi)
mulq 32(%rsi)
# qhasm: carry? r1 += squarerax
# asm 1: add <squarerax=int64#7,<r1=int64#6
# asm 2: add <squarerax=%rax,<r1=%r9
add %rax,%r9
# qhasm: squarer11 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer11=int64#8
# asm 2: adc <squarerdx=%rdx,<squarer11=%r10
adc %rdx,%r10
# qhasm: squarerax = *(uint64 *)(xp + 24)
# asm 1: movq 24(<xp=int64#2),>squarerax=int64#3
# asm 2: movq 24(<xp=%rsi),>squarerax=%rdx
movq 24(%rsi),%rdx
# qhasm: squarerax *= 19
# asm 1: imulq $19,<squarerax=int64#3,>squarerax=int64#7
# asm 2: imulq $19,<squarerax=%rdx,>squarerax=%rax
imulq $19,%rdx,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 24)
# asm 1: mulq 24(<xp=int64#2)
# asm 2: mulq 24(<xp=%rsi)
mulq 24(%rsi)
# qhasm: carry? r1 += squarerax
# asm 1: add <squarerax=int64#7,<r1=int64#6
# asm 2: add <squarerax=%rax,<r1=%r9
add %rax,%r9
# qhasm: squarer11 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer11=int64#8
# asm 2: adc <squarerdx=%rdx,<squarer11=%r10
adc %rdx,%r10
# qhasm: squarerax = *(uint64 *)(xp + 24)
# asm 1: movq 24(<xp=int64#2),>squarerax=int64#3
# asm 2: movq 24(<xp=%rsi),>squarerax=%rdx
movq 24(%rsi),%rdx
# qhasm: squarerax *= 38
# asm 1: imulq $38,<squarerax=int64#3,>squarerax=int64#7
# asm 2: imulq $38,<squarerax=%rdx,>squarerax=%rax
imulq $38,%rdx,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 32)
# asm 1: mulq 32(<xp=int64#2)
# asm 2: mulq 32(<xp=%rsi)
mulq 32(%rsi)
# qhasm: carry? r2 += squarerax
# asm 1: add <squarerax=int64#7,<r2=int64#9
# asm 2: add <squarerax=%rax,<r2=%r11
add %rax,%r11
# qhasm: squarer21 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer21=int64#10
# asm 2: adc <squarerdx=%rdx,<squarer21=%r12
adc %rdx,%r12
# qhasm: squarerax = *(uint64 *)(xp + 32)
# asm 1: movq 32(<xp=int64#2),>squarerax=int64#3
# asm 2: movq 32(<xp=%rsi),>squarerax=%rdx
movq 32(%rsi),%rdx
# qhasm: squarerax *= 19
# asm 1: imulq $19,<squarerax=int64#3,>squarerax=int64#7
# asm 2: imulq $19,<squarerax=%rdx,>squarerax=%rax
imulq $19,%rdx,%rax
# qhasm: (uint128) squarerdx squarerax = squarerax * *(uint64 *)(xp + 32)
# asm 1: mulq 32(<xp=int64#2)
# asm 2: mulq 32(<xp=%rsi)
mulq 32(%rsi)
# qhasm: carry? r3 += squarerax
# asm 1: add <squarerax=int64#7,<r3=int64#11
# asm 2: add <squarerax=%rax,<r3=%r13
add %rax,%r13
# qhasm: squarer31 += squarerdx + carry
# asm 1: adc <squarerdx=int64#3,<squarer31=int64#12
# asm 2: adc <squarerdx=%rdx,<squarer31=%r14
adc %rdx,%r14
# qhasm: squareredmask = *(uint64 *) &CONST_REDMASK51
# asm 1: movq CONST_REDMASK51,>squareredmask=int64#2
# asm 2: movq CONST_REDMASK51,>squareredmask=%rsi
movq CONST_REDMASK51(%rip),%rsi
# qhasm: squarer01 = (squarer01.r0) << 13
# asm 1: shld $13,<r0=int64#4,<squarer01=int64#5
# asm 2: shld $13,<r0=%rcx,<squarer01=%r8
shld $13,%rcx,%r8
# qhasm: r0 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r0=int64#4
# asm 2: and <squareredmask=%rsi,<r0=%rcx
and %rsi,%rcx
# qhasm: squarer11 = (squarer11.r1) << 13
# asm 1: shld $13,<r1=int64#6,<squarer11=int64#8
# asm 2: shld $13,<r1=%r9,<squarer11=%r10
shld $13,%r9,%r10
# qhasm: r1 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r1=int64#6
# asm 2: and <squareredmask=%rsi,<r1=%r9
and %rsi,%r9
# qhasm: r1 += squarer01
# asm 1: add <squarer01=int64#5,<r1=int64#6
# asm 2: add <squarer01=%r8,<r1=%r9
add %r8,%r9
# qhasm: squarer21 = (squarer21.r2) << 13
# asm 1: shld $13,<r2=int64#9,<squarer21=int64#10
# asm 2: shld $13,<r2=%r11,<squarer21=%r12
shld $13,%r11,%r12
# qhasm: r2 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r2=int64#9
# asm 2: and <squareredmask=%rsi,<r2=%r11
and %rsi,%r11
# qhasm: r2 += squarer11
# asm 1: add <squarer11=int64#8,<r2=int64#9
# asm 2: add <squarer11=%r10,<r2=%r11
add %r10,%r11
# qhasm: squarer31 = (squarer31.r3) << 13
# asm 1: shld $13,<r3=int64#11,<squarer31=int64#12
# asm 2: shld $13,<r3=%r13,<squarer31=%r14
shld $13,%r13,%r14
# qhasm: r3 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r3=int64#11
# asm 2: and <squareredmask=%rsi,<r3=%r13
and %rsi,%r13
# qhasm: r3 += squarer21
# asm 1: add <squarer21=int64#10,<r3=int64#11
# asm 2: add <squarer21=%r12,<r3=%r13
add %r12,%r13
# qhasm: squarer41 = (squarer41.r4) << 13
# asm 1: shld $13,<r4=int64#13,<squarer41=int64#14
# asm 2: shld $13,<r4=%r15,<squarer41=%rbx
shld $13,%r15,%rbx
# qhasm: r4 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r4=int64#13
# asm 2: and <squareredmask=%rsi,<r4=%r15
and %rsi,%r15
# qhasm: r4 += squarer31
# asm 1: add <squarer31=int64#12,<r4=int64#13
# asm 2: add <squarer31=%r14,<r4=%r15
add %r14,%r15
# qhasm: squarer41 = squarer41 * 19
# asm 1: imulq $19,<squarer41=int64#14,>squarer41=int64#3
# asm 2: imulq $19,<squarer41=%rbx,>squarer41=%rdx
imulq $19,%rbx,%rdx
# qhasm: r0 += squarer41
# asm 1: add <squarer41=int64#3,<r0=int64#4
# asm 2: add <squarer41=%rdx,<r0=%rcx
add %rdx,%rcx
# qhasm: squaret = r0
# asm 1: mov <r0=int64#4,>squaret=int64#3
# asm 2: mov <r0=%rcx,>squaret=%rdx
mov %rcx,%rdx
# qhasm: (uint64) squaret >>= 51
# asm 1: shr $51,<squaret=int64#3
# asm 2: shr $51,<squaret=%rdx
shr $51,%rdx
# qhasm: squaret += r1
# asm 1: add <r1=int64#6,<squaret=int64#3
# asm 2: add <r1=%r9,<squaret=%rdx
add %r9,%rdx
# qhasm: r0 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r0=int64#4
# asm 2: and <squareredmask=%rsi,<r0=%rcx
and %rsi,%rcx
# qhasm: r1 = squaret
# asm 1: mov <squaret=int64#3,>r1=int64#5
# asm 2: mov <squaret=%rdx,>r1=%r8
mov %rdx,%r8
# qhasm: (uint64) squaret >>= 51
# asm 1: shr $51,<squaret=int64#3
# asm 2: shr $51,<squaret=%rdx
shr $51,%rdx
# qhasm: squaret += r2
# asm 1: add <r2=int64#9,<squaret=int64#3
# asm 2: add <r2=%r11,<squaret=%rdx
add %r11,%rdx
# qhasm: r1 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r1=int64#5
# asm 2: and <squareredmask=%rsi,<r1=%r8
and %rsi,%r8
# qhasm: r2 = squaret
# asm 1: mov <squaret=int64#3,>r2=int64#6
# asm 2: mov <squaret=%rdx,>r2=%r9
mov %rdx,%r9
# qhasm: (uint64) squaret >>= 51
# asm 1: shr $51,<squaret=int64#3
# asm 2: shr $51,<squaret=%rdx
shr $51,%rdx
# qhasm: squaret += r3
# asm 1: add <r3=int64#11,<squaret=int64#3
# asm 2: add <r3=%r13,<squaret=%rdx
add %r13,%rdx
# qhasm: r2 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r2=int64#6
# asm 2: and <squareredmask=%rsi,<r2=%r9
and %rsi,%r9
# qhasm: r3 = squaret
# asm 1: mov <squaret=int64#3,>r3=int64#7
# asm 2: mov <squaret=%rdx,>r3=%rax
mov %rdx,%rax
# qhasm: (uint64) squaret >>= 51
# asm 1: shr $51,<squaret=int64#3
# asm 2: shr $51,<squaret=%rdx
shr $51,%rdx
# qhasm: squaret += r4
# asm 1: add <r4=int64#13,<squaret=int64#3
# asm 2: add <r4=%r15,<squaret=%rdx
add %r15,%rdx
# qhasm: r3 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r3=int64#7
# asm 2: and <squareredmask=%rsi,<r3=%rax
and %rsi,%rax
# qhasm: r4 = squaret
# asm 1: mov <squaret=int64#3,>r4=int64#8
# asm 2: mov <squaret=%rdx,>r4=%r10
mov %rdx,%r10
# qhasm: (uint64) squaret >>= 51
# asm 1: shr $51,<squaret=int64#3
# asm 2: shr $51,<squaret=%rdx
shr $51,%rdx
# qhasm: squaret *= 19
# asm 1: imulq $19,<squaret=int64#3,>squaret=int64#3
# asm 2: imulq $19,<squaret=%rdx,>squaret=%rdx
imulq $19,%rdx,%rdx
# qhasm: r0 += squaret
# asm 1: add <squaret=int64#3,<r0=int64#4
# asm 2: add <squaret=%rdx,<r0=%rcx
add %rdx,%rcx
# qhasm: r4 &= squareredmask
# asm 1: and <squareredmask=int64#2,<r4=int64#8
# asm 2: and <squareredmask=%rsi,<r4=%r10
and %rsi,%r10
# qhasm: *(uint64 *)(rp + 0) = r0
# asm 1: movq <r0=int64#4,0(<rp=int64#1)
# asm 2: movq <r0=%rcx,0(<rp=%rdi)
movq %rcx,0(%rdi)
# qhasm: *(uint64 *)(rp + 8) = r1
# asm 1: movq <r1=int64#5,8(<rp=int64#1)
# asm 2: movq <r1=%r8,8(<rp=%rdi)
movq %r8,8(%rdi)
# qhasm: *(uint64 *)(rp + 16) = r2
# asm 1: movq <r2=int64#6,16(<rp=int64#1)
# asm 2: movq <r2=%r9,16(<rp=%rdi)
movq %r9,16(%rdi)
# qhasm: *(uint64 *)(rp + 24) = r3
# asm 1: movq <r3=int64#7,24(<rp=int64#1)
# asm 2: movq <r3=%rax,24(<rp=%rdi)
movq %rax,24(%rdi)
# qhasm: *(uint64 *)(rp + 32) = r4
# asm 1: movq <r4=int64#8,32(<rp=int64#1)
# asm 2: movq <r4=%r10,32(<rp=%rdi)
movq %r10,32(%rdi)
# qhasm: c1 =c1_stack
# asm 1: movq <c1_stack=stack64#1,>c1=int64#9
# asm 2: movq <c1_stack=0(%rsp),>c1=%r11
movq 0(%rsp),%r11
# qhasm: c2 =c2_stack
# asm 1: movq <c2_stack=stack64#2,>c2=int64#10
# asm 2: movq <c2_stack=8(%rsp),>c2=%r12
movq 8(%rsp),%r12
# qhasm: c3 =c3_stack
# asm 1: movq <c3_stack=stack64#3,>c3=int64#11
# asm 2: movq <c3_stack=16(%rsp),>c3=%r13
movq 16(%rsp),%r13
# qhasm: c4 =c4_stack
# asm 1: movq <c4_stack=stack64#4,>c4=int64#12
# asm 2: movq <c4_stack=24(%rsp),>c4=%r14
movq 24(%rsp),%r14
# qhasm: c5 =c5_stack
# asm 1: movq <c5_stack=stack64#5,>c5=int64#13
# asm 2: movq <c5_stack=32(%rsp),>c5=%r15
movq 32(%rsp),%r15
# qhasm: c6 =c6_stack
# asm 1: movq <c6_stack=stack64#6,>c6=int64#14
# asm 2: movq <c6_stack=40(%rsp),>c6=%rbx
movq 40(%rsp),%rbx
# qhasm: c7 =c7_stack
# asm 1: movq <c7_stack=stack64#7,>c7=int64#15
# asm 2: movq <c7_stack=48(%rsp),>c7=%rbp
movq 48(%rsp),%rbp
# qhasm: leave
add %r11,%rsp
mov %rdi,%rax
mov %rsi,%rdx
ret