1; This file is generated from a similarly-named Perl script in the BoringSSL
2; source tree. Do not edit by hand.
3
4%ifidn __OUTPUT_FORMAT__, win64
5default	rel
6%define XMMWORD
7%define YMMWORD
8%define ZMMWORD
9%define _CET_ENDBR
10
11%include "ring_core_generated/prefix_symbols_nasm.inc"
12section	.text code align=64
13
14EXTERN	OPENSSL_ia32cap_P
15
16
17section	.rdata rdata align=8
18ALIGN	64
19$L$poly:
20	DQ	0xffffffffffffffff,0x00000000ffffffff,0x0000000000000000,0xffffffff00000001
21
22$L$One:
23	DD	1,1,1,1,1,1,1,1
24$L$Two:
25	DD	2,2,2,2,2,2,2,2
26$L$Three:
27	DD	3,3,3,3,3,3,3,3
28$L$ONE_mont:
29	DQ	0x0000000000000001,0xffffffff00000000,0xffffffffffffffff,0x00000000fffffffe
30
31
32$L$ord:
33	DQ	0xf3b9cac2fc632551,0xbce6faada7179e84,0xffffffffffffffff,0xffffffff00000000
34$L$ordK:
35	DQ	0xccd1c8aaee00bc4f
36section	.text
37
38
39
40
41global	ecp_nistz256_neg
42
43ALIGN	32
44ecp_nistz256_neg:
45	mov	QWORD[8+rsp],rdi	;WIN64 prologue
46	mov	QWORD[16+rsp],rsi
47	mov	rax,rsp
48$L$SEH_begin_ecp_nistz256_neg:
49	mov	rdi,rcx
50	mov	rsi,rdx
51
52
53
54_CET_ENDBR
55	push	r12
56
57	push	r13
58
59$L$neg_body:
60
61	xor	r8,r8
62	xor	r9,r9
63	xor	r10,r10
64	xor	r11,r11
65	xor	r13,r13
66
67	sub	r8,QWORD[rsi]
68	sbb	r9,QWORD[8+rsi]
69	sbb	r10,QWORD[16+rsi]
70	mov	rax,r8
71	sbb	r11,QWORD[24+rsi]
72	lea	rsi,[$L$poly]
73	mov	rdx,r9
74	sbb	r13,0
75
76	add	r8,QWORD[rsi]
77	mov	rcx,r10
78	adc	r9,QWORD[8+rsi]
79	adc	r10,QWORD[16+rsi]
80	mov	r12,r11
81	adc	r11,QWORD[24+rsi]
82	test	r13,r13
83
84	cmovz	r8,rax
85	cmovz	r9,rdx
86	mov	QWORD[rdi],r8
87	cmovz	r10,rcx
88	mov	QWORD[8+rdi],r9
89	cmovz	r11,r12
90	mov	QWORD[16+rdi],r10
91	mov	QWORD[24+rdi],r11
92
93	mov	r13,QWORD[rsp]
94
95	mov	r12,QWORD[8+rsp]
96
97	lea	rsp,[16+rsp]
98
99$L$neg_epilogue:
100	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
101	mov	rsi,QWORD[16+rsp]
102	ret
103
104$L$SEH_end_ecp_nistz256_neg:
105
106
107
108
109
110
111global	ecp_nistz256_ord_mul_mont
112
113ALIGN	32
114ecp_nistz256_ord_mul_mont:
115	mov	QWORD[8+rsp],rdi	;WIN64 prologue
116	mov	QWORD[16+rsp],rsi
117	mov	rax,rsp
118$L$SEH_begin_ecp_nistz256_ord_mul_mont:
119	mov	rdi,rcx
120	mov	rsi,rdx
121	mov	rdx,r8
122
123
124
125_CET_ENDBR
126	lea	rcx,[OPENSSL_ia32cap_P]
127	mov	rcx,QWORD[8+rcx]
128	and	ecx,0x80100
129	cmp	ecx,0x80100
130	je	NEAR $L$ecp_nistz256_ord_mul_montx
131	push	rbp
132
133	push	rbx
134
135	push	r12
136
137	push	r13
138
139	push	r14
140
141	push	r15
142
143$L$ord_mul_body:
144
145	mov	rax,QWORD[rdx]
146	mov	rbx,rdx
147	lea	r14,[$L$ord]
148	mov	r15,QWORD[$L$ordK]
149
150
151	mov	rcx,rax
152	mul	QWORD[rsi]
153	mov	r8,rax
154	mov	rax,rcx
155	mov	r9,rdx
156
157	mul	QWORD[8+rsi]
158	add	r9,rax
159	mov	rax,rcx
160	adc	rdx,0
161	mov	r10,rdx
162
163	mul	QWORD[16+rsi]
164	add	r10,rax
165	mov	rax,rcx
166	adc	rdx,0
167
168	mov	r13,r8
169	imul	r8,r15
170
171	mov	r11,rdx
172	mul	QWORD[24+rsi]
173	add	r11,rax
174	mov	rax,r8
175	adc	rdx,0
176	mov	r12,rdx
177
178
179	mul	QWORD[r14]
180	mov	rbp,r8
181	add	r13,rax
182	mov	rax,r8
183	adc	rdx,0
184	mov	rcx,rdx
185
186	sub	r10,r8
187	sbb	r8,0
188
189	mul	QWORD[8+r14]
190	add	r9,rcx
191	adc	rdx,0
192	add	r9,rax
193	mov	rax,rbp
194	adc	r10,rdx
195	mov	rdx,rbp
196	adc	r8,0
197
198	shl	rax,32
199	shr	rdx,32
200	sub	r11,rax
201	mov	rax,QWORD[8+rbx]
202	sbb	rbp,rdx
203
204	add	r11,r8
205	adc	r12,rbp
206	adc	r13,0
207
208
209	mov	rcx,rax
210	mul	QWORD[rsi]
211	add	r9,rax
212	mov	rax,rcx
213	adc	rdx,0
214	mov	rbp,rdx
215
216	mul	QWORD[8+rsi]
217	add	r10,rbp
218	adc	rdx,0
219	add	r10,rax
220	mov	rax,rcx
221	adc	rdx,0
222	mov	rbp,rdx
223
224	mul	QWORD[16+rsi]
225	add	r11,rbp
226	adc	rdx,0
227	add	r11,rax
228	mov	rax,rcx
229	adc	rdx,0
230
231	mov	rcx,r9
232	imul	r9,r15
233
234	mov	rbp,rdx
235	mul	QWORD[24+rsi]
236	add	r12,rbp
237	adc	rdx,0
238	xor	r8,r8
239	add	r12,rax
240	mov	rax,r9
241	adc	r13,rdx
242	adc	r8,0
243
244
245	mul	QWORD[r14]
246	mov	rbp,r9
247	add	rcx,rax
248	mov	rax,r9
249	adc	rcx,rdx
250
251	sub	r11,r9
252	sbb	r9,0
253
254	mul	QWORD[8+r14]
255	add	r10,rcx
256	adc	rdx,0
257	add	r10,rax
258	mov	rax,rbp
259	adc	r11,rdx
260	mov	rdx,rbp
261	adc	r9,0
262
263	shl	rax,32
264	shr	rdx,32
265	sub	r12,rax
266	mov	rax,QWORD[16+rbx]
267	sbb	rbp,rdx
268
269	add	r12,r9
270	adc	r13,rbp
271	adc	r8,0
272
273
274	mov	rcx,rax
275	mul	QWORD[rsi]
276	add	r10,rax
277	mov	rax,rcx
278	adc	rdx,0
279	mov	rbp,rdx
280
281	mul	QWORD[8+rsi]
282	add	r11,rbp
283	adc	rdx,0
284	add	r11,rax
285	mov	rax,rcx
286	adc	rdx,0
287	mov	rbp,rdx
288
289	mul	QWORD[16+rsi]
290	add	r12,rbp
291	adc	rdx,0
292	add	r12,rax
293	mov	rax,rcx
294	adc	rdx,0
295
296	mov	rcx,r10
297	imul	r10,r15
298
299	mov	rbp,rdx
300	mul	QWORD[24+rsi]
301	add	r13,rbp
302	adc	rdx,0
303	xor	r9,r9
304	add	r13,rax
305	mov	rax,r10
306	adc	r8,rdx
307	adc	r9,0
308
309
310	mul	QWORD[r14]
311	mov	rbp,r10
312	add	rcx,rax
313	mov	rax,r10
314	adc	rcx,rdx
315
316	sub	r12,r10
317	sbb	r10,0
318
319	mul	QWORD[8+r14]
320	add	r11,rcx
321	adc	rdx,0
322	add	r11,rax
323	mov	rax,rbp
324	adc	r12,rdx
325	mov	rdx,rbp
326	adc	r10,0
327
328	shl	rax,32
329	shr	rdx,32
330	sub	r13,rax
331	mov	rax,QWORD[24+rbx]
332	sbb	rbp,rdx
333
334	add	r13,r10
335	adc	r8,rbp
336	adc	r9,0
337
338
339	mov	rcx,rax
340	mul	QWORD[rsi]
341	add	r11,rax
342	mov	rax,rcx
343	adc	rdx,0
344	mov	rbp,rdx
345
346	mul	QWORD[8+rsi]
347	add	r12,rbp
348	adc	rdx,0
349	add	r12,rax
350	mov	rax,rcx
351	adc	rdx,0
352	mov	rbp,rdx
353
354	mul	QWORD[16+rsi]
355	add	r13,rbp
356	adc	rdx,0
357	add	r13,rax
358	mov	rax,rcx
359	adc	rdx,0
360
361	mov	rcx,r11
362	imul	r11,r15
363
364	mov	rbp,rdx
365	mul	QWORD[24+rsi]
366	add	r8,rbp
367	adc	rdx,0
368	xor	r10,r10
369	add	r8,rax
370	mov	rax,r11
371	adc	r9,rdx
372	adc	r10,0
373
374
375	mul	QWORD[r14]
376	mov	rbp,r11
377	add	rcx,rax
378	mov	rax,r11
379	adc	rcx,rdx
380
381	sub	r13,r11
382	sbb	r11,0
383
384	mul	QWORD[8+r14]
385	add	r12,rcx
386	adc	rdx,0
387	add	r12,rax
388	mov	rax,rbp
389	adc	r13,rdx
390	mov	rdx,rbp
391	adc	r11,0
392
393	shl	rax,32
394	shr	rdx,32
395	sub	r8,rax
396	sbb	rbp,rdx
397
398	add	r8,r11
399	adc	r9,rbp
400	adc	r10,0
401
402
403	mov	rsi,r12
404	sub	r12,QWORD[r14]
405	mov	r11,r13
406	sbb	r13,QWORD[8+r14]
407	mov	rcx,r8
408	sbb	r8,QWORD[16+r14]
409	mov	rbp,r9
410	sbb	r9,QWORD[24+r14]
411	sbb	r10,0
412
413	cmovc	r12,rsi
414	cmovc	r13,r11
415	cmovc	r8,rcx
416	cmovc	r9,rbp
417
418	mov	QWORD[rdi],r12
419	mov	QWORD[8+rdi],r13
420	mov	QWORD[16+rdi],r8
421	mov	QWORD[24+rdi],r9
422
423	mov	r15,QWORD[rsp]
424
425	mov	r14,QWORD[8+rsp]
426
427	mov	r13,QWORD[16+rsp]
428
429	mov	r12,QWORD[24+rsp]
430
431	mov	rbx,QWORD[32+rsp]
432
433	mov	rbp,QWORD[40+rsp]
434
435	lea	rsp,[48+rsp]
436
437$L$ord_mul_epilogue:
438	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
439	mov	rsi,QWORD[16+rsp]
440	ret
441
442$L$SEH_end_ecp_nistz256_ord_mul_mont:
443
444
445
446
447
448
449
450global	ecp_nistz256_ord_sqr_mont
451
452ALIGN	32
453ecp_nistz256_ord_sqr_mont:
454	mov	QWORD[8+rsp],rdi	;WIN64 prologue
455	mov	QWORD[16+rsp],rsi
456	mov	rax,rsp
457$L$SEH_begin_ecp_nistz256_ord_sqr_mont:
458	mov	rdi,rcx
459	mov	rsi,rdx
460	mov	rdx,r8
461
462
463
464_CET_ENDBR
465	lea	rcx,[OPENSSL_ia32cap_P]
466	mov	rcx,QWORD[8+rcx]
467	and	ecx,0x80100
468	cmp	ecx,0x80100
469	je	NEAR $L$ecp_nistz256_ord_sqr_montx
470	push	rbp
471
472	push	rbx
473
474	push	r12
475
476	push	r13
477
478	push	r14
479
480	push	r15
481
482$L$ord_sqr_body:
483
484	mov	r8,QWORD[rsi]
485	mov	rax,QWORD[8+rsi]
486	mov	r14,QWORD[16+rsi]
487	mov	r15,QWORD[24+rsi]
488	lea	rsi,[$L$ord]
489	mov	rbx,rdx
490	jmp	NEAR $L$oop_ord_sqr
491
492ALIGN	32
493$L$oop_ord_sqr:
494
495	mov	rbp,rax
496	mul	r8
497	mov	r9,rax
498DB	102,72,15,110,205
499	mov	rax,r14
500	mov	r10,rdx
501
502	mul	r8
503	add	r10,rax
504	mov	rax,r15
505DB	102,73,15,110,214
506	adc	rdx,0
507	mov	r11,rdx
508
509	mul	r8
510	add	r11,rax
511	mov	rax,r15
512DB	102,73,15,110,223
513	adc	rdx,0
514	mov	r12,rdx
515
516
517	mul	r14
518	mov	r13,rax
519	mov	rax,r14
520	mov	r14,rdx
521
522
523	mul	rbp
524	add	r11,rax
525	mov	rax,r15
526	adc	rdx,0
527	mov	r15,rdx
528
529	mul	rbp
530	add	r12,rax
531	adc	rdx,0
532
533	add	r12,r15
534	adc	r13,rdx
535	adc	r14,0
536
537
538	xor	r15,r15
539	mov	rax,r8
540	add	r9,r9
541	adc	r10,r10
542	adc	r11,r11
543	adc	r12,r12
544	adc	r13,r13
545	adc	r14,r14
546	adc	r15,0
547
548
549	mul	rax
550	mov	r8,rax
551DB	102,72,15,126,200
552	mov	rbp,rdx
553
554	mul	rax
555	add	r9,rbp
556	adc	r10,rax
557DB	102,72,15,126,208
558	adc	rdx,0
559	mov	rbp,rdx
560
561	mul	rax
562	add	r11,rbp
563	adc	r12,rax
564DB	102,72,15,126,216
565	adc	rdx,0
566	mov	rbp,rdx
567
568	mov	rcx,r8
569	imul	r8,QWORD[32+rsi]
570
571	mul	rax
572	add	r13,rbp
573	adc	r14,rax
574	mov	rax,QWORD[rsi]
575	adc	r15,rdx
576
577
578	mul	r8
579	mov	rbp,r8
580	add	rcx,rax
581	mov	rax,QWORD[8+rsi]
582	adc	rcx,rdx
583
584	sub	r10,r8
585	sbb	rbp,0
586
587	mul	r8
588	add	r9,rcx
589	adc	rdx,0
590	add	r9,rax
591	mov	rax,r8
592	adc	r10,rdx
593	mov	rdx,r8
594	adc	rbp,0
595
596	mov	rcx,r9
597	imul	r9,QWORD[32+rsi]
598
599	shl	rax,32
600	shr	rdx,32
601	sub	r11,rax
602	mov	rax,QWORD[rsi]
603	sbb	r8,rdx
604
605	add	r11,rbp
606	adc	r8,0
607
608
609	mul	r9
610	mov	rbp,r9
611	add	rcx,rax
612	mov	rax,QWORD[8+rsi]
613	adc	rcx,rdx
614
615	sub	r11,r9
616	sbb	rbp,0
617
618	mul	r9
619	add	r10,rcx
620	adc	rdx,0
621	add	r10,rax
622	mov	rax,r9
623	adc	r11,rdx
624	mov	rdx,r9
625	adc	rbp,0
626
627	mov	rcx,r10
628	imul	r10,QWORD[32+rsi]
629
630	shl	rax,32
631	shr	rdx,32
632	sub	r8,rax
633	mov	rax,QWORD[rsi]
634	sbb	r9,rdx
635
636	add	r8,rbp
637	adc	r9,0
638
639
640	mul	r10
641	mov	rbp,r10
642	add	rcx,rax
643	mov	rax,QWORD[8+rsi]
644	adc	rcx,rdx
645
646	sub	r8,r10
647	sbb	rbp,0
648
649	mul	r10
650	add	r11,rcx
651	adc	rdx,0
652	add	r11,rax
653	mov	rax,r10
654	adc	r8,rdx
655	mov	rdx,r10
656	adc	rbp,0
657
658	mov	rcx,r11
659	imul	r11,QWORD[32+rsi]
660
661	shl	rax,32
662	shr	rdx,32
663	sub	r9,rax
664	mov	rax,QWORD[rsi]
665	sbb	r10,rdx
666
667	add	r9,rbp
668	adc	r10,0
669
670
671	mul	r11
672	mov	rbp,r11
673	add	rcx,rax
674	mov	rax,QWORD[8+rsi]
675	adc	rcx,rdx
676
677	sub	r9,r11
678	sbb	rbp,0
679
680	mul	r11
681	add	r8,rcx
682	adc	rdx,0
683	add	r8,rax
684	mov	rax,r11
685	adc	r9,rdx
686	mov	rdx,r11
687	adc	rbp,0
688
689	shl	rax,32
690	shr	rdx,32
691	sub	r10,rax
692	sbb	r11,rdx
693
694	add	r10,rbp
695	adc	r11,0
696
697
698	xor	rdx,rdx
699	add	r8,r12
700	adc	r9,r13
701	mov	r12,r8
702	adc	r10,r14
703	adc	r11,r15
704	mov	rax,r9
705	adc	rdx,0
706
707
708	sub	r8,QWORD[rsi]
709	mov	r14,r10
710	sbb	r9,QWORD[8+rsi]
711	sbb	r10,QWORD[16+rsi]
712	mov	r15,r11
713	sbb	r11,QWORD[24+rsi]
714	sbb	rdx,0
715
716	cmovc	r8,r12
717	cmovnc	rax,r9
718	cmovnc	r14,r10
719	cmovnc	r15,r11
720
721	dec	rbx
722	jnz	NEAR $L$oop_ord_sqr
723
724	mov	QWORD[rdi],r8
725	mov	QWORD[8+rdi],rax
726	pxor	xmm1,xmm1
727	mov	QWORD[16+rdi],r14
728	pxor	xmm2,xmm2
729	mov	QWORD[24+rdi],r15
730	pxor	xmm3,xmm3
731
732	mov	r15,QWORD[rsp]
733
734	mov	r14,QWORD[8+rsp]
735
736	mov	r13,QWORD[16+rsp]
737
738	mov	r12,QWORD[24+rsp]
739
740	mov	rbx,QWORD[32+rsp]
741
742	mov	rbp,QWORD[40+rsp]
743
744	lea	rsp,[48+rsp]
745
746$L$ord_sqr_epilogue:
747	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
748	mov	rsi,QWORD[16+rsp]
749	ret
750
751$L$SEH_end_ecp_nistz256_ord_sqr_mont:
752
753
754ALIGN	32
755ecp_nistz256_ord_mul_montx:
756	mov	QWORD[8+rsp],rdi	;WIN64 prologue
757	mov	QWORD[16+rsp],rsi
758	mov	rax,rsp
759$L$SEH_begin_ecp_nistz256_ord_mul_montx:
760	mov	rdi,rcx
761	mov	rsi,rdx
762	mov	rdx,r8
763
764
765
766$L$ecp_nistz256_ord_mul_montx:
767	push	rbp
768
769	push	rbx
770
771	push	r12
772
773	push	r13
774
775	push	r14
776
777	push	r15
778
779$L$ord_mulx_body:
780
781	mov	rbx,rdx
782	mov	rdx,QWORD[rdx]
783	mov	r9,QWORD[rsi]
784	mov	r10,QWORD[8+rsi]
785	mov	r11,QWORD[16+rsi]
786	mov	r12,QWORD[24+rsi]
787	lea	rsi,[((-128))+rsi]
788	lea	r14,[(($L$ord-128))]
789	mov	r15,QWORD[$L$ordK]
790
791
792	mulx	r9,r8,r9
793	mulx	r10,rcx,r10
794	mulx	r11,rbp,r11
795	add	r9,rcx
796	mulx	r12,rcx,r12
797	mov	rdx,r8
798	mulx	rax,rdx,r15
799	adc	r10,rbp
800	adc	r11,rcx
801	adc	r12,0
802
803
804	xor	r13,r13
805	mulx	rbp,rcx,QWORD[((0+128))+r14]
806	adcx	r8,rcx
807	adox	r9,rbp
808
809	mulx	rbp,rcx,QWORD[((8+128))+r14]
810	adcx	r9,rcx
811	adox	r10,rbp
812
813	mulx	rbp,rcx,QWORD[((16+128))+r14]
814	adcx	r10,rcx
815	adox	r11,rbp
816
817	mulx	rbp,rcx,QWORD[((24+128))+r14]
818	mov	rdx,QWORD[8+rbx]
819	adcx	r11,rcx
820	adox	r12,rbp
821	adcx	r12,r8
822	adox	r13,r8
823	adc	r13,0
824
825
826	mulx	rbp,rcx,QWORD[((0+128))+rsi]
827	adcx	r9,rcx
828	adox	r10,rbp
829
830	mulx	rbp,rcx,QWORD[((8+128))+rsi]
831	adcx	r10,rcx
832	adox	r11,rbp
833
834	mulx	rbp,rcx,QWORD[((16+128))+rsi]
835	adcx	r11,rcx
836	adox	r12,rbp
837
838	mulx	rbp,rcx,QWORD[((24+128))+rsi]
839	mov	rdx,r9
840	mulx	rax,rdx,r15
841	adcx	r12,rcx
842	adox	r13,rbp
843
844	adcx	r13,r8
845	adox	r8,r8
846	adc	r8,0
847
848
849	mulx	rbp,rcx,QWORD[((0+128))+r14]
850	adcx	r9,rcx
851	adox	r10,rbp
852
853	mulx	rbp,rcx,QWORD[((8+128))+r14]
854	adcx	r10,rcx
855	adox	r11,rbp
856
857	mulx	rbp,rcx,QWORD[((16+128))+r14]
858	adcx	r11,rcx
859	adox	r12,rbp
860
861	mulx	rbp,rcx,QWORD[((24+128))+r14]
862	mov	rdx,QWORD[16+rbx]
863	adcx	r12,rcx
864	adox	r13,rbp
865	adcx	r13,r9
866	adox	r8,r9
867	adc	r8,0
868
869
870	mulx	rbp,rcx,QWORD[((0+128))+rsi]
871	adcx	r10,rcx
872	adox	r11,rbp
873
874	mulx	rbp,rcx,QWORD[((8+128))+rsi]
875	adcx	r11,rcx
876	adox	r12,rbp
877
878	mulx	rbp,rcx,QWORD[((16+128))+rsi]
879	adcx	r12,rcx
880	adox	r13,rbp
881
882	mulx	rbp,rcx,QWORD[((24+128))+rsi]
883	mov	rdx,r10
884	mulx	rax,rdx,r15
885	adcx	r13,rcx
886	adox	r8,rbp
887
888	adcx	r8,r9
889	adox	r9,r9
890	adc	r9,0
891
892
893	mulx	rbp,rcx,QWORD[((0+128))+r14]
894	adcx	r10,rcx
895	adox	r11,rbp
896
897	mulx	rbp,rcx,QWORD[((8+128))+r14]
898	adcx	r11,rcx
899	adox	r12,rbp
900
901	mulx	rbp,rcx,QWORD[((16+128))+r14]
902	adcx	r12,rcx
903	adox	r13,rbp
904
905	mulx	rbp,rcx,QWORD[((24+128))+r14]
906	mov	rdx,QWORD[24+rbx]
907	adcx	r13,rcx
908	adox	r8,rbp
909	adcx	r8,r10
910	adox	r9,r10
911	adc	r9,0
912
913
914	mulx	rbp,rcx,QWORD[((0+128))+rsi]
915	adcx	r11,rcx
916	adox	r12,rbp
917
918	mulx	rbp,rcx,QWORD[((8+128))+rsi]
919	adcx	r12,rcx
920	adox	r13,rbp
921
922	mulx	rbp,rcx,QWORD[((16+128))+rsi]
923	adcx	r13,rcx
924	adox	r8,rbp
925
926	mulx	rbp,rcx,QWORD[((24+128))+rsi]
927	mov	rdx,r11
928	mulx	rax,rdx,r15
929	adcx	r8,rcx
930	adox	r9,rbp
931
932	adcx	r9,r10
933	adox	r10,r10
934	adc	r10,0
935
936
937	mulx	rbp,rcx,QWORD[((0+128))+r14]
938	adcx	r11,rcx
939	adox	r12,rbp
940
941	mulx	rbp,rcx,QWORD[((8+128))+r14]
942	adcx	r12,rcx
943	adox	r13,rbp
944
945	mulx	rbp,rcx,QWORD[((16+128))+r14]
946	adcx	r13,rcx
947	adox	r8,rbp
948
949	mulx	rbp,rcx,QWORD[((24+128))+r14]
950	lea	r14,[128+r14]
951	mov	rbx,r12
952	adcx	r8,rcx
953	adox	r9,rbp
954	mov	rdx,r13
955	adcx	r9,r11
956	adox	r10,r11
957	adc	r10,0
958
959
960
961	mov	rcx,r8
962	sub	r12,QWORD[r14]
963	sbb	r13,QWORD[8+r14]
964	sbb	r8,QWORD[16+r14]
965	mov	rbp,r9
966	sbb	r9,QWORD[24+r14]
967	sbb	r10,0
968
969	cmovc	r12,rbx
970	cmovc	r13,rdx
971	cmovc	r8,rcx
972	cmovc	r9,rbp
973
974	mov	QWORD[rdi],r12
975	mov	QWORD[8+rdi],r13
976	mov	QWORD[16+rdi],r8
977	mov	QWORD[24+rdi],r9
978
979	mov	r15,QWORD[rsp]
980
981	mov	r14,QWORD[8+rsp]
982
983	mov	r13,QWORD[16+rsp]
984
985	mov	r12,QWORD[24+rsp]
986
987	mov	rbx,QWORD[32+rsp]
988
989	mov	rbp,QWORD[40+rsp]
990
991	lea	rsp,[48+rsp]
992
993$L$ord_mulx_epilogue:
994	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
995	mov	rsi,QWORD[16+rsp]
996	ret
997
998$L$SEH_end_ecp_nistz256_ord_mul_montx:
999
1000
1001ALIGN	32
1002ecp_nistz256_ord_sqr_montx:
1003	mov	QWORD[8+rsp],rdi	;WIN64 prologue
1004	mov	QWORD[16+rsp],rsi
1005	mov	rax,rsp
1006$L$SEH_begin_ecp_nistz256_ord_sqr_montx:
1007	mov	rdi,rcx
1008	mov	rsi,rdx
1009	mov	rdx,r8
1010
1011
1012
1013$L$ecp_nistz256_ord_sqr_montx:
1014	push	rbp
1015
1016	push	rbx
1017
1018	push	r12
1019
1020	push	r13
1021
1022	push	r14
1023
1024	push	r15
1025
1026$L$ord_sqrx_body:
1027
1028	mov	rbx,rdx
1029	mov	rdx,QWORD[rsi]
1030	mov	r14,QWORD[8+rsi]
1031	mov	r15,QWORD[16+rsi]
1032	mov	r8,QWORD[24+rsi]
1033	lea	rsi,[$L$ord]
1034	jmp	NEAR $L$oop_ord_sqrx
1035
1036ALIGN	32
1037$L$oop_ord_sqrx:
1038	mulx	r10,r9,r14
1039	mulx	r11,rcx,r15
1040	mov	rax,rdx
1041DB	102,73,15,110,206
1042	mulx	r12,rbp,r8
1043	mov	rdx,r14
1044	add	r10,rcx
1045DB	102,73,15,110,215
1046	adc	r11,rbp
1047	adc	r12,0
1048	xor	r13,r13
1049
1050	mulx	rbp,rcx,r15
1051	adcx	r11,rcx
1052	adox	r12,rbp
1053
1054	mulx	rbp,rcx,r8
1055	mov	rdx,r15
1056	adcx	r12,rcx
1057	adox	r13,rbp
1058	adc	r13,0
1059
1060	mulx	r14,rcx,r8
1061	mov	rdx,rax
1062DB	102,73,15,110,216
1063	xor	r15,r15
1064	adcx	r9,r9
1065	adox	r13,rcx
1066	adcx	r10,r10
1067	adox	r14,r15
1068
1069
1070	mulx	rbp,r8,rdx
1071DB	102,72,15,126,202
1072	adcx	r11,r11
1073	adox	r9,rbp
1074	adcx	r12,r12
1075	mulx	rax,rcx,rdx
1076DB	102,72,15,126,210
1077	adcx	r13,r13
1078	adox	r10,rcx
1079	adcx	r14,r14
1080	mulx	rbp,rcx,rdx
1081	DB	0x67
1082DB	102,72,15,126,218
1083	adox	r11,rax
1084	adcx	r15,r15
1085	adox	r12,rcx
1086	adox	r13,rbp
1087	mulx	rax,rcx,rdx
1088	adox	r14,rcx
1089	adox	r15,rax
1090
1091
1092	mov	rdx,r8
1093	mulx	rcx,rdx,QWORD[32+rsi]
1094
1095	xor	rax,rax
1096	mulx	rbp,rcx,QWORD[rsi]
1097	adcx	r8,rcx
1098	adox	r9,rbp
1099	mulx	rbp,rcx,QWORD[8+rsi]
1100	adcx	r9,rcx
1101	adox	r10,rbp
1102	mulx	rbp,rcx,QWORD[16+rsi]
1103	adcx	r10,rcx
1104	adox	r11,rbp
1105	mulx	rbp,rcx,QWORD[24+rsi]
1106	adcx	r11,rcx
1107	adox	r8,rbp
1108	adcx	r8,rax
1109
1110
1111	mov	rdx,r9
1112	mulx	rcx,rdx,QWORD[32+rsi]
1113
1114	mulx	rbp,rcx,QWORD[rsi]
1115	adox	r9,rcx
1116	adcx	r10,rbp
1117	mulx	rbp,rcx,QWORD[8+rsi]
1118	adox	r10,rcx
1119	adcx	r11,rbp
1120	mulx	rbp,rcx,QWORD[16+rsi]
1121	adox	r11,rcx
1122	adcx	r8,rbp
1123	mulx	rbp,rcx,QWORD[24+rsi]
1124	adox	r8,rcx
1125	adcx	r9,rbp
1126	adox	r9,rax
1127
1128
1129	mov	rdx,r10
1130	mulx	rcx,rdx,QWORD[32+rsi]
1131
1132	mulx	rbp,rcx,QWORD[rsi]
1133	adcx	r10,rcx
1134	adox	r11,rbp
1135	mulx	rbp,rcx,QWORD[8+rsi]
1136	adcx	r11,rcx
1137	adox	r8,rbp
1138	mulx	rbp,rcx,QWORD[16+rsi]
1139	adcx	r8,rcx
1140	adox	r9,rbp
1141	mulx	rbp,rcx,QWORD[24+rsi]
1142	adcx	r9,rcx
1143	adox	r10,rbp
1144	adcx	r10,rax
1145
1146
1147	mov	rdx,r11
1148	mulx	rcx,rdx,QWORD[32+rsi]
1149
1150	mulx	rbp,rcx,QWORD[rsi]
1151	adox	r11,rcx
1152	adcx	r8,rbp
1153	mulx	rbp,rcx,QWORD[8+rsi]
1154	adox	r8,rcx
1155	adcx	r9,rbp
1156	mulx	rbp,rcx,QWORD[16+rsi]
1157	adox	r9,rcx
1158	adcx	r10,rbp
1159	mulx	rbp,rcx,QWORD[24+rsi]
1160	adox	r10,rcx
1161	adcx	r11,rbp
1162	adox	r11,rax
1163
1164
1165	add	r12,r8
1166	adc	r9,r13
1167	mov	rdx,r12
1168	adc	r10,r14
1169	adc	r11,r15
1170	mov	r14,r9
1171	adc	rax,0
1172
1173
1174	sub	r12,QWORD[rsi]
1175	mov	r15,r10
1176	sbb	r9,QWORD[8+rsi]
1177	sbb	r10,QWORD[16+rsi]
1178	mov	r8,r11
1179	sbb	r11,QWORD[24+rsi]
1180	sbb	rax,0
1181
1182	cmovnc	rdx,r12
1183	cmovnc	r14,r9
1184	cmovnc	r15,r10
1185	cmovnc	r8,r11
1186
1187	dec	rbx
1188	jnz	NEAR $L$oop_ord_sqrx
1189
1190	mov	QWORD[rdi],rdx
1191	mov	QWORD[8+rdi],r14
1192	pxor	xmm1,xmm1
1193	mov	QWORD[16+rdi],r15
1194	pxor	xmm2,xmm2
1195	mov	QWORD[24+rdi],r8
1196	pxor	xmm3,xmm3
1197
1198	mov	r15,QWORD[rsp]
1199
1200	mov	r14,QWORD[8+rsp]
1201
1202	mov	r13,QWORD[16+rsp]
1203
1204	mov	r12,QWORD[24+rsp]
1205
1206	mov	rbx,QWORD[32+rsp]
1207
1208	mov	rbp,QWORD[40+rsp]
1209
1210	lea	rsp,[48+rsp]
1211
1212$L$ord_sqrx_epilogue:
1213	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
1214	mov	rsi,QWORD[16+rsp]
1215	ret
1216
1217$L$SEH_end_ecp_nistz256_ord_sqr_montx:
1218
1219
1220
1221
1222
1223
1224global	ecp_nistz256_mul_mont
1225
1226ALIGN	32
1227ecp_nistz256_mul_mont:
1228	mov	QWORD[8+rsp],rdi	;WIN64 prologue
1229	mov	QWORD[16+rsp],rsi
1230	mov	rax,rsp
1231$L$SEH_begin_ecp_nistz256_mul_mont:
1232	mov	rdi,rcx
1233	mov	rsi,rdx
1234	mov	rdx,r8
1235
1236
1237
1238_CET_ENDBR
1239	lea	rcx,[OPENSSL_ia32cap_P]
1240	mov	rcx,QWORD[8+rcx]
1241	and	ecx,0x80100
1242$L$mul_mont:
1243	push	rbp
1244
1245	push	rbx
1246
1247	push	r12
1248
1249	push	r13
1250
1251	push	r14
1252
1253	push	r15
1254
1255$L$mul_body:
1256	cmp	ecx,0x80100
1257	je	NEAR $L$mul_montx
1258	mov	rbx,rdx
1259	mov	rax,QWORD[rdx]
1260	mov	r9,QWORD[rsi]
1261	mov	r10,QWORD[8+rsi]
1262	mov	r11,QWORD[16+rsi]
1263	mov	r12,QWORD[24+rsi]
1264
1265	call	__ecp_nistz256_mul_montq
1266	jmp	NEAR $L$mul_mont_done
1267
1268ALIGN	32
1269$L$mul_montx:
1270	mov	rbx,rdx
1271	mov	rdx,QWORD[rdx]
1272	mov	r9,QWORD[rsi]
1273	mov	r10,QWORD[8+rsi]
1274	mov	r11,QWORD[16+rsi]
1275	mov	r12,QWORD[24+rsi]
1276	lea	rsi,[((-128))+rsi]
1277
1278	call	__ecp_nistz256_mul_montx
1279$L$mul_mont_done:
1280	mov	r15,QWORD[rsp]
1281
1282	mov	r14,QWORD[8+rsp]
1283
1284	mov	r13,QWORD[16+rsp]
1285
1286	mov	r12,QWORD[24+rsp]
1287
1288	mov	rbx,QWORD[32+rsp]
1289
1290	mov	rbp,QWORD[40+rsp]
1291
1292	lea	rsp,[48+rsp]
1293
1294$L$mul_epilogue:
1295	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
1296	mov	rsi,QWORD[16+rsp]
1297	ret
1298
1299$L$SEH_end_ecp_nistz256_mul_mont:
1300
1301
1302ALIGN	32
1303__ecp_nistz256_mul_montq:
1304
1305
1306
1307	mov	rbp,rax
1308	mul	r9
1309	mov	r14,QWORD[(($L$poly+8))]
1310	mov	r8,rax
1311	mov	rax,rbp
1312	mov	r9,rdx
1313
1314	mul	r10
1315	mov	r15,QWORD[(($L$poly+24))]
1316	add	r9,rax
1317	mov	rax,rbp
1318	adc	rdx,0
1319	mov	r10,rdx
1320
1321	mul	r11
1322	add	r10,rax
1323	mov	rax,rbp
1324	adc	rdx,0
1325	mov	r11,rdx
1326
1327	mul	r12
1328	add	r11,rax
1329	mov	rax,r8
1330	adc	rdx,0
1331	xor	r13,r13
1332	mov	r12,rdx
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343	mov	rbp,r8
1344	shl	r8,32
1345	mul	r15
1346	shr	rbp,32
1347	add	r9,r8
1348	adc	r10,rbp
1349	adc	r11,rax
1350	mov	rax,QWORD[8+rbx]
1351	adc	r12,rdx
1352	adc	r13,0
1353	xor	r8,r8
1354
1355
1356
1357	mov	rbp,rax
1358	mul	QWORD[rsi]
1359	add	r9,rax
1360	mov	rax,rbp
1361	adc	rdx,0
1362	mov	rcx,rdx
1363
1364	mul	QWORD[8+rsi]
1365	add	r10,rcx
1366	adc	rdx,0
1367	add	r10,rax
1368	mov	rax,rbp
1369	adc	rdx,0
1370	mov	rcx,rdx
1371
1372	mul	QWORD[16+rsi]
1373	add	r11,rcx
1374	adc	rdx,0
1375	add	r11,rax
1376	mov	rax,rbp
1377	adc	rdx,0
1378	mov	rcx,rdx
1379
1380	mul	QWORD[24+rsi]
1381	add	r12,rcx
1382	adc	rdx,0
1383	add	r12,rax
1384	mov	rax,r9
1385	adc	r13,rdx
1386	adc	r8,0
1387
1388
1389
1390	mov	rbp,r9
1391	shl	r9,32
1392	mul	r15
1393	shr	rbp,32
1394	add	r10,r9
1395	adc	r11,rbp
1396	adc	r12,rax
1397	mov	rax,QWORD[16+rbx]
1398	adc	r13,rdx
1399	adc	r8,0
1400	xor	r9,r9
1401
1402
1403
1404	mov	rbp,rax
1405	mul	QWORD[rsi]
1406	add	r10,rax
1407	mov	rax,rbp
1408	adc	rdx,0
1409	mov	rcx,rdx
1410
1411	mul	QWORD[8+rsi]
1412	add	r11,rcx
1413	adc	rdx,0
1414	add	r11,rax
1415	mov	rax,rbp
1416	adc	rdx,0
1417	mov	rcx,rdx
1418
1419	mul	QWORD[16+rsi]
1420	add	r12,rcx
1421	adc	rdx,0
1422	add	r12,rax
1423	mov	rax,rbp
1424	adc	rdx,0
1425	mov	rcx,rdx
1426
1427	mul	QWORD[24+rsi]
1428	add	r13,rcx
1429	adc	rdx,0
1430	add	r13,rax
1431	mov	rax,r10
1432	adc	r8,rdx
1433	adc	r9,0
1434
1435
1436
1437	mov	rbp,r10
1438	shl	r10,32
1439	mul	r15
1440	shr	rbp,32
1441	add	r11,r10
1442	adc	r12,rbp
1443	adc	r13,rax
1444	mov	rax,QWORD[24+rbx]
1445	adc	r8,rdx
1446	adc	r9,0
1447	xor	r10,r10
1448
1449
1450
1451	mov	rbp,rax
1452	mul	QWORD[rsi]
1453	add	r11,rax
1454	mov	rax,rbp
1455	adc	rdx,0
1456	mov	rcx,rdx
1457
1458	mul	QWORD[8+rsi]
1459	add	r12,rcx
1460	adc	rdx,0
1461	add	r12,rax
1462	mov	rax,rbp
1463	adc	rdx,0
1464	mov	rcx,rdx
1465
1466	mul	QWORD[16+rsi]
1467	add	r13,rcx
1468	adc	rdx,0
1469	add	r13,rax
1470	mov	rax,rbp
1471	adc	rdx,0
1472	mov	rcx,rdx
1473
1474	mul	QWORD[24+rsi]
1475	add	r8,rcx
1476	adc	rdx,0
1477	add	r8,rax
1478	mov	rax,r11
1479	adc	r9,rdx
1480	adc	r10,0
1481
1482
1483
1484	mov	rbp,r11
1485	shl	r11,32
1486	mul	r15
1487	shr	rbp,32
1488	add	r12,r11
1489	adc	r13,rbp
1490	mov	rcx,r12
1491	adc	r8,rax
1492	adc	r9,rdx
1493	mov	rbp,r13
1494	adc	r10,0
1495
1496
1497
1498	sub	r12,-1
1499	mov	rbx,r8
1500	sbb	r13,r14
1501	sbb	r8,0
1502	mov	rdx,r9
1503	sbb	r9,r15
1504	sbb	r10,0
1505
1506	cmovc	r12,rcx
1507	cmovc	r13,rbp
1508	mov	QWORD[rdi],r12
1509	cmovc	r8,rbx
1510	mov	QWORD[8+rdi],r13
1511	cmovc	r9,rdx
1512	mov	QWORD[16+rdi],r8
1513	mov	QWORD[24+rdi],r9
1514
1515	ret
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526global	ecp_nistz256_sqr_mont
1527
1528ALIGN	32
1529ecp_nistz256_sqr_mont:
1530	mov	QWORD[8+rsp],rdi	;WIN64 prologue
1531	mov	QWORD[16+rsp],rsi
1532	mov	rax,rsp
1533$L$SEH_begin_ecp_nistz256_sqr_mont:
1534	mov	rdi,rcx
1535	mov	rsi,rdx
1536
1537
1538
1539_CET_ENDBR
1540	lea	rcx,[OPENSSL_ia32cap_P]
1541	mov	rcx,QWORD[8+rcx]
1542	and	ecx,0x80100
1543	push	rbp
1544
1545	push	rbx
1546
1547	push	r12
1548
1549	push	r13
1550
1551	push	r14
1552
1553	push	r15
1554
1555$L$sqr_body:
1556	cmp	ecx,0x80100
1557	je	NEAR $L$sqr_montx
1558	mov	rax,QWORD[rsi]
1559	mov	r14,QWORD[8+rsi]
1560	mov	r15,QWORD[16+rsi]
1561	mov	r8,QWORD[24+rsi]
1562
1563	call	__ecp_nistz256_sqr_montq
1564	jmp	NEAR $L$sqr_mont_done
1565
1566ALIGN	32
1567$L$sqr_montx:
1568	mov	rdx,QWORD[rsi]
1569	mov	r14,QWORD[8+rsi]
1570	mov	r15,QWORD[16+rsi]
1571	mov	r8,QWORD[24+rsi]
1572	lea	rsi,[((-128))+rsi]
1573
1574	call	__ecp_nistz256_sqr_montx
1575$L$sqr_mont_done:
1576	mov	r15,QWORD[rsp]
1577
1578	mov	r14,QWORD[8+rsp]
1579
1580	mov	r13,QWORD[16+rsp]
1581
1582	mov	r12,QWORD[24+rsp]
1583
1584	mov	rbx,QWORD[32+rsp]
1585
1586	mov	rbp,QWORD[40+rsp]
1587
1588	lea	rsp,[48+rsp]
1589
1590$L$sqr_epilogue:
1591	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
1592	mov	rsi,QWORD[16+rsp]
1593	ret
1594
1595$L$SEH_end_ecp_nistz256_sqr_mont:
1596
1597
1598ALIGN	32
1599__ecp_nistz256_sqr_montq:
1600
1601	mov	r13,rax
1602	mul	r14
1603	mov	r9,rax
1604	mov	rax,r15
1605	mov	r10,rdx
1606
1607	mul	r13
1608	add	r10,rax
1609	mov	rax,r8
1610	adc	rdx,0
1611	mov	r11,rdx
1612
1613	mul	r13
1614	add	r11,rax
1615	mov	rax,r15
1616	adc	rdx,0
1617	mov	r12,rdx
1618
1619
1620	mul	r14
1621	add	r11,rax
1622	mov	rax,r8
1623	adc	rdx,0
1624	mov	rbp,rdx
1625
1626	mul	r14
1627	add	r12,rax
1628	mov	rax,r8
1629	adc	rdx,0
1630	add	r12,rbp
1631	mov	r13,rdx
1632	adc	r13,0
1633
1634
1635	mul	r15
1636	xor	r15,r15
1637	add	r13,rax
1638	mov	rax,QWORD[rsi]
1639	mov	r14,rdx
1640	adc	r14,0
1641
1642	add	r9,r9
1643	adc	r10,r10
1644	adc	r11,r11
1645	adc	r12,r12
1646	adc	r13,r13
1647	adc	r14,r14
1648	adc	r15,0
1649
1650	mul	rax
1651	mov	r8,rax
1652	mov	rax,QWORD[8+rsi]
1653	mov	rcx,rdx
1654
1655	mul	rax
1656	add	r9,rcx
1657	adc	r10,rax
1658	mov	rax,QWORD[16+rsi]
1659	adc	rdx,0
1660	mov	rcx,rdx
1661
1662	mul	rax
1663	add	r11,rcx
1664	adc	r12,rax
1665	mov	rax,QWORD[24+rsi]
1666	adc	rdx,0
1667	mov	rcx,rdx
1668
1669	mul	rax
1670	add	r13,rcx
1671	adc	r14,rax
1672	mov	rax,r8
1673	adc	r15,rdx
1674
1675	mov	rsi,QWORD[(($L$poly+8))]
1676	mov	rbp,QWORD[(($L$poly+24))]
1677
1678
1679
1680
1681	mov	rcx,r8
1682	shl	r8,32
1683	mul	rbp
1684	shr	rcx,32
1685	add	r9,r8
1686	adc	r10,rcx
1687	adc	r11,rax
1688	mov	rax,r9
1689	adc	rdx,0
1690
1691
1692
1693	mov	rcx,r9
1694	shl	r9,32
1695	mov	r8,rdx
1696	mul	rbp
1697	shr	rcx,32
1698	add	r10,r9
1699	adc	r11,rcx
1700	adc	r8,rax
1701	mov	rax,r10
1702	adc	rdx,0
1703
1704
1705
1706	mov	rcx,r10
1707	shl	r10,32
1708	mov	r9,rdx
1709	mul	rbp
1710	shr	rcx,32
1711	add	r11,r10
1712	adc	r8,rcx
1713	adc	r9,rax
1714	mov	rax,r11
1715	adc	rdx,0
1716
1717
1718
1719	mov	rcx,r11
1720	shl	r11,32
1721	mov	r10,rdx
1722	mul	rbp
1723	shr	rcx,32
1724	add	r8,r11
1725	adc	r9,rcx
1726	adc	r10,rax
1727	adc	rdx,0
1728	xor	r11,r11
1729
1730
1731
1732	add	r12,r8
1733	adc	r13,r9
1734	mov	r8,r12
1735	adc	r14,r10
1736	adc	r15,rdx
1737	mov	r9,r13
1738	adc	r11,0
1739
1740	sub	r12,-1
1741	mov	r10,r14
1742	sbb	r13,rsi
1743	sbb	r14,0
1744	mov	rcx,r15
1745	sbb	r15,rbp
1746	sbb	r11,0
1747
1748	cmovc	r12,r8
1749	cmovc	r13,r9
1750	mov	QWORD[rdi],r12
1751	cmovc	r14,r10
1752	mov	QWORD[8+rdi],r13
1753	cmovc	r15,rcx
1754	mov	QWORD[16+rdi],r14
1755	mov	QWORD[24+rdi],r15
1756
1757	ret
1758
1759
1760
1761ALIGN	32
1762__ecp_nistz256_mul_montx:
1763
1764
1765
1766	mulx	r9,r8,r9
1767	mulx	r10,rcx,r10
1768	mov	r14,32
1769	xor	r13,r13
1770	mulx	r11,rbp,r11
1771	mov	r15,QWORD[(($L$poly+24))]
1772	adc	r9,rcx
1773	mulx	r12,rcx,r12
1774	mov	rdx,r8
1775	adc	r10,rbp
1776	shlx	rbp,r8,r14
1777	adc	r11,rcx
1778	shrx	rcx,r8,r14
1779	adc	r12,0
1780
1781
1782
1783	add	r9,rbp
1784	adc	r10,rcx
1785
1786	mulx	rbp,rcx,r15
1787	mov	rdx,QWORD[8+rbx]
1788	adc	r11,rcx
1789	adc	r12,rbp
1790	adc	r13,0
1791	xor	r8,r8
1792
1793
1794
1795	mulx	rbp,rcx,QWORD[((0+128))+rsi]
1796	adcx	r9,rcx
1797	adox	r10,rbp
1798
1799	mulx	rbp,rcx,QWORD[((8+128))+rsi]
1800	adcx	r10,rcx
1801	adox	r11,rbp
1802
1803	mulx	rbp,rcx,QWORD[((16+128))+rsi]
1804	adcx	r11,rcx
1805	adox	r12,rbp
1806
1807	mulx	rbp,rcx,QWORD[((24+128))+rsi]
1808	mov	rdx,r9
1809	adcx	r12,rcx
1810	shlx	rcx,r9,r14
1811	adox	r13,rbp
1812	shrx	rbp,r9,r14
1813
1814	adcx	r13,r8
1815	adox	r8,r8
1816	adc	r8,0
1817
1818
1819
1820	add	r10,rcx
1821	adc	r11,rbp
1822
1823	mulx	rbp,rcx,r15
1824	mov	rdx,QWORD[16+rbx]
1825	adc	r12,rcx
1826	adc	r13,rbp
1827	adc	r8,0
1828	xor	r9,r9
1829
1830
1831
1832	mulx	rbp,rcx,QWORD[((0+128))+rsi]
1833	adcx	r10,rcx
1834	adox	r11,rbp
1835
1836	mulx	rbp,rcx,QWORD[((8+128))+rsi]
1837	adcx	r11,rcx
1838	adox	r12,rbp
1839
1840	mulx	rbp,rcx,QWORD[((16+128))+rsi]
1841	adcx	r12,rcx
1842	adox	r13,rbp
1843
1844	mulx	rbp,rcx,QWORD[((24+128))+rsi]
1845	mov	rdx,r10
1846	adcx	r13,rcx
1847	shlx	rcx,r10,r14
1848	adox	r8,rbp
1849	shrx	rbp,r10,r14
1850
1851	adcx	r8,r9
1852	adox	r9,r9
1853	adc	r9,0
1854
1855
1856
1857	add	r11,rcx
1858	adc	r12,rbp
1859
1860	mulx	rbp,rcx,r15
1861	mov	rdx,QWORD[24+rbx]
1862	adc	r13,rcx
1863	adc	r8,rbp
1864	adc	r9,0
1865	xor	r10,r10
1866
1867
1868
1869	mulx	rbp,rcx,QWORD[((0+128))+rsi]
1870	adcx	r11,rcx
1871	adox	r12,rbp
1872
1873	mulx	rbp,rcx,QWORD[((8+128))+rsi]
1874	adcx	r12,rcx
1875	adox	r13,rbp
1876
1877	mulx	rbp,rcx,QWORD[((16+128))+rsi]
1878	adcx	r13,rcx
1879	adox	r8,rbp
1880
1881	mulx	rbp,rcx,QWORD[((24+128))+rsi]
1882	mov	rdx,r11
1883	adcx	r8,rcx
1884	shlx	rcx,r11,r14
1885	adox	r9,rbp
1886	shrx	rbp,r11,r14
1887
1888	adcx	r9,r10
1889	adox	r10,r10
1890	adc	r10,0
1891
1892
1893
1894	add	r12,rcx
1895	adc	r13,rbp
1896
1897	mulx	rbp,rcx,r15
1898	mov	rbx,r12
1899	mov	r14,QWORD[(($L$poly+8))]
1900	adc	r8,rcx
1901	mov	rdx,r13
1902	adc	r9,rbp
1903	adc	r10,0
1904
1905
1906
1907	xor	eax,eax
1908	mov	rcx,r8
1909	sbb	r12,-1
1910	sbb	r13,r14
1911	sbb	r8,0
1912	mov	rbp,r9
1913	sbb	r9,r15
1914	sbb	r10,0
1915
1916	cmovc	r12,rbx
1917	cmovc	r13,rdx
1918	mov	QWORD[rdi],r12
1919	cmovc	r8,rcx
1920	mov	QWORD[8+rdi],r13
1921	cmovc	r9,rbp
1922	mov	QWORD[16+rdi],r8
1923	mov	QWORD[24+rdi],r9
1924
1925	ret
1926
1927
1928
1929
1930ALIGN	32
1931__ecp_nistz256_sqr_montx:
1932
1933	mulx	r10,r9,r14
1934	mulx	r11,rcx,r15
1935	xor	eax,eax
1936	adc	r10,rcx
1937	mulx	r12,rbp,r8
1938	mov	rdx,r14
1939	adc	r11,rbp
1940	adc	r12,0
1941	xor	r13,r13
1942
1943
1944	mulx	rbp,rcx,r15
1945	adcx	r11,rcx
1946	adox	r12,rbp
1947
1948	mulx	rbp,rcx,r8
1949	mov	rdx,r15
1950	adcx	r12,rcx
1951	adox	r13,rbp
1952	adc	r13,0
1953
1954
1955	mulx	r14,rcx,r8
1956	mov	rdx,QWORD[((0+128))+rsi]
1957	xor	r15,r15
1958	adcx	r9,r9
1959	adox	r13,rcx
1960	adcx	r10,r10
1961	adox	r14,r15
1962
1963	mulx	rbp,r8,rdx
1964	mov	rdx,QWORD[((8+128))+rsi]
1965	adcx	r11,r11
1966	adox	r9,rbp
1967	adcx	r12,r12
1968	mulx	rax,rcx,rdx
1969	mov	rdx,QWORD[((16+128))+rsi]
1970	adcx	r13,r13
1971	adox	r10,rcx
1972	adcx	r14,r14
1973	DB	0x67
1974	mulx	rbp,rcx,rdx
1975	mov	rdx,QWORD[((24+128))+rsi]
1976	adox	r11,rax
1977	adcx	r15,r15
1978	adox	r12,rcx
1979	mov	rsi,32
1980	adox	r13,rbp
1981	DB	0x67,0x67
1982	mulx	rax,rcx,rdx
1983	mov	rdx,QWORD[(($L$poly+24))]
1984	adox	r14,rcx
1985	shlx	rcx,r8,rsi
1986	adox	r15,rax
1987	shrx	rax,r8,rsi
1988	mov	rbp,rdx
1989
1990
1991	add	r9,rcx
1992	adc	r10,rax
1993
1994	mulx	r8,rcx,r8
1995	adc	r11,rcx
1996	shlx	rcx,r9,rsi
1997	adc	r8,0
1998	shrx	rax,r9,rsi
1999
2000
2001	add	r10,rcx
2002	adc	r11,rax
2003
2004	mulx	r9,rcx,r9
2005	adc	r8,rcx
2006	shlx	rcx,r10,rsi
2007	adc	r9,0
2008	shrx	rax,r10,rsi
2009
2010
2011	add	r11,rcx
2012	adc	r8,rax
2013
2014	mulx	r10,rcx,r10
2015	adc	r9,rcx
2016	shlx	rcx,r11,rsi
2017	adc	r10,0
2018	shrx	rax,r11,rsi
2019
2020
2021	add	r8,rcx
2022	adc	r9,rax
2023
2024	mulx	r11,rcx,r11
2025	adc	r10,rcx
2026	adc	r11,0
2027
2028	xor	rdx,rdx
2029	add	r12,r8
2030	mov	rsi,QWORD[(($L$poly+8))]
2031	adc	r13,r9
2032	mov	r8,r12
2033	adc	r14,r10
2034	adc	r15,r11
2035	mov	r9,r13
2036	adc	rdx,0
2037
2038	sub	r12,-1
2039	mov	r10,r14
2040	sbb	r13,rsi
2041	sbb	r14,0
2042	mov	r11,r15
2043	sbb	r15,rbp
2044	sbb	rdx,0
2045
2046	cmovc	r12,r8
2047	cmovc	r13,r9
2048	mov	QWORD[rdi],r12
2049	cmovc	r14,r10
2050	mov	QWORD[8+rdi],r13
2051	cmovc	r15,r11
2052	mov	QWORD[16+rdi],r14
2053	mov	QWORD[24+rdi],r15
2054
2055	ret
2056
2057
2058
2059
2060global	ecp_nistz256_select_w5
2061
2062ALIGN	32
2063ecp_nistz256_select_w5:
2064
2065_CET_ENDBR
2066	lea	rax,[OPENSSL_ia32cap_P]
2067	mov	rax,QWORD[8+rax]
2068	test	eax,32
2069	jnz	NEAR $L$avx2_select_w5
2070	lea	rax,[((-136))+rsp]
2071$L$SEH_begin_ecp_nistz256_select_w5:
2072	DB	0x48,0x8d,0x60,0xe0
2073	DB	0x0f,0x29,0x70,0xe0
2074	DB	0x0f,0x29,0x78,0xf0
2075	DB	0x44,0x0f,0x29,0x00
2076	DB	0x44,0x0f,0x29,0x48,0x10
2077	DB	0x44,0x0f,0x29,0x50,0x20
2078	DB	0x44,0x0f,0x29,0x58,0x30
2079	DB	0x44,0x0f,0x29,0x60,0x40
2080	DB	0x44,0x0f,0x29,0x68,0x50
2081	DB	0x44,0x0f,0x29,0x70,0x60
2082	DB	0x44,0x0f,0x29,0x78,0x70
2083	movdqa	xmm0,XMMWORD[$L$One]
2084	movd	xmm1,r8d
2085
2086	pxor	xmm2,xmm2
2087	pxor	xmm3,xmm3
2088	pxor	xmm4,xmm4
2089	pxor	xmm5,xmm5
2090	pxor	xmm6,xmm6
2091	pxor	xmm7,xmm7
2092
2093	movdqa	xmm8,xmm0
2094	pshufd	xmm1,xmm1,0
2095
2096	mov	rax,16
2097$L$select_loop_sse_w5:
2098
2099	movdqa	xmm15,xmm8
2100	paddd	xmm8,xmm0
2101	pcmpeqd	xmm15,xmm1
2102
2103	movdqa	xmm9,XMMWORD[rdx]
2104	movdqa	xmm10,XMMWORD[16+rdx]
2105	movdqa	xmm11,XMMWORD[32+rdx]
2106	movdqa	xmm12,XMMWORD[48+rdx]
2107	movdqa	xmm13,XMMWORD[64+rdx]
2108	movdqa	xmm14,XMMWORD[80+rdx]
2109	lea	rdx,[96+rdx]
2110
2111	pand	xmm9,xmm15
2112	pand	xmm10,xmm15
2113	por	xmm2,xmm9
2114	pand	xmm11,xmm15
2115	por	xmm3,xmm10
2116	pand	xmm12,xmm15
2117	por	xmm4,xmm11
2118	pand	xmm13,xmm15
2119	por	xmm5,xmm12
2120	pand	xmm14,xmm15
2121	por	xmm6,xmm13
2122	por	xmm7,xmm14
2123
2124	dec	rax
2125	jnz	NEAR $L$select_loop_sse_w5
2126
2127	movdqu	XMMWORD[rcx],xmm2
2128	movdqu	XMMWORD[16+rcx],xmm3
2129	movdqu	XMMWORD[32+rcx],xmm4
2130	movdqu	XMMWORD[48+rcx],xmm5
2131	movdqu	XMMWORD[64+rcx],xmm6
2132	movdqu	XMMWORD[80+rcx],xmm7
2133	movaps	xmm6,XMMWORD[rsp]
2134	movaps	xmm7,XMMWORD[16+rsp]
2135	movaps	xmm8,XMMWORD[32+rsp]
2136	movaps	xmm9,XMMWORD[48+rsp]
2137	movaps	xmm10,XMMWORD[64+rsp]
2138	movaps	xmm11,XMMWORD[80+rsp]
2139	movaps	xmm12,XMMWORD[96+rsp]
2140	movaps	xmm13,XMMWORD[112+rsp]
2141	movaps	xmm14,XMMWORD[128+rsp]
2142	movaps	xmm15,XMMWORD[144+rsp]
2143	lea	rsp,[168+rsp]
2144	ret
2145
2146$L$SEH_end_ecp_nistz256_select_w5:
2147
2148
2149
2150
2151global	ecp_nistz256_select_w7
2152
2153ALIGN	32
2154ecp_nistz256_select_w7:
2155
2156_CET_ENDBR
2157	lea	rax,[OPENSSL_ia32cap_P]
2158	mov	rax,QWORD[8+rax]
2159	test	eax,32
2160	jnz	NEAR $L$avx2_select_w7
2161	lea	rax,[((-136))+rsp]
2162$L$SEH_begin_ecp_nistz256_select_w7:
2163	DB	0x48,0x8d,0x60,0xe0
2164	DB	0x0f,0x29,0x70,0xe0
2165	DB	0x0f,0x29,0x78,0xf0
2166	DB	0x44,0x0f,0x29,0x00
2167	DB	0x44,0x0f,0x29,0x48,0x10
2168	DB	0x44,0x0f,0x29,0x50,0x20
2169	DB	0x44,0x0f,0x29,0x58,0x30
2170	DB	0x44,0x0f,0x29,0x60,0x40
2171	DB	0x44,0x0f,0x29,0x68,0x50
2172	DB	0x44,0x0f,0x29,0x70,0x60
2173	DB	0x44,0x0f,0x29,0x78,0x70
2174	movdqa	xmm8,XMMWORD[$L$One]
2175	movd	xmm1,r8d
2176
2177	pxor	xmm2,xmm2
2178	pxor	xmm3,xmm3
2179	pxor	xmm4,xmm4
2180	pxor	xmm5,xmm5
2181
2182	movdqa	xmm0,xmm8
2183	pshufd	xmm1,xmm1,0
2184	mov	rax,64
2185
2186$L$select_loop_sse_w7:
2187	movdqa	xmm15,xmm8
2188	paddd	xmm8,xmm0
2189	movdqa	xmm9,XMMWORD[rdx]
2190	movdqa	xmm10,XMMWORD[16+rdx]
2191	pcmpeqd	xmm15,xmm1
2192	movdqa	xmm11,XMMWORD[32+rdx]
2193	movdqa	xmm12,XMMWORD[48+rdx]
2194	lea	rdx,[64+rdx]
2195
2196	pand	xmm9,xmm15
2197	pand	xmm10,xmm15
2198	por	xmm2,xmm9
2199	pand	xmm11,xmm15
2200	por	xmm3,xmm10
2201	pand	xmm12,xmm15
2202	por	xmm4,xmm11
2203	prefetcht0	[255+rdx]
2204	por	xmm5,xmm12
2205
2206	dec	rax
2207	jnz	NEAR $L$select_loop_sse_w7
2208
2209	movdqu	XMMWORD[rcx],xmm2
2210	movdqu	XMMWORD[16+rcx],xmm3
2211	movdqu	XMMWORD[32+rcx],xmm4
2212	movdqu	XMMWORD[48+rcx],xmm5
2213	movaps	xmm6,XMMWORD[rsp]
2214	movaps	xmm7,XMMWORD[16+rsp]
2215	movaps	xmm8,XMMWORD[32+rsp]
2216	movaps	xmm9,XMMWORD[48+rsp]
2217	movaps	xmm10,XMMWORD[64+rsp]
2218	movaps	xmm11,XMMWORD[80+rsp]
2219	movaps	xmm12,XMMWORD[96+rsp]
2220	movaps	xmm13,XMMWORD[112+rsp]
2221	movaps	xmm14,XMMWORD[128+rsp]
2222	movaps	xmm15,XMMWORD[144+rsp]
2223	lea	rsp,[168+rsp]
2224	ret
2225
2226$L$SEH_end_ecp_nistz256_select_w7:
2227
2228
2229
2230
2231ALIGN	32
2232ecp_nistz256_avx2_select_w5:
2233
2234$L$avx2_select_w5:
2235	vzeroupper
2236	lea	rax,[((-136))+rsp]
2237	mov	r11,rsp
2238$L$SEH_begin_ecp_nistz256_avx2_select_w5:
2239	DB	0x48,0x8d,0x60,0xe0
2240	DB	0xc5,0xf8,0x29,0x70,0xe0
2241	DB	0xc5,0xf8,0x29,0x78,0xf0
2242	DB	0xc5,0x78,0x29,0x40,0x00
2243	DB	0xc5,0x78,0x29,0x48,0x10
2244	DB	0xc5,0x78,0x29,0x50,0x20
2245	DB	0xc5,0x78,0x29,0x58,0x30
2246	DB	0xc5,0x78,0x29,0x60,0x40
2247	DB	0xc5,0x78,0x29,0x68,0x50
2248	DB	0xc5,0x78,0x29,0x70,0x60
2249	DB	0xc5,0x78,0x29,0x78,0x70
2250	vmovdqa	ymm0,YMMWORD[$L$Two]
2251
2252	vpxor	ymm2,ymm2,ymm2
2253	vpxor	ymm3,ymm3,ymm3
2254	vpxor	ymm4,ymm4,ymm4
2255
2256	vmovdqa	ymm5,YMMWORD[$L$One]
2257	vmovdqa	ymm10,YMMWORD[$L$Two]
2258
2259	vmovd	xmm1,r8d
2260	vpermd	ymm1,ymm2,ymm1
2261
2262	mov	rax,8
2263$L$select_loop_avx2_w5:
2264
2265	vmovdqa	ymm6,YMMWORD[rdx]
2266	vmovdqa	ymm7,YMMWORD[32+rdx]
2267	vmovdqa	ymm8,YMMWORD[64+rdx]
2268
2269	vmovdqa	ymm11,YMMWORD[96+rdx]
2270	vmovdqa	ymm12,YMMWORD[128+rdx]
2271	vmovdqa	ymm13,YMMWORD[160+rdx]
2272
2273	vpcmpeqd	ymm9,ymm5,ymm1
2274	vpcmpeqd	ymm14,ymm10,ymm1
2275
2276	vpaddd	ymm5,ymm5,ymm0
2277	vpaddd	ymm10,ymm10,ymm0
2278	lea	rdx,[192+rdx]
2279
2280	vpand	ymm6,ymm6,ymm9
2281	vpand	ymm7,ymm7,ymm9
2282	vpand	ymm8,ymm8,ymm9
2283	vpand	ymm11,ymm11,ymm14
2284	vpand	ymm12,ymm12,ymm14
2285	vpand	ymm13,ymm13,ymm14
2286
2287	vpxor	ymm2,ymm2,ymm6
2288	vpxor	ymm3,ymm3,ymm7
2289	vpxor	ymm4,ymm4,ymm8
2290	vpxor	ymm2,ymm2,ymm11
2291	vpxor	ymm3,ymm3,ymm12
2292	vpxor	ymm4,ymm4,ymm13
2293
2294	dec	rax
2295	jnz	NEAR $L$select_loop_avx2_w5
2296
2297	vmovdqu	YMMWORD[rcx],ymm2
2298	vmovdqu	YMMWORD[32+rcx],ymm3
2299	vmovdqu	YMMWORD[64+rcx],ymm4
2300	vzeroupper
2301	movaps	xmm6,XMMWORD[rsp]
2302	movaps	xmm7,XMMWORD[16+rsp]
2303	movaps	xmm8,XMMWORD[32+rsp]
2304	movaps	xmm9,XMMWORD[48+rsp]
2305	movaps	xmm10,XMMWORD[64+rsp]
2306	movaps	xmm11,XMMWORD[80+rsp]
2307	movaps	xmm12,XMMWORD[96+rsp]
2308	movaps	xmm13,XMMWORD[112+rsp]
2309	movaps	xmm14,XMMWORD[128+rsp]
2310	movaps	xmm15,XMMWORD[144+rsp]
2311	lea	rsp,[r11]
2312	ret
2313
2314$L$SEH_end_ecp_nistz256_avx2_select_w5:
2315
2316
2317
2318
2319
2320ALIGN	32
2321ecp_nistz256_avx2_select_w7:
2322
2323$L$avx2_select_w7:
2324_CET_ENDBR
2325	vzeroupper
2326	mov	r11,rsp
2327	lea	rax,[((-136))+rsp]
2328$L$SEH_begin_ecp_nistz256_avx2_select_w7:
2329	DB	0x48,0x8d,0x60,0xe0
2330	DB	0xc5,0xf8,0x29,0x70,0xe0
2331	DB	0xc5,0xf8,0x29,0x78,0xf0
2332	DB	0xc5,0x78,0x29,0x40,0x00
2333	DB	0xc5,0x78,0x29,0x48,0x10
2334	DB	0xc5,0x78,0x29,0x50,0x20
2335	DB	0xc5,0x78,0x29,0x58,0x30
2336	DB	0xc5,0x78,0x29,0x60,0x40
2337	DB	0xc5,0x78,0x29,0x68,0x50
2338	DB	0xc5,0x78,0x29,0x70,0x60
2339	DB	0xc5,0x78,0x29,0x78,0x70
2340	vmovdqa	ymm0,YMMWORD[$L$Three]
2341
2342	vpxor	ymm2,ymm2,ymm2
2343	vpxor	ymm3,ymm3,ymm3
2344
2345	vmovdqa	ymm4,YMMWORD[$L$One]
2346	vmovdqa	ymm8,YMMWORD[$L$Two]
2347	vmovdqa	ymm12,YMMWORD[$L$Three]
2348
2349	vmovd	xmm1,r8d
2350	vpermd	ymm1,ymm2,ymm1
2351
2352
2353	mov	rax,21
2354$L$select_loop_avx2_w7:
2355
2356	vmovdqa	ymm5,YMMWORD[rdx]
2357	vmovdqa	ymm6,YMMWORD[32+rdx]
2358
2359	vmovdqa	ymm9,YMMWORD[64+rdx]
2360	vmovdqa	ymm10,YMMWORD[96+rdx]
2361
2362	vmovdqa	ymm13,YMMWORD[128+rdx]
2363	vmovdqa	ymm14,YMMWORD[160+rdx]
2364
2365	vpcmpeqd	ymm7,ymm4,ymm1
2366	vpcmpeqd	ymm11,ymm8,ymm1
2367	vpcmpeqd	ymm15,ymm12,ymm1
2368
2369	vpaddd	ymm4,ymm4,ymm0
2370	vpaddd	ymm8,ymm8,ymm0
2371	vpaddd	ymm12,ymm12,ymm0
2372	lea	rdx,[192+rdx]
2373
2374	vpand	ymm5,ymm5,ymm7
2375	vpand	ymm6,ymm6,ymm7
2376	vpand	ymm9,ymm9,ymm11
2377	vpand	ymm10,ymm10,ymm11
2378	vpand	ymm13,ymm13,ymm15
2379	vpand	ymm14,ymm14,ymm15
2380
2381	vpxor	ymm2,ymm2,ymm5
2382	vpxor	ymm3,ymm3,ymm6
2383	vpxor	ymm2,ymm2,ymm9
2384	vpxor	ymm3,ymm3,ymm10
2385	vpxor	ymm2,ymm2,ymm13
2386	vpxor	ymm3,ymm3,ymm14
2387
2388	dec	rax
2389	jnz	NEAR $L$select_loop_avx2_w7
2390
2391
2392	vmovdqa	ymm5,YMMWORD[rdx]
2393	vmovdqa	ymm6,YMMWORD[32+rdx]
2394
2395	vpcmpeqd	ymm7,ymm4,ymm1
2396
2397	vpand	ymm5,ymm5,ymm7
2398	vpand	ymm6,ymm6,ymm7
2399
2400	vpxor	ymm2,ymm2,ymm5
2401	vpxor	ymm3,ymm3,ymm6
2402
2403	vmovdqu	YMMWORD[rcx],ymm2
2404	vmovdqu	YMMWORD[32+rcx],ymm3
2405	vzeroupper
2406	movaps	xmm6,XMMWORD[rsp]
2407	movaps	xmm7,XMMWORD[16+rsp]
2408	movaps	xmm8,XMMWORD[32+rsp]
2409	movaps	xmm9,XMMWORD[48+rsp]
2410	movaps	xmm10,XMMWORD[64+rsp]
2411	movaps	xmm11,XMMWORD[80+rsp]
2412	movaps	xmm12,XMMWORD[96+rsp]
2413	movaps	xmm13,XMMWORD[112+rsp]
2414	movaps	xmm14,XMMWORD[128+rsp]
2415	movaps	xmm15,XMMWORD[144+rsp]
2416	lea	rsp,[r11]
2417	ret
2418
2419$L$SEH_end_ecp_nistz256_avx2_select_w7:
2420
2421
2422ALIGN	32
2423__ecp_nistz256_add_toq:
2424
2425	xor	r11,r11
2426	add	r12,QWORD[rbx]
2427	adc	r13,QWORD[8+rbx]
2428	mov	rax,r12
2429	adc	r8,QWORD[16+rbx]
2430	adc	r9,QWORD[24+rbx]
2431	mov	rbp,r13
2432	adc	r11,0
2433
2434	sub	r12,-1
2435	mov	rcx,r8
2436	sbb	r13,r14
2437	sbb	r8,0
2438	mov	r10,r9
2439	sbb	r9,r15
2440	sbb	r11,0
2441
2442	cmovc	r12,rax
2443	cmovc	r13,rbp
2444	mov	QWORD[rdi],r12
2445	cmovc	r8,rcx
2446	mov	QWORD[8+rdi],r13
2447	cmovc	r9,r10
2448	mov	QWORD[16+rdi],r8
2449	mov	QWORD[24+rdi],r9
2450
2451	ret
2452
2453
2454
2455
2456ALIGN	32
2457__ecp_nistz256_sub_fromq:
2458
2459	sub	r12,QWORD[rbx]
2460	sbb	r13,QWORD[8+rbx]
2461	mov	rax,r12
2462	sbb	r8,QWORD[16+rbx]
2463	sbb	r9,QWORD[24+rbx]
2464	mov	rbp,r13
2465	sbb	r11,r11
2466
2467	add	r12,-1
2468	mov	rcx,r8
2469	adc	r13,r14
2470	adc	r8,0
2471	mov	r10,r9
2472	adc	r9,r15
2473	test	r11,r11
2474
2475	cmovz	r12,rax
2476	cmovz	r13,rbp
2477	mov	QWORD[rdi],r12
2478	cmovz	r8,rcx
2479	mov	QWORD[8+rdi],r13
2480	cmovz	r9,r10
2481	mov	QWORD[16+rdi],r8
2482	mov	QWORD[24+rdi],r9
2483
2484	ret
2485
2486
2487
2488
2489ALIGN	32
2490__ecp_nistz256_subq:
2491
2492	sub	rax,r12
2493	sbb	rbp,r13
2494	mov	r12,rax
2495	sbb	rcx,r8
2496	sbb	r10,r9
2497	mov	r13,rbp
2498	sbb	r11,r11
2499
2500	add	rax,-1
2501	mov	r8,rcx
2502	adc	rbp,r14
2503	adc	rcx,0
2504	mov	r9,r10
2505	adc	r10,r15
2506	test	r11,r11
2507
2508	cmovnz	r12,rax
2509	cmovnz	r13,rbp
2510	cmovnz	r8,rcx
2511	cmovnz	r9,r10
2512
2513	ret
2514
2515
2516
2517
2518ALIGN	32
2519__ecp_nistz256_mul_by_2q:
2520
2521	xor	r11,r11
2522	add	r12,r12
2523	adc	r13,r13
2524	mov	rax,r12
2525	adc	r8,r8
2526	adc	r9,r9
2527	mov	rbp,r13
2528	adc	r11,0
2529
2530	sub	r12,-1
2531	mov	rcx,r8
2532	sbb	r13,r14
2533	sbb	r8,0
2534	mov	r10,r9
2535	sbb	r9,r15
2536	sbb	r11,0
2537
2538	cmovc	r12,rax
2539	cmovc	r13,rbp
2540	mov	QWORD[rdi],r12
2541	cmovc	r8,rcx
2542	mov	QWORD[8+rdi],r13
2543	cmovc	r9,r10
2544	mov	QWORD[16+rdi],r8
2545	mov	QWORD[24+rdi],r9
2546
2547	ret
2548
2549
2550global	ecp_nistz256_point_double
2551
2552ALIGN	32
2553ecp_nistz256_point_double:
2554	mov	QWORD[8+rsp],rdi	;WIN64 prologue
2555	mov	QWORD[16+rsp],rsi
2556	mov	rax,rsp
2557$L$SEH_begin_ecp_nistz256_point_double:
2558	mov	rdi,rcx
2559	mov	rsi,rdx
2560
2561
2562
2563_CET_ENDBR
2564	lea	rcx,[OPENSSL_ia32cap_P]
2565	mov	rcx,QWORD[8+rcx]
2566	and	ecx,0x80100
2567	cmp	ecx,0x80100
2568	je	NEAR $L$point_doublex
2569	push	rbp
2570
2571	push	rbx
2572
2573	push	r12
2574
2575	push	r13
2576
2577	push	r14
2578
2579	push	r15
2580
2581	sub	rsp,32*5+8
2582
2583$L$point_doubleq_body:
2584
2585$L$point_double_shortcutq:
2586	movdqu	xmm0,XMMWORD[rsi]
2587	mov	rbx,rsi
2588	movdqu	xmm1,XMMWORD[16+rsi]
2589	mov	r12,QWORD[((32+0))+rsi]
2590	mov	r13,QWORD[((32+8))+rsi]
2591	mov	r8,QWORD[((32+16))+rsi]
2592	mov	r9,QWORD[((32+24))+rsi]
2593	mov	r14,QWORD[(($L$poly+8))]
2594	mov	r15,QWORD[(($L$poly+24))]
2595	movdqa	XMMWORD[96+rsp],xmm0
2596	movdqa	XMMWORD[(96+16)+rsp],xmm1
2597	lea	r10,[32+rdi]
2598	lea	r11,[64+rdi]
2599DB	102,72,15,110,199
2600DB	102,73,15,110,202
2601DB	102,73,15,110,211
2602
2603	lea	rdi,[rsp]
2604	call	__ecp_nistz256_mul_by_2q
2605
2606	mov	rax,QWORD[((64+0))+rsi]
2607	mov	r14,QWORD[((64+8))+rsi]
2608	mov	r15,QWORD[((64+16))+rsi]
2609	mov	r8,QWORD[((64+24))+rsi]
2610	lea	rsi,[((64-0))+rsi]
2611	lea	rdi,[64+rsp]
2612	call	__ecp_nistz256_sqr_montq
2613
2614	mov	rax,QWORD[((0+0))+rsp]
2615	mov	r14,QWORD[((8+0))+rsp]
2616	lea	rsi,[((0+0))+rsp]
2617	mov	r15,QWORD[((16+0))+rsp]
2618	mov	r8,QWORD[((24+0))+rsp]
2619	lea	rdi,[rsp]
2620	call	__ecp_nistz256_sqr_montq
2621
2622	mov	rax,QWORD[32+rbx]
2623	mov	r9,QWORD[((64+0))+rbx]
2624	mov	r10,QWORD[((64+8))+rbx]
2625	mov	r11,QWORD[((64+16))+rbx]
2626	mov	r12,QWORD[((64+24))+rbx]
2627	lea	rsi,[((64-0))+rbx]
2628	lea	rbx,[32+rbx]
2629DB	102,72,15,126,215
2630	call	__ecp_nistz256_mul_montq
2631	call	__ecp_nistz256_mul_by_2q
2632
2633	mov	r12,QWORD[((96+0))+rsp]
2634	mov	r13,QWORD[((96+8))+rsp]
2635	lea	rbx,[64+rsp]
2636	mov	r8,QWORD[((96+16))+rsp]
2637	mov	r9,QWORD[((96+24))+rsp]
2638	lea	rdi,[32+rsp]
2639	call	__ecp_nistz256_add_toq
2640
2641	mov	r12,QWORD[((96+0))+rsp]
2642	mov	r13,QWORD[((96+8))+rsp]
2643	lea	rbx,[64+rsp]
2644	mov	r8,QWORD[((96+16))+rsp]
2645	mov	r9,QWORD[((96+24))+rsp]
2646	lea	rdi,[64+rsp]
2647	call	__ecp_nistz256_sub_fromq
2648
2649	mov	rax,QWORD[((0+0))+rsp]
2650	mov	r14,QWORD[((8+0))+rsp]
2651	lea	rsi,[((0+0))+rsp]
2652	mov	r15,QWORD[((16+0))+rsp]
2653	mov	r8,QWORD[((24+0))+rsp]
2654DB	102,72,15,126,207
2655	call	__ecp_nistz256_sqr_montq
2656	xor	r9,r9
2657	mov	rax,r12
2658	add	r12,-1
2659	mov	r10,r13
2660	adc	r13,rsi
2661	mov	rcx,r14
2662	adc	r14,0
2663	mov	r8,r15
2664	adc	r15,rbp
2665	adc	r9,0
2666	xor	rsi,rsi
2667	test	rax,1
2668
2669	cmovz	r12,rax
2670	cmovz	r13,r10
2671	cmovz	r14,rcx
2672	cmovz	r15,r8
2673	cmovz	r9,rsi
2674
2675	mov	rax,r13
2676	shr	r12,1
2677	shl	rax,63
2678	mov	r10,r14
2679	shr	r13,1
2680	or	r12,rax
2681	shl	r10,63
2682	mov	rcx,r15
2683	shr	r14,1
2684	or	r13,r10
2685	shl	rcx,63
2686	mov	QWORD[rdi],r12
2687	shr	r15,1
2688	mov	QWORD[8+rdi],r13
2689	shl	r9,63
2690	or	r14,rcx
2691	or	r15,r9
2692	mov	QWORD[16+rdi],r14
2693	mov	QWORD[24+rdi],r15
2694	mov	rax,QWORD[64+rsp]
2695	lea	rbx,[64+rsp]
2696	mov	r9,QWORD[((0+32))+rsp]
2697	mov	r10,QWORD[((8+32))+rsp]
2698	lea	rsi,[((0+32))+rsp]
2699	mov	r11,QWORD[((16+32))+rsp]
2700	mov	r12,QWORD[((24+32))+rsp]
2701	lea	rdi,[32+rsp]
2702	call	__ecp_nistz256_mul_montq
2703
2704	lea	rdi,[128+rsp]
2705	call	__ecp_nistz256_mul_by_2q
2706
2707	lea	rbx,[32+rsp]
2708	lea	rdi,[32+rsp]
2709	call	__ecp_nistz256_add_toq
2710
2711	mov	rax,QWORD[96+rsp]
2712	lea	rbx,[96+rsp]
2713	mov	r9,QWORD[((0+0))+rsp]
2714	mov	r10,QWORD[((8+0))+rsp]
2715	lea	rsi,[((0+0))+rsp]
2716	mov	r11,QWORD[((16+0))+rsp]
2717	mov	r12,QWORD[((24+0))+rsp]
2718	lea	rdi,[rsp]
2719	call	__ecp_nistz256_mul_montq
2720
2721	lea	rdi,[128+rsp]
2722	call	__ecp_nistz256_mul_by_2q
2723
2724	mov	rax,QWORD[((0+32))+rsp]
2725	mov	r14,QWORD[((8+32))+rsp]
2726	lea	rsi,[((0+32))+rsp]
2727	mov	r15,QWORD[((16+32))+rsp]
2728	mov	r8,QWORD[((24+32))+rsp]
2729DB	102,72,15,126,199
2730	call	__ecp_nistz256_sqr_montq
2731
2732	lea	rbx,[128+rsp]
2733	mov	r8,r14
2734	mov	r9,r15
2735	mov	r14,rsi
2736	mov	r15,rbp
2737	call	__ecp_nistz256_sub_fromq
2738
2739	mov	rax,QWORD[((0+0))+rsp]
2740	mov	rbp,QWORD[((0+8))+rsp]
2741	mov	rcx,QWORD[((0+16))+rsp]
2742	mov	r10,QWORD[((0+24))+rsp]
2743	lea	rdi,[rsp]
2744	call	__ecp_nistz256_subq
2745
2746	mov	rax,QWORD[32+rsp]
2747	lea	rbx,[32+rsp]
2748	mov	r14,r12
2749	xor	ecx,ecx
2750	mov	QWORD[((0+0))+rsp],r12
2751	mov	r10,r13
2752	mov	QWORD[((0+8))+rsp],r13
2753	cmovz	r11,r8
2754	mov	QWORD[((0+16))+rsp],r8
2755	lea	rsi,[((0-0))+rsp]
2756	cmovz	r12,r9
2757	mov	QWORD[((0+24))+rsp],r9
2758	mov	r9,r14
2759	lea	rdi,[rsp]
2760	call	__ecp_nistz256_mul_montq
2761
2762DB	102,72,15,126,203
2763DB	102,72,15,126,207
2764	call	__ecp_nistz256_sub_fromq
2765
2766	lea	rsi,[((160+56))+rsp]
2767
2768	mov	r15,QWORD[((-48))+rsi]
2769
2770	mov	r14,QWORD[((-40))+rsi]
2771
2772	mov	r13,QWORD[((-32))+rsi]
2773
2774	mov	r12,QWORD[((-24))+rsi]
2775
2776	mov	rbx,QWORD[((-16))+rsi]
2777
2778	mov	rbp,QWORD[((-8))+rsi]
2779
2780	lea	rsp,[rsi]
2781
2782$L$point_doubleq_epilogue:
2783	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
2784	mov	rsi,QWORD[16+rsp]
2785	ret
2786
2787$L$SEH_end_ecp_nistz256_point_double:
2788global	ecp_nistz256_point_add
2789
2790ALIGN	32
2791ecp_nistz256_point_add:
2792	mov	QWORD[8+rsp],rdi	;WIN64 prologue
2793	mov	QWORD[16+rsp],rsi
2794	mov	rax,rsp
2795$L$SEH_begin_ecp_nistz256_point_add:
2796	mov	rdi,rcx
2797	mov	rsi,rdx
2798	mov	rdx,r8
2799
2800
2801
2802_CET_ENDBR
2803	lea	rcx,[OPENSSL_ia32cap_P]
2804	mov	rcx,QWORD[8+rcx]
2805	and	ecx,0x80100
2806	cmp	ecx,0x80100
2807	je	NEAR $L$point_addx
2808	push	rbp
2809
2810	push	rbx
2811
2812	push	r12
2813
2814	push	r13
2815
2816	push	r14
2817
2818	push	r15
2819
2820	sub	rsp,32*18+8
2821
2822$L$point_addq_body:
2823
2824	movdqu	xmm0,XMMWORD[rsi]
2825	movdqu	xmm1,XMMWORD[16+rsi]
2826	movdqu	xmm2,XMMWORD[32+rsi]
2827	movdqu	xmm3,XMMWORD[48+rsi]
2828	movdqu	xmm4,XMMWORD[64+rsi]
2829	movdqu	xmm5,XMMWORD[80+rsi]
2830	mov	rbx,rsi
2831	mov	rsi,rdx
2832	movdqa	XMMWORD[384+rsp],xmm0
2833	movdqa	XMMWORD[(384+16)+rsp],xmm1
2834	movdqa	XMMWORD[416+rsp],xmm2
2835	movdqa	XMMWORD[(416+16)+rsp],xmm3
2836	movdqa	XMMWORD[448+rsp],xmm4
2837	movdqa	XMMWORD[(448+16)+rsp],xmm5
2838	por	xmm5,xmm4
2839
2840	movdqu	xmm0,XMMWORD[rsi]
2841	pshufd	xmm3,xmm5,0xb1
2842	movdqu	xmm1,XMMWORD[16+rsi]
2843	movdqu	xmm2,XMMWORD[32+rsi]
2844	por	xmm5,xmm3
2845	movdqu	xmm3,XMMWORD[48+rsi]
2846	mov	rax,QWORD[((64+0))+rsi]
2847	mov	r14,QWORD[((64+8))+rsi]
2848	mov	r15,QWORD[((64+16))+rsi]
2849	mov	r8,QWORD[((64+24))+rsi]
2850	movdqa	XMMWORD[480+rsp],xmm0
2851	pshufd	xmm4,xmm5,0x1e
2852	movdqa	XMMWORD[(480+16)+rsp],xmm1
2853	movdqu	xmm0,XMMWORD[64+rsi]
2854	movdqu	xmm1,XMMWORD[80+rsi]
2855	movdqa	XMMWORD[512+rsp],xmm2
2856	movdqa	XMMWORD[(512+16)+rsp],xmm3
2857	por	xmm5,xmm4
2858	pxor	xmm4,xmm4
2859	por	xmm1,xmm0
2860DB	102,72,15,110,199
2861
2862	lea	rsi,[((64-0))+rsi]
2863	mov	QWORD[((544+0))+rsp],rax
2864	mov	QWORD[((544+8))+rsp],r14
2865	mov	QWORD[((544+16))+rsp],r15
2866	mov	QWORD[((544+24))+rsp],r8
2867	lea	rdi,[96+rsp]
2868	call	__ecp_nistz256_sqr_montq
2869
2870	pcmpeqd	xmm5,xmm4
2871	pshufd	xmm4,xmm1,0xb1
2872	por	xmm4,xmm1
2873	pshufd	xmm5,xmm5,0
2874	pshufd	xmm3,xmm4,0x1e
2875	por	xmm4,xmm3
2876	pxor	xmm3,xmm3
2877	pcmpeqd	xmm4,xmm3
2878	pshufd	xmm4,xmm4,0
2879	mov	rax,QWORD[((64+0))+rbx]
2880	mov	r14,QWORD[((64+8))+rbx]
2881	mov	r15,QWORD[((64+16))+rbx]
2882	mov	r8,QWORD[((64+24))+rbx]
2883DB	102,72,15,110,203
2884
2885	lea	rsi,[((64-0))+rbx]
2886	lea	rdi,[32+rsp]
2887	call	__ecp_nistz256_sqr_montq
2888
2889	mov	rax,QWORD[544+rsp]
2890	lea	rbx,[544+rsp]
2891	mov	r9,QWORD[((0+96))+rsp]
2892	mov	r10,QWORD[((8+96))+rsp]
2893	lea	rsi,[((0+96))+rsp]
2894	mov	r11,QWORD[((16+96))+rsp]
2895	mov	r12,QWORD[((24+96))+rsp]
2896	lea	rdi,[224+rsp]
2897	call	__ecp_nistz256_mul_montq
2898
2899	mov	rax,QWORD[448+rsp]
2900	lea	rbx,[448+rsp]
2901	mov	r9,QWORD[((0+32))+rsp]
2902	mov	r10,QWORD[((8+32))+rsp]
2903	lea	rsi,[((0+32))+rsp]
2904	mov	r11,QWORD[((16+32))+rsp]
2905	mov	r12,QWORD[((24+32))+rsp]
2906	lea	rdi,[256+rsp]
2907	call	__ecp_nistz256_mul_montq
2908
2909	mov	rax,QWORD[416+rsp]
2910	lea	rbx,[416+rsp]
2911	mov	r9,QWORD[((0+224))+rsp]
2912	mov	r10,QWORD[((8+224))+rsp]
2913	lea	rsi,[((0+224))+rsp]
2914	mov	r11,QWORD[((16+224))+rsp]
2915	mov	r12,QWORD[((24+224))+rsp]
2916	lea	rdi,[224+rsp]
2917	call	__ecp_nistz256_mul_montq
2918
2919	mov	rax,QWORD[512+rsp]
2920	lea	rbx,[512+rsp]
2921	mov	r9,QWORD[((0+256))+rsp]
2922	mov	r10,QWORD[((8+256))+rsp]
2923	lea	rsi,[((0+256))+rsp]
2924	mov	r11,QWORD[((16+256))+rsp]
2925	mov	r12,QWORD[((24+256))+rsp]
2926	lea	rdi,[256+rsp]
2927	call	__ecp_nistz256_mul_montq
2928
2929	lea	rbx,[224+rsp]
2930	lea	rdi,[64+rsp]
2931	call	__ecp_nistz256_sub_fromq
2932
2933	or	r12,r13
2934	movdqa	xmm2,xmm4
2935	or	r12,r8
2936	or	r12,r9
2937	por	xmm2,xmm5
2938DB	102,73,15,110,220
2939
2940	mov	rax,QWORD[384+rsp]
2941	lea	rbx,[384+rsp]
2942	mov	r9,QWORD[((0+96))+rsp]
2943	mov	r10,QWORD[((8+96))+rsp]
2944	lea	rsi,[((0+96))+rsp]
2945	mov	r11,QWORD[((16+96))+rsp]
2946	mov	r12,QWORD[((24+96))+rsp]
2947	lea	rdi,[160+rsp]
2948	call	__ecp_nistz256_mul_montq
2949
2950	mov	rax,QWORD[480+rsp]
2951	lea	rbx,[480+rsp]
2952	mov	r9,QWORD[((0+32))+rsp]
2953	mov	r10,QWORD[((8+32))+rsp]
2954	lea	rsi,[((0+32))+rsp]
2955	mov	r11,QWORD[((16+32))+rsp]
2956	mov	r12,QWORD[((24+32))+rsp]
2957	lea	rdi,[192+rsp]
2958	call	__ecp_nistz256_mul_montq
2959
2960	lea	rbx,[160+rsp]
2961	lea	rdi,[rsp]
2962	call	__ecp_nistz256_sub_fromq
2963
2964	or	r12,r13
2965	or	r12,r8
2966	or	r12,r9
2967
2968DB	102,73,15,126,208
2969DB	102,73,15,126,217
2970	or	r12,r8
2971	DB	0x3e
2972	jnz	NEAR $L$add_proceedq
2973
2974
2975
2976	test	r9,r9
2977	jz	NEAR $L$add_doubleq
2978
2979
2980
2981
2982
2983
2984DB	102,72,15,126,199
2985	pxor	xmm0,xmm0
2986	movdqu	XMMWORD[rdi],xmm0
2987	movdqu	XMMWORD[16+rdi],xmm0
2988	movdqu	XMMWORD[32+rdi],xmm0
2989	movdqu	XMMWORD[48+rdi],xmm0
2990	movdqu	XMMWORD[64+rdi],xmm0
2991	movdqu	XMMWORD[80+rdi],xmm0
2992	jmp	NEAR $L$add_doneq
2993
2994ALIGN	32
2995$L$add_doubleq:
2996DB	102,72,15,126,206
2997DB	102,72,15,126,199
2998	add	rsp,416
2999
3000	jmp	NEAR $L$point_double_shortcutq
3001
3002
3003ALIGN	32
3004$L$add_proceedq:
3005	mov	rax,QWORD[((0+64))+rsp]
3006	mov	r14,QWORD[((8+64))+rsp]
3007	lea	rsi,[((0+64))+rsp]
3008	mov	r15,QWORD[((16+64))+rsp]
3009	mov	r8,QWORD[((24+64))+rsp]
3010	lea	rdi,[96+rsp]
3011	call	__ecp_nistz256_sqr_montq
3012
3013	mov	rax,QWORD[448+rsp]
3014	lea	rbx,[448+rsp]
3015	mov	r9,QWORD[((0+0))+rsp]
3016	mov	r10,QWORD[((8+0))+rsp]
3017	lea	rsi,[((0+0))+rsp]
3018	mov	r11,QWORD[((16+0))+rsp]
3019	mov	r12,QWORD[((24+0))+rsp]
3020	lea	rdi,[352+rsp]
3021	call	__ecp_nistz256_mul_montq
3022
3023	mov	rax,QWORD[((0+0))+rsp]
3024	mov	r14,QWORD[((8+0))+rsp]
3025	lea	rsi,[((0+0))+rsp]
3026	mov	r15,QWORD[((16+0))+rsp]
3027	mov	r8,QWORD[((24+0))+rsp]
3028	lea	rdi,[32+rsp]
3029	call	__ecp_nistz256_sqr_montq
3030
3031	mov	rax,QWORD[544+rsp]
3032	lea	rbx,[544+rsp]
3033	mov	r9,QWORD[((0+352))+rsp]
3034	mov	r10,QWORD[((8+352))+rsp]
3035	lea	rsi,[((0+352))+rsp]
3036	mov	r11,QWORD[((16+352))+rsp]
3037	mov	r12,QWORD[((24+352))+rsp]
3038	lea	rdi,[352+rsp]
3039	call	__ecp_nistz256_mul_montq
3040
3041	mov	rax,QWORD[rsp]
3042	lea	rbx,[rsp]
3043	mov	r9,QWORD[((0+32))+rsp]
3044	mov	r10,QWORD[((8+32))+rsp]
3045	lea	rsi,[((0+32))+rsp]
3046	mov	r11,QWORD[((16+32))+rsp]
3047	mov	r12,QWORD[((24+32))+rsp]
3048	lea	rdi,[128+rsp]
3049	call	__ecp_nistz256_mul_montq
3050
3051	mov	rax,QWORD[160+rsp]
3052	lea	rbx,[160+rsp]
3053	mov	r9,QWORD[((0+32))+rsp]
3054	mov	r10,QWORD[((8+32))+rsp]
3055	lea	rsi,[((0+32))+rsp]
3056	mov	r11,QWORD[((16+32))+rsp]
3057	mov	r12,QWORD[((24+32))+rsp]
3058	lea	rdi,[192+rsp]
3059	call	__ecp_nistz256_mul_montq
3060
3061
3062
3063
3064	xor	r11,r11
3065	add	r12,r12
3066	lea	rsi,[96+rsp]
3067	adc	r13,r13
3068	mov	rax,r12
3069	adc	r8,r8
3070	adc	r9,r9
3071	mov	rbp,r13
3072	adc	r11,0
3073
3074	sub	r12,-1
3075	mov	rcx,r8
3076	sbb	r13,r14
3077	sbb	r8,0
3078	mov	r10,r9
3079	sbb	r9,r15
3080	sbb	r11,0
3081
3082	cmovc	r12,rax
3083	mov	rax,QWORD[rsi]
3084	cmovc	r13,rbp
3085	mov	rbp,QWORD[8+rsi]
3086	cmovc	r8,rcx
3087	mov	rcx,QWORD[16+rsi]
3088	cmovc	r9,r10
3089	mov	r10,QWORD[24+rsi]
3090
3091	call	__ecp_nistz256_subq
3092
3093	lea	rbx,[128+rsp]
3094	lea	rdi,[288+rsp]
3095	call	__ecp_nistz256_sub_fromq
3096
3097	mov	rax,QWORD[((192+0))+rsp]
3098	mov	rbp,QWORD[((192+8))+rsp]
3099	mov	rcx,QWORD[((192+16))+rsp]
3100	mov	r10,QWORD[((192+24))+rsp]
3101	lea	rdi,[320+rsp]
3102
3103	call	__ecp_nistz256_subq
3104
3105	mov	QWORD[rdi],r12
3106	mov	QWORD[8+rdi],r13
3107	mov	QWORD[16+rdi],r8
3108	mov	QWORD[24+rdi],r9
3109	mov	rax,QWORD[128+rsp]
3110	lea	rbx,[128+rsp]
3111	mov	r9,QWORD[((0+224))+rsp]
3112	mov	r10,QWORD[((8+224))+rsp]
3113	lea	rsi,[((0+224))+rsp]
3114	mov	r11,QWORD[((16+224))+rsp]
3115	mov	r12,QWORD[((24+224))+rsp]
3116	lea	rdi,[256+rsp]
3117	call	__ecp_nistz256_mul_montq
3118
3119	mov	rax,QWORD[320+rsp]
3120	lea	rbx,[320+rsp]
3121	mov	r9,QWORD[((0+64))+rsp]
3122	mov	r10,QWORD[((8+64))+rsp]
3123	lea	rsi,[((0+64))+rsp]
3124	mov	r11,QWORD[((16+64))+rsp]
3125	mov	r12,QWORD[((24+64))+rsp]
3126	lea	rdi,[320+rsp]
3127	call	__ecp_nistz256_mul_montq
3128
3129	lea	rbx,[256+rsp]
3130	lea	rdi,[320+rsp]
3131	call	__ecp_nistz256_sub_fromq
3132
3133DB	102,72,15,126,199
3134
3135	movdqa	xmm0,xmm5
3136	movdqa	xmm1,xmm5
3137	pandn	xmm0,XMMWORD[352+rsp]
3138	movdqa	xmm2,xmm5
3139	pandn	xmm1,XMMWORD[((352+16))+rsp]
3140	movdqa	xmm3,xmm5
3141	pand	xmm2,XMMWORD[544+rsp]
3142	pand	xmm3,XMMWORD[((544+16))+rsp]
3143	por	xmm2,xmm0
3144	por	xmm3,xmm1
3145
3146	movdqa	xmm0,xmm4
3147	movdqa	xmm1,xmm4
3148	pandn	xmm0,xmm2
3149	movdqa	xmm2,xmm4
3150	pandn	xmm1,xmm3
3151	movdqa	xmm3,xmm4
3152	pand	xmm2,XMMWORD[448+rsp]
3153	pand	xmm3,XMMWORD[((448+16))+rsp]
3154	por	xmm2,xmm0
3155	por	xmm3,xmm1
3156	movdqu	XMMWORD[64+rdi],xmm2
3157	movdqu	XMMWORD[80+rdi],xmm3
3158
3159	movdqa	xmm0,xmm5
3160	movdqa	xmm1,xmm5
3161	pandn	xmm0,XMMWORD[288+rsp]
3162	movdqa	xmm2,xmm5
3163	pandn	xmm1,XMMWORD[((288+16))+rsp]
3164	movdqa	xmm3,xmm5
3165	pand	xmm2,XMMWORD[480+rsp]
3166	pand	xmm3,XMMWORD[((480+16))+rsp]
3167	por	xmm2,xmm0
3168	por	xmm3,xmm1
3169
3170	movdqa	xmm0,xmm4
3171	movdqa	xmm1,xmm4
3172	pandn	xmm0,xmm2
3173	movdqa	xmm2,xmm4
3174	pandn	xmm1,xmm3
3175	movdqa	xmm3,xmm4
3176	pand	xmm2,XMMWORD[384+rsp]
3177	pand	xmm3,XMMWORD[((384+16))+rsp]
3178	por	xmm2,xmm0
3179	por	xmm3,xmm1
3180	movdqu	XMMWORD[rdi],xmm2
3181	movdqu	XMMWORD[16+rdi],xmm3
3182
3183	movdqa	xmm0,xmm5
3184	movdqa	xmm1,xmm5
3185	pandn	xmm0,XMMWORD[320+rsp]
3186	movdqa	xmm2,xmm5
3187	pandn	xmm1,XMMWORD[((320+16))+rsp]
3188	movdqa	xmm3,xmm5
3189	pand	xmm2,XMMWORD[512+rsp]
3190	pand	xmm3,XMMWORD[((512+16))+rsp]
3191	por	xmm2,xmm0
3192	por	xmm3,xmm1
3193
3194	movdqa	xmm0,xmm4
3195	movdqa	xmm1,xmm4
3196	pandn	xmm0,xmm2
3197	movdqa	xmm2,xmm4
3198	pandn	xmm1,xmm3
3199	movdqa	xmm3,xmm4
3200	pand	xmm2,XMMWORD[416+rsp]
3201	pand	xmm3,XMMWORD[((416+16))+rsp]
3202	por	xmm2,xmm0
3203	por	xmm3,xmm1
3204	movdqu	XMMWORD[32+rdi],xmm2
3205	movdqu	XMMWORD[48+rdi],xmm3
3206
3207$L$add_doneq:
3208	lea	rsi,[((576+56))+rsp]
3209
3210	mov	r15,QWORD[((-48))+rsi]
3211
3212	mov	r14,QWORD[((-40))+rsi]
3213
3214	mov	r13,QWORD[((-32))+rsi]
3215
3216	mov	r12,QWORD[((-24))+rsi]
3217
3218	mov	rbx,QWORD[((-16))+rsi]
3219
3220	mov	rbp,QWORD[((-8))+rsi]
3221
3222	lea	rsp,[rsi]
3223
3224$L$point_addq_epilogue:
3225	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
3226	mov	rsi,QWORD[16+rsp]
3227	ret
3228
3229$L$SEH_end_ecp_nistz256_point_add:
3230global	ecp_nistz256_point_add_affine
3231
3232ALIGN	32
3233ecp_nistz256_point_add_affine:
3234	mov	QWORD[8+rsp],rdi	;WIN64 prologue
3235	mov	QWORD[16+rsp],rsi
3236	mov	rax,rsp
3237$L$SEH_begin_ecp_nistz256_point_add_affine:
3238	mov	rdi,rcx
3239	mov	rsi,rdx
3240	mov	rdx,r8
3241
3242
3243
3244_CET_ENDBR
3245	lea	rcx,[OPENSSL_ia32cap_P]
3246	mov	rcx,QWORD[8+rcx]
3247	and	ecx,0x80100
3248	cmp	ecx,0x80100
3249	je	NEAR $L$point_add_affinex
3250	push	rbp
3251
3252	push	rbx
3253
3254	push	r12
3255
3256	push	r13
3257
3258	push	r14
3259
3260	push	r15
3261
3262	sub	rsp,32*15+8
3263
3264$L$add_affineq_body:
3265
3266	movdqu	xmm0,XMMWORD[rsi]
3267	mov	rbx,rdx
3268	movdqu	xmm1,XMMWORD[16+rsi]
3269	movdqu	xmm2,XMMWORD[32+rsi]
3270	movdqu	xmm3,XMMWORD[48+rsi]
3271	movdqu	xmm4,XMMWORD[64+rsi]
3272	movdqu	xmm5,XMMWORD[80+rsi]
3273	mov	rax,QWORD[((64+0))+rsi]
3274	mov	r14,QWORD[((64+8))+rsi]
3275	mov	r15,QWORD[((64+16))+rsi]
3276	mov	r8,QWORD[((64+24))+rsi]
3277	movdqa	XMMWORD[320+rsp],xmm0
3278	movdqa	XMMWORD[(320+16)+rsp],xmm1
3279	movdqa	XMMWORD[352+rsp],xmm2
3280	movdqa	XMMWORD[(352+16)+rsp],xmm3
3281	movdqa	XMMWORD[384+rsp],xmm4
3282	movdqa	XMMWORD[(384+16)+rsp],xmm5
3283	por	xmm5,xmm4
3284
3285	movdqu	xmm0,XMMWORD[rbx]
3286	pshufd	xmm3,xmm5,0xb1
3287	movdqu	xmm1,XMMWORD[16+rbx]
3288	movdqu	xmm2,XMMWORD[32+rbx]
3289	por	xmm5,xmm3
3290	movdqu	xmm3,XMMWORD[48+rbx]
3291	movdqa	XMMWORD[416+rsp],xmm0
3292	pshufd	xmm4,xmm5,0x1e
3293	movdqa	XMMWORD[(416+16)+rsp],xmm1
3294	por	xmm1,xmm0
3295DB	102,72,15,110,199
3296	movdqa	XMMWORD[448+rsp],xmm2
3297	movdqa	XMMWORD[(448+16)+rsp],xmm3
3298	por	xmm3,xmm2
3299	por	xmm5,xmm4
3300	pxor	xmm4,xmm4
3301	por	xmm3,xmm1
3302
3303	lea	rsi,[((64-0))+rsi]
3304	lea	rdi,[32+rsp]
3305	call	__ecp_nistz256_sqr_montq
3306
3307	pcmpeqd	xmm5,xmm4
3308	pshufd	xmm4,xmm3,0xb1
3309	mov	rax,QWORD[rbx]
3310
3311	mov	r9,r12
3312	por	xmm4,xmm3
3313	pshufd	xmm5,xmm5,0
3314	pshufd	xmm3,xmm4,0x1e
3315	mov	r10,r13
3316	por	xmm4,xmm3
3317	pxor	xmm3,xmm3
3318	mov	r11,r14
3319	pcmpeqd	xmm4,xmm3
3320	pshufd	xmm4,xmm4,0
3321
3322	lea	rsi,[((32-0))+rsp]
3323	mov	r12,r15
3324	lea	rdi,[rsp]
3325	call	__ecp_nistz256_mul_montq
3326
3327	lea	rbx,[320+rsp]
3328	lea	rdi,[64+rsp]
3329	call	__ecp_nistz256_sub_fromq
3330
3331	mov	rax,QWORD[384+rsp]
3332	lea	rbx,[384+rsp]
3333	mov	r9,QWORD[((0+32))+rsp]
3334	mov	r10,QWORD[((8+32))+rsp]
3335	lea	rsi,[((0+32))+rsp]
3336	mov	r11,QWORD[((16+32))+rsp]
3337	mov	r12,QWORD[((24+32))+rsp]
3338	lea	rdi,[32+rsp]
3339	call	__ecp_nistz256_mul_montq
3340
3341	mov	rax,QWORD[384+rsp]
3342	lea	rbx,[384+rsp]
3343	mov	r9,QWORD[((0+64))+rsp]
3344	mov	r10,QWORD[((8+64))+rsp]
3345	lea	rsi,[((0+64))+rsp]
3346	mov	r11,QWORD[((16+64))+rsp]
3347	mov	r12,QWORD[((24+64))+rsp]
3348	lea	rdi,[288+rsp]
3349	call	__ecp_nistz256_mul_montq
3350
3351	mov	rax,QWORD[448+rsp]
3352	lea	rbx,[448+rsp]
3353	mov	r9,QWORD[((0+32))+rsp]
3354	mov	r10,QWORD[((8+32))+rsp]
3355	lea	rsi,[((0+32))+rsp]
3356	mov	r11,QWORD[((16+32))+rsp]
3357	mov	r12,QWORD[((24+32))+rsp]
3358	lea	rdi,[32+rsp]
3359	call	__ecp_nistz256_mul_montq
3360
3361	lea	rbx,[352+rsp]
3362	lea	rdi,[96+rsp]
3363	call	__ecp_nistz256_sub_fromq
3364
3365	mov	rax,QWORD[((0+64))+rsp]
3366	mov	r14,QWORD[((8+64))+rsp]
3367	lea	rsi,[((0+64))+rsp]
3368	mov	r15,QWORD[((16+64))+rsp]
3369	mov	r8,QWORD[((24+64))+rsp]
3370	lea	rdi,[128+rsp]
3371	call	__ecp_nistz256_sqr_montq
3372
3373	mov	rax,QWORD[((0+96))+rsp]
3374	mov	r14,QWORD[((8+96))+rsp]
3375	lea	rsi,[((0+96))+rsp]
3376	mov	r15,QWORD[((16+96))+rsp]
3377	mov	r8,QWORD[((24+96))+rsp]
3378	lea	rdi,[192+rsp]
3379	call	__ecp_nistz256_sqr_montq
3380
3381	mov	rax,QWORD[128+rsp]
3382	lea	rbx,[128+rsp]
3383	mov	r9,QWORD[((0+64))+rsp]
3384	mov	r10,QWORD[((8+64))+rsp]
3385	lea	rsi,[((0+64))+rsp]
3386	mov	r11,QWORD[((16+64))+rsp]
3387	mov	r12,QWORD[((24+64))+rsp]
3388	lea	rdi,[160+rsp]
3389	call	__ecp_nistz256_mul_montq
3390
3391	mov	rax,QWORD[320+rsp]
3392	lea	rbx,[320+rsp]
3393	mov	r9,QWORD[((0+128))+rsp]
3394	mov	r10,QWORD[((8+128))+rsp]
3395	lea	rsi,[((0+128))+rsp]
3396	mov	r11,QWORD[((16+128))+rsp]
3397	mov	r12,QWORD[((24+128))+rsp]
3398	lea	rdi,[rsp]
3399	call	__ecp_nistz256_mul_montq
3400
3401
3402
3403
3404	xor	r11,r11
3405	add	r12,r12
3406	lea	rsi,[192+rsp]
3407	adc	r13,r13
3408	mov	rax,r12
3409	adc	r8,r8
3410	adc	r9,r9
3411	mov	rbp,r13
3412	adc	r11,0
3413
3414	sub	r12,-1
3415	mov	rcx,r8
3416	sbb	r13,r14
3417	sbb	r8,0
3418	mov	r10,r9
3419	sbb	r9,r15
3420	sbb	r11,0
3421
3422	cmovc	r12,rax
3423	mov	rax,QWORD[rsi]
3424	cmovc	r13,rbp
3425	mov	rbp,QWORD[8+rsi]
3426	cmovc	r8,rcx
3427	mov	rcx,QWORD[16+rsi]
3428	cmovc	r9,r10
3429	mov	r10,QWORD[24+rsi]
3430
3431	call	__ecp_nistz256_subq
3432
3433	lea	rbx,[160+rsp]
3434	lea	rdi,[224+rsp]
3435	call	__ecp_nistz256_sub_fromq
3436
3437	mov	rax,QWORD[((0+0))+rsp]
3438	mov	rbp,QWORD[((0+8))+rsp]
3439	mov	rcx,QWORD[((0+16))+rsp]
3440	mov	r10,QWORD[((0+24))+rsp]
3441	lea	rdi,[64+rsp]
3442
3443	call	__ecp_nistz256_subq
3444
3445	mov	QWORD[rdi],r12
3446	mov	QWORD[8+rdi],r13
3447	mov	QWORD[16+rdi],r8
3448	mov	QWORD[24+rdi],r9
3449	mov	rax,QWORD[352+rsp]
3450	lea	rbx,[352+rsp]
3451	mov	r9,QWORD[((0+160))+rsp]
3452	mov	r10,QWORD[((8+160))+rsp]
3453	lea	rsi,[((0+160))+rsp]
3454	mov	r11,QWORD[((16+160))+rsp]
3455	mov	r12,QWORD[((24+160))+rsp]
3456	lea	rdi,[32+rsp]
3457	call	__ecp_nistz256_mul_montq
3458
3459	mov	rax,QWORD[96+rsp]
3460	lea	rbx,[96+rsp]
3461	mov	r9,QWORD[((0+64))+rsp]
3462	mov	r10,QWORD[((8+64))+rsp]
3463	lea	rsi,[((0+64))+rsp]
3464	mov	r11,QWORD[((16+64))+rsp]
3465	mov	r12,QWORD[((24+64))+rsp]
3466	lea	rdi,[64+rsp]
3467	call	__ecp_nistz256_mul_montq
3468
3469	lea	rbx,[32+rsp]
3470	lea	rdi,[256+rsp]
3471	call	__ecp_nistz256_sub_fromq
3472
3473DB	102,72,15,126,199
3474
3475	movdqa	xmm0,xmm5
3476	movdqa	xmm1,xmm5
3477	pandn	xmm0,XMMWORD[288+rsp]
3478	movdqa	xmm2,xmm5
3479	pandn	xmm1,XMMWORD[((288+16))+rsp]
3480	movdqa	xmm3,xmm5
3481	pand	xmm2,XMMWORD[$L$ONE_mont]
3482	pand	xmm3,XMMWORD[(($L$ONE_mont+16))]
3483	por	xmm2,xmm0
3484	por	xmm3,xmm1
3485
3486	movdqa	xmm0,xmm4
3487	movdqa	xmm1,xmm4
3488	pandn	xmm0,xmm2
3489	movdqa	xmm2,xmm4
3490	pandn	xmm1,xmm3
3491	movdqa	xmm3,xmm4
3492	pand	xmm2,XMMWORD[384+rsp]
3493	pand	xmm3,XMMWORD[((384+16))+rsp]
3494	por	xmm2,xmm0
3495	por	xmm3,xmm1
3496	movdqu	XMMWORD[64+rdi],xmm2
3497	movdqu	XMMWORD[80+rdi],xmm3
3498
3499	movdqa	xmm0,xmm5
3500	movdqa	xmm1,xmm5
3501	pandn	xmm0,XMMWORD[224+rsp]
3502	movdqa	xmm2,xmm5
3503	pandn	xmm1,XMMWORD[((224+16))+rsp]
3504	movdqa	xmm3,xmm5
3505	pand	xmm2,XMMWORD[416+rsp]
3506	pand	xmm3,XMMWORD[((416+16))+rsp]
3507	por	xmm2,xmm0
3508	por	xmm3,xmm1
3509
3510	movdqa	xmm0,xmm4
3511	movdqa	xmm1,xmm4
3512	pandn	xmm0,xmm2
3513	movdqa	xmm2,xmm4
3514	pandn	xmm1,xmm3
3515	movdqa	xmm3,xmm4
3516	pand	xmm2,XMMWORD[320+rsp]
3517	pand	xmm3,XMMWORD[((320+16))+rsp]
3518	por	xmm2,xmm0
3519	por	xmm3,xmm1
3520	movdqu	XMMWORD[rdi],xmm2
3521	movdqu	XMMWORD[16+rdi],xmm3
3522
3523	movdqa	xmm0,xmm5
3524	movdqa	xmm1,xmm5
3525	pandn	xmm0,XMMWORD[256+rsp]
3526	movdqa	xmm2,xmm5
3527	pandn	xmm1,XMMWORD[((256+16))+rsp]
3528	movdqa	xmm3,xmm5
3529	pand	xmm2,XMMWORD[448+rsp]
3530	pand	xmm3,XMMWORD[((448+16))+rsp]
3531	por	xmm2,xmm0
3532	por	xmm3,xmm1
3533
3534	movdqa	xmm0,xmm4
3535	movdqa	xmm1,xmm4
3536	pandn	xmm0,xmm2
3537	movdqa	xmm2,xmm4
3538	pandn	xmm1,xmm3
3539	movdqa	xmm3,xmm4
3540	pand	xmm2,XMMWORD[352+rsp]
3541	pand	xmm3,XMMWORD[((352+16))+rsp]
3542	por	xmm2,xmm0
3543	por	xmm3,xmm1
3544	movdqu	XMMWORD[32+rdi],xmm2
3545	movdqu	XMMWORD[48+rdi],xmm3
3546
3547	lea	rsi,[((480+56))+rsp]
3548
3549	mov	r15,QWORD[((-48))+rsi]
3550
3551	mov	r14,QWORD[((-40))+rsi]
3552
3553	mov	r13,QWORD[((-32))+rsi]
3554
3555	mov	r12,QWORD[((-24))+rsi]
3556
3557	mov	rbx,QWORD[((-16))+rsi]
3558
3559	mov	rbp,QWORD[((-8))+rsi]
3560
3561	lea	rsp,[rsi]
3562
3563$L$add_affineq_epilogue:
3564	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
3565	mov	rsi,QWORD[16+rsp]
3566	ret
3567
3568$L$SEH_end_ecp_nistz256_point_add_affine:
3569
3570ALIGN	32
3571__ecp_nistz256_add_tox:
3572
3573	xor	r11,r11
3574	adc	r12,QWORD[rbx]
3575	adc	r13,QWORD[8+rbx]
3576	mov	rax,r12
3577	adc	r8,QWORD[16+rbx]
3578	adc	r9,QWORD[24+rbx]
3579	mov	rbp,r13
3580	adc	r11,0
3581
3582	xor	r10,r10
3583	sbb	r12,-1
3584	mov	rcx,r8
3585	sbb	r13,r14
3586	sbb	r8,0
3587	mov	r10,r9
3588	sbb	r9,r15
3589	sbb	r11,0
3590
3591	cmovc	r12,rax
3592	cmovc	r13,rbp
3593	mov	QWORD[rdi],r12
3594	cmovc	r8,rcx
3595	mov	QWORD[8+rdi],r13
3596	cmovc	r9,r10
3597	mov	QWORD[16+rdi],r8
3598	mov	QWORD[24+rdi],r9
3599
3600	ret
3601
3602
3603
3604
3605ALIGN	32
3606__ecp_nistz256_sub_fromx:
3607
3608	xor	r11,r11
3609	sbb	r12,QWORD[rbx]
3610	sbb	r13,QWORD[8+rbx]
3611	mov	rax,r12
3612	sbb	r8,QWORD[16+rbx]
3613	sbb	r9,QWORD[24+rbx]
3614	mov	rbp,r13
3615	sbb	r11,0
3616
3617	xor	r10,r10
3618	adc	r12,-1
3619	mov	rcx,r8
3620	adc	r13,r14
3621	adc	r8,0
3622	mov	r10,r9
3623	adc	r9,r15
3624
3625	bt	r11,0
3626	cmovnc	r12,rax
3627	cmovnc	r13,rbp
3628	mov	QWORD[rdi],r12
3629	cmovnc	r8,rcx
3630	mov	QWORD[8+rdi],r13
3631	cmovnc	r9,r10
3632	mov	QWORD[16+rdi],r8
3633	mov	QWORD[24+rdi],r9
3634
3635	ret
3636
3637
3638
3639
3640ALIGN	32
3641__ecp_nistz256_subx:
3642
3643	xor	r11,r11
3644	sbb	rax,r12
3645	sbb	rbp,r13
3646	mov	r12,rax
3647	sbb	rcx,r8
3648	sbb	r10,r9
3649	mov	r13,rbp
3650	sbb	r11,0
3651
3652	xor	r9,r9
3653	adc	rax,-1
3654	mov	r8,rcx
3655	adc	rbp,r14
3656	adc	rcx,0
3657	mov	r9,r10
3658	adc	r10,r15
3659
3660	bt	r11,0
3661	cmovc	r12,rax
3662	cmovc	r13,rbp
3663	cmovc	r8,rcx
3664	cmovc	r9,r10
3665
3666	ret
3667
3668
3669
3670
3671ALIGN	32
3672__ecp_nistz256_mul_by_2x:
3673
3674	xor	r11,r11
3675	adc	r12,r12
3676	adc	r13,r13
3677	mov	rax,r12
3678	adc	r8,r8
3679	adc	r9,r9
3680	mov	rbp,r13
3681	adc	r11,0
3682
3683	xor	r10,r10
3684	sbb	r12,-1
3685	mov	rcx,r8
3686	sbb	r13,r14
3687	sbb	r8,0
3688	mov	r10,r9
3689	sbb	r9,r15
3690	sbb	r11,0
3691
3692	cmovc	r12,rax
3693	cmovc	r13,rbp
3694	mov	QWORD[rdi],r12
3695	cmovc	r8,rcx
3696	mov	QWORD[8+rdi],r13
3697	cmovc	r9,r10
3698	mov	QWORD[16+rdi],r8
3699	mov	QWORD[24+rdi],r9
3700
3701	ret
3702
3703
3704
3705ALIGN	32
3706ecp_nistz256_point_doublex:
3707	mov	QWORD[8+rsp],rdi	;WIN64 prologue
3708	mov	QWORD[16+rsp],rsi
3709	mov	rax,rsp
3710$L$SEH_begin_ecp_nistz256_point_doublex:
3711	mov	rdi,rcx
3712	mov	rsi,rdx
3713
3714
3715
3716$L$point_doublex:
3717	push	rbp
3718
3719	push	rbx
3720
3721	push	r12
3722
3723	push	r13
3724
3725	push	r14
3726
3727	push	r15
3728
3729	sub	rsp,32*5+8
3730
3731$L$point_doublex_body:
3732
3733$L$point_double_shortcutx:
3734	movdqu	xmm0,XMMWORD[rsi]
3735	mov	rbx,rsi
3736	movdqu	xmm1,XMMWORD[16+rsi]
3737	mov	r12,QWORD[((32+0))+rsi]
3738	mov	r13,QWORD[((32+8))+rsi]
3739	mov	r8,QWORD[((32+16))+rsi]
3740	mov	r9,QWORD[((32+24))+rsi]
3741	mov	r14,QWORD[(($L$poly+8))]
3742	mov	r15,QWORD[(($L$poly+24))]
3743	movdqa	XMMWORD[96+rsp],xmm0
3744	movdqa	XMMWORD[(96+16)+rsp],xmm1
3745	lea	r10,[32+rdi]
3746	lea	r11,[64+rdi]
3747DB	102,72,15,110,199
3748DB	102,73,15,110,202
3749DB	102,73,15,110,211
3750
3751	lea	rdi,[rsp]
3752	call	__ecp_nistz256_mul_by_2x
3753
3754	mov	rdx,QWORD[((64+0))+rsi]
3755	mov	r14,QWORD[((64+8))+rsi]
3756	mov	r15,QWORD[((64+16))+rsi]
3757	mov	r8,QWORD[((64+24))+rsi]
3758	lea	rsi,[((64-128))+rsi]
3759	lea	rdi,[64+rsp]
3760	call	__ecp_nistz256_sqr_montx
3761
3762	mov	rdx,QWORD[((0+0))+rsp]
3763	mov	r14,QWORD[((8+0))+rsp]
3764	lea	rsi,[((-128+0))+rsp]
3765	mov	r15,QWORD[((16+0))+rsp]
3766	mov	r8,QWORD[((24+0))+rsp]
3767	lea	rdi,[rsp]
3768	call	__ecp_nistz256_sqr_montx
3769
3770	mov	rdx,QWORD[32+rbx]
3771	mov	r9,QWORD[((64+0))+rbx]
3772	mov	r10,QWORD[((64+8))+rbx]
3773	mov	r11,QWORD[((64+16))+rbx]
3774	mov	r12,QWORD[((64+24))+rbx]
3775	lea	rsi,[((64-128))+rbx]
3776	lea	rbx,[32+rbx]
3777DB	102,72,15,126,215
3778	call	__ecp_nistz256_mul_montx
3779	call	__ecp_nistz256_mul_by_2x
3780
3781	mov	r12,QWORD[((96+0))+rsp]
3782	mov	r13,QWORD[((96+8))+rsp]
3783	lea	rbx,[64+rsp]
3784	mov	r8,QWORD[((96+16))+rsp]
3785	mov	r9,QWORD[((96+24))+rsp]
3786	lea	rdi,[32+rsp]
3787	call	__ecp_nistz256_add_tox
3788
3789	mov	r12,QWORD[((96+0))+rsp]
3790	mov	r13,QWORD[((96+8))+rsp]
3791	lea	rbx,[64+rsp]
3792	mov	r8,QWORD[((96+16))+rsp]
3793	mov	r9,QWORD[((96+24))+rsp]
3794	lea	rdi,[64+rsp]
3795	call	__ecp_nistz256_sub_fromx
3796
3797	mov	rdx,QWORD[((0+0))+rsp]
3798	mov	r14,QWORD[((8+0))+rsp]
3799	lea	rsi,[((-128+0))+rsp]
3800	mov	r15,QWORD[((16+0))+rsp]
3801	mov	r8,QWORD[((24+0))+rsp]
3802DB	102,72,15,126,207
3803	call	__ecp_nistz256_sqr_montx
3804	xor	r9,r9
3805	mov	rax,r12
3806	add	r12,-1
3807	mov	r10,r13
3808	adc	r13,rsi
3809	mov	rcx,r14
3810	adc	r14,0
3811	mov	r8,r15
3812	adc	r15,rbp
3813	adc	r9,0
3814	xor	rsi,rsi
3815	test	rax,1
3816
3817	cmovz	r12,rax
3818	cmovz	r13,r10
3819	cmovz	r14,rcx
3820	cmovz	r15,r8
3821	cmovz	r9,rsi
3822
3823	mov	rax,r13
3824	shr	r12,1
3825	shl	rax,63
3826	mov	r10,r14
3827	shr	r13,1
3828	or	r12,rax
3829	shl	r10,63
3830	mov	rcx,r15
3831	shr	r14,1
3832	or	r13,r10
3833	shl	rcx,63
3834	mov	QWORD[rdi],r12
3835	shr	r15,1
3836	mov	QWORD[8+rdi],r13
3837	shl	r9,63
3838	or	r14,rcx
3839	or	r15,r9
3840	mov	QWORD[16+rdi],r14
3841	mov	QWORD[24+rdi],r15
3842	mov	rdx,QWORD[64+rsp]
3843	lea	rbx,[64+rsp]
3844	mov	r9,QWORD[((0+32))+rsp]
3845	mov	r10,QWORD[((8+32))+rsp]
3846	lea	rsi,[((-128+32))+rsp]
3847	mov	r11,QWORD[((16+32))+rsp]
3848	mov	r12,QWORD[((24+32))+rsp]
3849	lea	rdi,[32+rsp]
3850	call	__ecp_nistz256_mul_montx
3851
3852	lea	rdi,[128+rsp]
3853	call	__ecp_nistz256_mul_by_2x
3854
3855	lea	rbx,[32+rsp]
3856	lea	rdi,[32+rsp]
3857	call	__ecp_nistz256_add_tox
3858
3859	mov	rdx,QWORD[96+rsp]
3860	lea	rbx,[96+rsp]
3861	mov	r9,QWORD[((0+0))+rsp]
3862	mov	r10,QWORD[((8+0))+rsp]
3863	lea	rsi,[((-128+0))+rsp]
3864	mov	r11,QWORD[((16+0))+rsp]
3865	mov	r12,QWORD[((24+0))+rsp]
3866	lea	rdi,[rsp]
3867	call	__ecp_nistz256_mul_montx
3868
3869	lea	rdi,[128+rsp]
3870	call	__ecp_nistz256_mul_by_2x
3871
3872	mov	rdx,QWORD[((0+32))+rsp]
3873	mov	r14,QWORD[((8+32))+rsp]
3874	lea	rsi,[((-128+32))+rsp]
3875	mov	r15,QWORD[((16+32))+rsp]
3876	mov	r8,QWORD[((24+32))+rsp]
3877DB	102,72,15,126,199
3878	call	__ecp_nistz256_sqr_montx
3879
3880	lea	rbx,[128+rsp]
3881	mov	r8,r14
3882	mov	r9,r15
3883	mov	r14,rsi
3884	mov	r15,rbp
3885	call	__ecp_nistz256_sub_fromx
3886
3887	mov	rax,QWORD[((0+0))+rsp]
3888	mov	rbp,QWORD[((0+8))+rsp]
3889	mov	rcx,QWORD[((0+16))+rsp]
3890	mov	r10,QWORD[((0+24))+rsp]
3891	lea	rdi,[rsp]
3892	call	__ecp_nistz256_subx
3893
3894	mov	rdx,QWORD[32+rsp]
3895	lea	rbx,[32+rsp]
3896	mov	r14,r12
3897	xor	ecx,ecx
3898	mov	QWORD[((0+0))+rsp],r12
3899	mov	r10,r13
3900	mov	QWORD[((0+8))+rsp],r13
3901	cmovz	r11,r8
3902	mov	QWORD[((0+16))+rsp],r8
3903	lea	rsi,[((0-128))+rsp]
3904	cmovz	r12,r9
3905	mov	QWORD[((0+24))+rsp],r9
3906	mov	r9,r14
3907	lea	rdi,[rsp]
3908	call	__ecp_nistz256_mul_montx
3909
3910DB	102,72,15,126,203
3911DB	102,72,15,126,207
3912	call	__ecp_nistz256_sub_fromx
3913
3914	lea	rsi,[((160+56))+rsp]
3915
3916	mov	r15,QWORD[((-48))+rsi]
3917
3918	mov	r14,QWORD[((-40))+rsi]
3919
3920	mov	r13,QWORD[((-32))+rsi]
3921
3922	mov	r12,QWORD[((-24))+rsi]
3923
3924	mov	rbx,QWORD[((-16))+rsi]
3925
3926	mov	rbp,QWORD[((-8))+rsi]
3927
3928	lea	rsp,[rsi]
3929
3930$L$point_doublex_epilogue:
3931	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
3932	mov	rsi,QWORD[16+rsp]
3933	ret
3934
3935$L$SEH_end_ecp_nistz256_point_doublex:
3936
3937ALIGN	32
3938ecp_nistz256_point_addx:
3939	mov	QWORD[8+rsp],rdi	;WIN64 prologue
3940	mov	QWORD[16+rsp],rsi
3941	mov	rax,rsp
3942$L$SEH_begin_ecp_nistz256_point_addx:
3943	mov	rdi,rcx
3944	mov	rsi,rdx
3945	mov	rdx,r8
3946
3947
3948
3949$L$point_addx:
3950	push	rbp
3951
3952	push	rbx
3953
3954	push	r12
3955
3956	push	r13
3957
3958	push	r14
3959
3960	push	r15
3961
3962	sub	rsp,32*18+8
3963
3964$L$point_addx_body:
3965
3966	movdqu	xmm0,XMMWORD[rsi]
3967	movdqu	xmm1,XMMWORD[16+rsi]
3968	movdqu	xmm2,XMMWORD[32+rsi]
3969	movdqu	xmm3,XMMWORD[48+rsi]
3970	movdqu	xmm4,XMMWORD[64+rsi]
3971	movdqu	xmm5,XMMWORD[80+rsi]
3972	mov	rbx,rsi
3973	mov	rsi,rdx
3974	movdqa	XMMWORD[384+rsp],xmm0
3975	movdqa	XMMWORD[(384+16)+rsp],xmm1
3976	movdqa	XMMWORD[416+rsp],xmm2
3977	movdqa	XMMWORD[(416+16)+rsp],xmm3
3978	movdqa	XMMWORD[448+rsp],xmm4
3979	movdqa	XMMWORD[(448+16)+rsp],xmm5
3980	por	xmm5,xmm4
3981
3982	movdqu	xmm0,XMMWORD[rsi]
3983	pshufd	xmm3,xmm5,0xb1
3984	movdqu	xmm1,XMMWORD[16+rsi]
3985	movdqu	xmm2,XMMWORD[32+rsi]
3986	por	xmm5,xmm3
3987	movdqu	xmm3,XMMWORD[48+rsi]
3988	mov	rdx,QWORD[((64+0))+rsi]
3989	mov	r14,QWORD[((64+8))+rsi]
3990	mov	r15,QWORD[((64+16))+rsi]
3991	mov	r8,QWORD[((64+24))+rsi]
3992	movdqa	XMMWORD[480+rsp],xmm0
3993	pshufd	xmm4,xmm5,0x1e
3994	movdqa	XMMWORD[(480+16)+rsp],xmm1
3995	movdqu	xmm0,XMMWORD[64+rsi]
3996	movdqu	xmm1,XMMWORD[80+rsi]
3997	movdqa	XMMWORD[512+rsp],xmm2
3998	movdqa	XMMWORD[(512+16)+rsp],xmm3
3999	por	xmm5,xmm4
4000	pxor	xmm4,xmm4
4001	por	xmm1,xmm0
4002DB	102,72,15,110,199
4003
4004	lea	rsi,[((64-128))+rsi]
4005	mov	QWORD[((544+0))+rsp],rdx
4006	mov	QWORD[((544+8))+rsp],r14
4007	mov	QWORD[((544+16))+rsp],r15
4008	mov	QWORD[((544+24))+rsp],r8
4009	lea	rdi,[96+rsp]
4010	call	__ecp_nistz256_sqr_montx
4011
4012	pcmpeqd	xmm5,xmm4
4013	pshufd	xmm4,xmm1,0xb1
4014	por	xmm4,xmm1
4015	pshufd	xmm5,xmm5,0
4016	pshufd	xmm3,xmm4,0x1e
4017	por	xmm4,xmm3
4018	pxor	xmm3,xmm3
4019	pcmpeqd	xmm4,xmm3
4020	pshufd	xmm4,xmm4,0
4021	mov	rdx,QWORD[((64+0))+rbx]
4022	mov	r14,QWORD[((64+8))+rbx]
4023	mov	r15,QWORD[((64+16))+rbx]
4024	mov	r8,QWORD[((64+24))+rbx]
4025DB	102,72,15,110,203
4026
4027	lea	rsi,[((64-128))+rbx]
4028	lea	rdi,[32+rsp]
4029	call	__ecp_nistz256_sqr_montx
4030
4031	mov	rdx,QWORD[544+rsp]
4032	lea	rbx,[544+rsp]
4033	mov	r9,QWORD[((0+96))+rsp]
4034	mov	r10,QWORD[((8+96))+rsp]
4035	lea	rsi,[((-128+96))+rsp]
4036	mov	r11,QWORD[((16+96))+rsp]
4037	mov	r12,QWORD[((24+96))+rsp]
4038	lea	rdi,[224+rsp]
4039	call	__ecp_nistz256_mul_montx
4040
4041	mov	rdx,QWORD[448+rsp]
4042	lea	rbx,[448+rsp]
4043	mov	r9,QWORD[((0+32))+rsp]
4044	mov	r10,QWORD[((8+32))+rsp]
4045	lea	rsi,[((-128+32))+rsp]
4046	mov	r11,QWORD[((16+32))+rsp]
4047	mov	r12,QWORD[((24+32))+rsp]
4048	lea	rdi,[256+rsp]
4049	call	__ecp_nistz256_mul_montx
4050
4051	mov	rdx,QWORD[416+rsp]
4052	lea	rbx,[416+rsp]
4053	mov	r9,QWORD[((0+224))+rsp]
4054	mov	r10,QWORD[((8+224))+rsp]
4055	lea	rsi,[((-128+224))+rsp]
4056	mov	r11,QWORD[((16+224))+rsp]
4057	mov	r12,QWORD[((24+224))+rsp]
4058	lea	rdi,[224+rsp]
4059	call	__ecp_nistz256_mul_montx
4060
4061	mov	rdx,QWORD[512+rsp]
4062	lea	rbx,[512+rsp]
4063	mov	r9,QWORD[((0+256))+rsp]
4064	mov	r10,QWORD[((8+256))+rsp]
4065	lea	rsi,[((-128+256))+rsp]
4066	mov	r11,QWORD[((16+256))+rsp]
4067	mov	r12,QWORD[((24+256))+rsp]
4068	lea	rdi,[256+rsp]
4069	call	__ecp_nistz256_mul_montx
4070
4071	lea	rbx,[224+rsp]
4072	lea	rdi,[64+rsp]
4073	call	__ecp_nistz256_sub_fromx
4074
4075	or	r12,r13
4076	movdqa	xmm2,xmm4
4077	or	r12,r8
4078	or	r12,r9
4079	por	xmm2,xmm5
4080DB	102,73,15,110,220
4081
4082	mov	rdx,QWORD[384+rsp]
4083	lea	rbx,[384+rsp]
4084	mov	r9,QWORD[((0+96))+rsp]
4085	mov	r10,QWORD[((8+96))+rsp]
4086	lea	rsi,[((-128+96))+rsp]
4087	mov	r11,QWORD[((16+96))+rsp]
4088	mov	r12,QWORD[((24+96))+rsp]
4089	lea	rdi,[160+rsp]
4090	call	__ecp_nistz256_mul_montx
4091
4092	mov	rdx,QWORD[480+rsp]
4093	lea	rbx,[480+rsp]
4094	mov	r9,QWORD[((0+32))+rsp]
4095	mov	r10,QWORD[((8+32))+rsp]
4096	lea	rsi,[((-128+32))+rsp]
4097	mov	r11,QWORD[((16+32))+rsp]
4098	mov	r12,QWORD[((24+32))+rsp]
4099	lea	rdi,[192+rsp]
4100	call	__ecp_nistz256_mul_montx
4101
4102	lea	rbx,[160+rsp]
4103	lea	rdi,[rsp]
4104	call	__ecp_nistz256_sub_fromx
4105
4106	or	r12,r13
4107	or	r12,r8
4108	or	r12,r9
4109
4110DB	102,73,15,126,208
4111DB	102,73,15,126,217
4112	or	r12,r8
4113	DB	0x3e
4114	jnz	NEAR $L$add_proceedx
4115
4116
4117
4118	test	r9,r9
4119	jz	NEAR $L$add_doublex
4120
4121
4122
4123
4124
4125
4126DB	102,72,15,126,199
4127	pxor	xmm0,xmm0
4128	movdqu	XMMWORD[rdi],xmm0
4129	movdqu	XMMWORD[16+rdi],xmm0
4130	movdqu	XMMWORD[32+rdi],xmm0
4131	movdqu	XMMWORD[48+rdi],xmm0
4132	movdqu	XMMWORD[64+rdi],xmm0
4133	movdqu	XMMWORD[80+rdi],xmm0
4134	jmp	NEAR $L$add_donex
4135
4136ALIGN	32
4137$L$add_doublex:
4138DB	102,72,15,126,206
4139DB	102,72,15,126,199
4140	add	rsp,416
4141
4142	jmp	NEAR $L$point_double_shortcutx
4143
4144
4145ALIGN	32
4146$L$add_proceedx:
4147	mov	rdx,QWORD[((0+64))+rsp]
4148	mov	r14,QWORD[((8+64))+rsp]
4149	lea	rsi,[((-128+64))+rsp]
4150	mov	r15,QWORD[((16+64))+rsp]
4151	mov	r8,QWORD[((24+64))+rsp]
4152	lea	rdi,[96+rsp]
4153	call	__ecp_nistz256_sqr_montx
4154
4155	mov	rdx,QWORD[448+rsp]
4156	lea	rbx,[448+rsp]
4157	mov	r9,QWORD[((0+0))+rsp]
4158	mov	r10,QWORD[((8+0))+rsp]
4159	lea	rsi,[((-128+0))+rsp]
4160	mov	r11,QWORD[((16+0))+rsp]
4161	mov	r12,QWORD[((24+0))+rsp]
4162	lea	rdi,[352+rsp]
4163	call	__ecp_nistz256_mul_montx
4164
4165	mov	rdx,QWORD[((0+0))+rsp]
4166	mov	r14,QWORD[((8+0))+rsp]
4167	lea	rsi,[((-128+0))+rsp]
4168	mov	r15,QWORD[((16+0))+rsp]
4169	mov	r8,QWORD[((24+0))+rsp]
4170	lea	rdi,[32+rsp]
4171	call	__ecp_nistz256_sqr_montx
4172
4173	mov	rdx,QWORD[544+rsp]
4174	lea	rbx,[544+rsp]
4175	mov	r9,QWORD[((0+352))+rsp]
4176	mov	r10,QWORD[((8+352))+rsp]
4177	lea	rsi,[((-128+352))+rsp]
4178	mov	r11,QWORD[((16+352))+rsp]
4179	mov	r12,QWORD[((24+352))+rsp]
4180	lea	rdi,[352+rsp]
4181	call	__ecp_nistz256_mul_montx
4182
4183	mov	rdx,QWORD[rsp]
4184	lea	rbx,[rsp]
4185	mov	r9,QWORD[((0+32))+rsp]
4186	mov	r10,QWORD[((8+32))+rsp]
4187	lea	rsi,[((-128+32))+rsp]
4188	mov	r11,QWORD[((16+32))+rsp]
4189	mov	r12,QWORD[((24+32))+rsp]
4190	lea	rdi,[128+rsp]
4191	call	__ecp_nistz256_mul_montx
4192
4193	mov	rdx,QWORD[160+rsp]
4194	lea	rbx,[160+rsp]
4195	mov	r9,QWORD[((0+32))+rsp]
4196	mov	r10,QWORD[((8+32))+rsp]
4197	lea	rsi,[((-128+32))+rsp]
4198	mov	r11,QWORD[((16+32))+rsp]
4199	mov	r12,QWORD[((24+32))+rsp]
4200	lea	rdi,[192+rsp]
4201	call	__ecp_nistz256_mul_montx
4202
4203
4204
4205
4206	xor	r11,r11
4207	add	r12,r12
4208	lea	rsi,[96+rsp]
4209	adc	r13,r13
4210	mov	rax,r12
4211	adc	r8,r8
4212	adc	r9,r9
4213	mov	rbp,r13
4214	adc	r11,0
4215
4216	sub	r12,-1
4217	mov	rcx,r8
4218	sbb	r13,r14
4219	sbb	r8,0
4220	mov	r10,r9
4221	sbb	r9,r15
4222	sbb	r11,0
4223
4224	cmovc	r12,rax
4225	mov	rax,QWORD[rsi]
4226	cmovc	r13,rbp
4227	mov	rbp,QWORD[8+rsi]
4228	cmovc	r8,rcx
4229	mov	rcx,QWORD[16+rsi]
4230	cmovc	r9,r10
4231	mov	r10,QWORD[24+rsi]
4232
4233	call	__ecp_nistz256_subx
4234
4235	lea	rbx,[128+rsp]
4236	lea	rdi,[288+rsp]
4237	call	__ecp_nistz256_sub_fromx
4238
4239	mov	rax,QWORD[((192+0))+rsp]
4240	mov	rbp,QWORD[((192+8))+rsp]
4241	mov	rcx,QWORD[((192+16))+rsp]
4242	mov	r10,QWORD[((192+24))+rsp]
4243	lea	rdi,[320+rsp]
4244
4245	call	__ecp_nistz256_subx
4246
4247	mov	QWORD[rdi],r12
4248	mov	QWORD[8+rdi],r13
4249	mov	QWORD[16+rdi],r8
4250	mov	QWORD[24+rdi],r9
4251	mov	rdx,QWORD[128+rsp]
4252	lea	rbx,[128+rsp]
4253	mov	r9,QWORD[((0+224))+rsp]
4254	mov	r10,QWORD[((8+224))+rsp]
4255	lea	rsi,[((-128+224))+rsp]
4256	mov	r11,QWORD[((16+224))+rsp]
4257	mov	r12,QWORD[((24+224))+rsp]
4258	lea	rdi,[256+rsp]
4259	call	__ecp_nistz256_mul_montx
4260
4261	mov	rdx,QWORD[320+rsp]
4262	lea	rbx,[320+rsp]
4263	mov	r9,QWORD[((0+64))+rsp]
4264	mov	r10,QWORD[((8+64))+rsp]
4265	lea	rsi,[((-128+64))+rsp]
4266	mov	r11,QWORD[((16+64))+rsp]
4267	mov	r12,QWORD[((24+64))+rsp]
4268	lea	rdi,[320+rsp]
4269	call	__ecp_nistz256_mul_montx
4270
4271	lea	rbx,[256+rsp]
4272	lea	rdi,[320+rsp]
4273	call	__ecp_nistz256_sub_fromx
4274
4275DB	102,72,15,126,199
4276
4277	movdqa	xmm0,xmm5
4278	movdqa	xmm1,xmm5
4279	pandn	xmm0,XMMWORD[352+rsp]
4280	movdqa	xmm2,xmm5
4281	pandn	xmm1,XMMWORD[((352+16))+rsp]
4282	movdqa	xmm3,xmm5
4283	pand	xmm2,XMMWORD[544+rsp]
4284	pand	xmm3,XMMWORD[((544+16))+rsp]
4285	por	xmm2,xmm0
4286	por	xmm3,xmm1
4287
4288	movdqa	xmm0,xmm4
4289	movdqa	xmm1,xmm4
4290	pandn	xmm0,xmm2
4291	movdqa	xmm2,xmm4
4292	pandn	xmm1,xmm3
4293	movdqa	xmm3,xmm4
4294	pand	xmm2,XMMWORD[448+rsp]
4295	pand	xmm3,XMMWORD[((448+16))+rsp]
4296	por	xmm2,xmm0
4297	por	xmm3,xmm1
4298	movdqu	XMMWORD[64+rdi],xmm2
4299	movdqu	XMMWORD[80+rdi],xmm3
4300
4301	movdqa	xmm0,xmm5
4302	movdqa	xmm1,xmm5
4303	pandn	xmm0,XMMWORD[288+rsp]
4304	movdqa	xmm2,xmm5
4305	pandn	xmm1,XMMWORD[((288+16))+rsp]
4306	movdqa	xmm3,xmm5
4307	pand	xmm2,XMMWORD[480+rsp]
4308	pand	xmm3,XMMWORD[((480+16))+rsp]
4309	por	xmm2,xmm0
4310	por	xmm3,xmm1
4311
4312	movdqa	xmm0,xmm4
4313	movdqa	xmm1,xmm4
4314	pandn	xmm0,xmm2
4315	movdqa	xmm2,xmm4
4316	pandn	xmm1,xmm3
4317	movdqa	xmm3,xmm4
4318	pand	xmm2,XMMWORD[384+rsp]
4319	pand	xmm3,XMMWORD[((384+16))+rsp]
4320	por	xmm2,xmm0
4321	por	xmm3,xmm1
4322	movdqu	XMMWORD[rdi],xmm2
4323	movdqu	XMMWORD[16+rdi],xmm3
4324
4325	movdqa	xmm0,xmm5
4326	movdqa	xmm1,xmm5
4327	pandn	xmm0,XMMWORD[320+rsp]
4328	movdqa	xmm2,xmm5
4329	pandn	xmm1,XMMWORD[((320+16))+rsp]
4330	movdqa	xmm3,xmm5
4331	pand	xmm2,XMMWORD[512+rsp]
4332	pand	xmm3,XMMWORD[((512+16))+rsp]
4333	por	xmm2,xmm0
4334	por	xmm3,xmm1
4335
4336	movdqa	xmm0,xmm4
4337	movdqa	xmm1,xmm4
4338	pandn	xmm0,xmm2
4339	movdqa	xmm2,xmm4
4340	pandn	xmm1,xmm3
4341	movdqa	xmm3,xmm4
4342	pand	xmm2,XMMWORD[416+rsp]
4343	pand	xmm3,XMMWORD[((416+16))+rsp]
4344	por	xmm2,xmm0
4345	por	xmm3,xmm1
4346	movdqu	XMMWORD[32+rdi],xmm2
4347	movdqu	XMMWORD[48+rdi],xmm3
4348
4349$L$add_donex:
4350	lea	rsi,[((576+56))+rsp]
4351
4352	mov	r15,QWORD[((-48))+rsi]
4353
4354	mov	r14,QWORD[((-40))+rsi]
4355
4356	mov	r13,QWORD[((-32))+rsi]
4357
4358	mov	r12,QWORD[((-24))+rsi]
4359
4360	mov	rbx,QWORD[((-16))+rsi]
4361
4362	mov	rbp,QWORD[((-8))+rsi]
4363
4364	lea	rsp,[rsi]
4365
4366$L$point_addx_epilogue:
4367	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
4368	mov	rsi,QWORD[16+rsp]
4369	ret
4370
4371$L$SEH_end_ecp_nistz256_point_addx:
4372
4373ALIGN	32
4374ecp_nistz256_point_add_affinex:
4375	mov	QWORD[8+rsp],rdi	;WIN64 prologue
4376	mov	QWORD[16+rsp],rsi
4377	mov	rax,rsp
4378$L$SEH_begin_ecp_nistz256_point_add_affinex:
4379	mov	rdi,rcx
4380	mov	rsi,rdx
4381	mov	rdx,r8
4382
4383
4384
4385$L$point_add_affinex:
4386	push	rbp
4387
4388	push	rbx
4389
4390	push	r12
4391
4392	push	r13
4393
4394	push	r14
4395
4396	push	r15
4397
4398	sub	rsp,32*15+8
4399
4400$L$add_affinex_body:
4401
4402	movdqu	xmm0,XMMWORD[rsi]
4403	mov	rbx,rdx
4404	movdqu	xmm1,XMMWORD[16+rsi]
4405	movdqu	xmm2,XMMWORD[32+rsi]
4406	movdqu	xmm3,XMMWORD[48+rsi]
4407	movdqu	xmm4,XMMWORD[64+rsi]
4408	movdqu	xmm5,XMMWORD[80+rsi]
4409	mov	rdx,QWORD[((64+0))+rsi]
4410	mov	r14,QWORD[((64+8))+rsi]
4411	mov	r15,QWORD[((64+16))+rsi]
4412	mov	r8,QWORD[((64+24))+rsi]
4413	movdqa	XMMWORD[320+rsp],xmm0
4414	movdqa	XMMWORD[(320+16)+rsp],xmm1
4415	movdqa	XMMWORD[352+rsp],xmm2
4416	movdqa	XMMWORD[(352+16)+rsp],xmm3
4417	movdqa	XMMWORD[384+rsp],xmm4
4418	movdqa	XMMWORD[(384+16)+rsp],xmm5
4419	por	xmm5,xmm4
4420
4421	movdqu	xmm0,XMMWORD[rbx]
4422	pshufd	xmm3,xmm5,0xb1
4423	movdqu	xmm1,XMMWORD[16+rbx]
4424	movdqu	xmm2,XMMWORD[32+rbx]
4425	por	xmm5,xmm3
4426	movdqu	xmm3,XMMWORD[48+rbx]
4427	movdqa	XMMWORD[416+rsp],xmm0
4428	pshufd	xmm4,xmm5,0x1e
4429	movdqa	XMMWORD[(416+16)+rsp],xmm1
4430	por	xmm1,xmm0
4431DB	102,72,15,110,199
4432	movdqa	XMMWORD[448+rsp],xmm2
4433	movdqa	XMMWORD[(448+16)+rsp],xmm3
4434	por	xmm3,xmm2
4435	por	xmm5,xmm4
4436	pxor	xmm4,xmm4
4437	por	xmm3,xmm1
4438
4439	lea	rsi,[((64-128))+rsi]
4440	lea	rdi,[32+rsp]
4441	call	__ecp_nistz256_sqr_montx
4442
4443	pcmpeqd	xmm5,xmm4
4444	pshufd	xmm4,xmm3,0xb1
4445	mov	rdx,QWORD[rbx]
4446
4447	mov	r9,r12
4448	por	xmm4,xmm3
4449	pshufd	xmm5,xmm5,0
4450	pshufd	xmm3,xmm4,0x1e
4451	mov	r10,r13
4452	por	xmm4,xmm3
4453	pxor	xmm3,xmm3
4454	mov	r11,r14
4455	pcmpeqd	xmm4,xmm3
4456	pshufd	xmm4,xmm4,0
4457
4458	lea	rsi,[((32-128))+rsp]
4459	mov	r12,r15
4460	lea	rdi,[rsp]
4461	call	__ecp_nistz256_mul_montx
4462
4463	lea	rbx,[320+rsp]
4464	lea	rdi,[64+rsp]
4465	call	__ecp_nistz256_sub_fromx
4466
4467	mov	rdx,QWORD[384+rsp]
4468	lea	rbx,[384+rsp]
4469	mov	r9,QWORD[((0+32))+rsp]
4470	mov	r10,QWORD[((8+32))+rsp]
4471	lea	rsi,[((-128+32))+rsp]
4472	mov	r11,QWORD[((16+32))+rsp]
4473	mov	r12,QWORD[((24+32))+rsp]
4474	lea	rdi,[32+rsp]
4475	call	__ecp_nistz256_mul_montx
4476
4477	mov	rdx,QWORD[384+rsp]
4478	lea	rbx,[384+rsp]
4479	mov	r9,QWORD[((0+64))+rsp]
4480	mov	r10,QWORD[((8+64))+rsp]
4481	lea	rsi,[((-128+64))+rsp]
4482	mov	r11,QWORD[((16+64))+rsp]
4483	mov	r12,QWORD[((24+64))+rsp]
4484	lea	rdi,[288+rsp]
4485	call	__ecp_nistz256_mul_montx
4486
4487	mov	rdx,QWORD[448+rsp]
4488	lea	rbx,[448+rsp]
4489	mov	r9,QWORD[((0+32))+rsp]
4490	mov	r10,QWORD[((8+32))+rsp]
4491	lea	rsi,[((-128+32))+rsp]
4492	mov	r11,QWORD[((16+32))+rsp]
4493	mov	r12,QWORD[((24+32))+rsp]
4494	lea	rdi,[32+rsp]
4495	call	__ecp_nistz256_mul_montx
4496
4497	lea	rbx,[352+rsp]
4498	lea	rdi,[96+rsp]
4499	call	__ecp_nistz256_sub_fromx
4500
4501	mov	rdx,QWORD[((0+64))+rsp]
4502	mov	r14,QWORD[((8+64))+rsp]
4503	lea	rsi,[((-128+64))+rsp]
4504	mov	r15,QWORD[((16+64))+rsp]
4505	mov	r8,QWORD[((24+64))+rsp]
4506	lea	rdi,[128+rsp]
4507	call	__ecp_nistz256_sqr_montx
4508
4509	mov	rdx,QWORD[((0+96))+rsp]
4510	mov	r14,QWORD[((8+96))+rsp]
4511	lea	rsi,[((-128+96))+rsp]
4512	mov	r15,QWORD[((16+96))+rsp]
4513	mov	r8,QWORD[((24+96))+rsp]
4514	lea	rdi,[192+rsp]
4515	call	__ecp_nistz256_sqr_montx
4516
4517	mov	rdx,QWORD[128+rsp]
4518	lea	rbx,[128+rsp]
4519	mov	r9,QWORD[((0+64))+rsp]
4520	mov	r10,QWORD[((8+64))+rsp]
4521	lea	rsi,[((-128+64))+rsp]
4522	mov	r11,QWORD[((16+64))+rsp]
4523	mov	r12,QWORD[((24+64))+rsp]
4524	lea	rdi,[160+rsp]
4525	call	__ecp_nistz256_mul_montx
4526
4527	mov	rdx,QWORD[320+rsp]
4528	lea	rbx,[320+rsp]
4529	mov	r9,QWORD[((0+128))+rsp]
4530	mov	r10,QWORD[((8+128))+rsp]
4531	lea	rsi,[((-128+128))+rsp]
4532	mov	r11,QWORD[((16+128))+rsp]
4533	mov	r12,QWORD[((24+128))+rsp]
4534	lea	rdi,[rsp]
4535	call	__ecp_nistz256_mul_montx
4536
4537
4538
4539
4540	xor	r11,r11
4541	add	r12,r12
4542	lea	rsi,[192+rsp]
4543	adc	r13,r13
4544	mov	rax,r12
4545	adc	r8,r8
4546	adc	r9,r9
4547	mov	rbp,r13
4548	adc	r11,0
4549
4550	sub	r12,-1
4551	mov	rcx,r8
4552	sbb	r13,r14
4553	sbb	r8,0
4554	mov	r10,r9
4555	sbb	r9,r15
4556	sbb	r11,0
4557
4558	cmovc	r12,rax
4559	mov	rax,QWORD[rsi]
4560	cmovc	r13,rbp
4561	mov	rbp,QWORD[8+rsi]
4562	cmovc	r8,rcx
4563	mov	rcx,QWORD[16+rsi]
4564	cmovc	r9,r10
4565	mov	r10,QWORD[24+rsi]
4566
4567	call	__ecp_nistz256_subx
4568
4569	lea	rbx,[160+rsp]
4570	lea	rdi,[224+rsp]
4571	call	__ecp_nistz256_sub_fromx
4572
4573	mov	rax,QWORD[((0+0))+rsp]
4574	mov	rbp,QWORD[((0+8))+rsp]
4575	mov	rcx,QWORD[((0+16))+rsp]
4576	mov	r10,QWORD[((0+24))+rsp]
4577	lea	rdi,[64+rsp]
4578
4579	call	__ecp_nistz256_subx
4580
4581	mov	QWORD[rdi],r12
4582	mov	QWORD[8+rdi],r13
4583	mov	QWORD[16+rdi],r8
4584	mov	QWORD[24+rdi],r9
4585	mov	rdx,QWORD[352+rsp]
4586	lea	rbx,[352+rsp]
4587	mov	r9,QWORD[((0+160))+rsp]
4588	mov	r10,QWORD[((8+160))+rsp]
4589	lea	rsi,[((-128+160))+rsp]
4590	mov	r11,QWORD[((16+160))+rsp]
4591	mov	r12,QWORD[((24+160))+rsp]
4592	lea	rdi,[32+rsp]
4593	call	__ecp_nistz256_mul_montx
4594
4595	mov	rdx,QWORD[96+rsp]
4596	lea	rbx,[96+rsp]
4597	mov	r9,QWORD[((0+64))+rsp]
4598	mov	r10,QWORD[((8+64))+rsp]
4599	lea	rsi,[((-128+64))+rsp]
4600	mov	r11,QWORD[((16+64))+rsp]
4601	mov	r12,QWORD[((24+64))+rsp]
4602	lea	rdi,[64+rsp]
4603	call	__ecp_nistz256_mul_montx
4604
4605	lea	rbx,[32+rsp]
4606	lea	rdi,[256+rsp]
4607	call	__ecp_nistz256_sub_fromx
4608
4609DB	102,72,15,126,199
4610
4611	movdqa	xmm0,xmm5
4612	movdqa	xmm1,xmm5
4613	pandn	xmm0,XMMWORD[288+rsp]
4614	movdqa	xmm2,xmm5
4615	pandn	xmm1,XMMWORD[((288+16))+rsp]
4616	movdqa	xmm3,xmm5
4617	pand	xmm2,XMMWORD[$L$ONE_mont]
4618	pand	xmm3,XMMWORD[(($L$ONE_mont+16))]
4619	por	xmm2,xmm0
4620	por	xmm3,xmm1
4621
4622	movdqa	xmm0,xmm4
4623	movdqa	xmm1,xmm4
4624	pandn	xmm0,xmm2
4625	movdqa	xmm2,xmm4
4626	pandn	xmm1,xmm3
4627	movdqa	xmm3,xmm4
4628	pand	xmm2,XMMWORD[384+rsp]
4629	pand	xmm3,XMMWORD[((384+16))+rsp]
4630	por	xmm2,xmm0
4631	por	xmm3,xmm1
4632	movdqu	XMMWORD[64+rdi],xmm2
4633	movdqu	XMMWORD[80+rdi],xmm3
4634
4635	movdqa	xmm0,xmm5
4636	movdqa	xmm1,xmm5
4637	pandn	xmm0,XMMWORD[224+rsp]
4638	movdqa	xmm2,xmm5
4639	pandn	xmm1,XMMWORD[((224+16))+rsp]
4640	movdqa	xmm3,xmm5
4641	pand	xmm2,XMMWORD[416+rsp]
4642	pand	xmm3,XMMWORD[((416+16))+rsp]
4643	por	xmm2,xmm0
4644	por	xmm3,xmm1
4645
4646	movdqa	xmm0,xmm4
4647	movdqa	xmm1,xmm4
4648	pandn	xmm0,xmm2
4649	movdqa	xmm2,xmm4
4650	pandn	xmm1,xmm3
4651	movdqa	xmm3,xmm4
4652	pand	xmm2,XMMWORD[320+rsp]
4653	pand	xmm3,XMMWORD[((320+16))+rsp]
4654	por	xmm2,xmm0
4655	por	xmm3,xmm1
4656	movdqu	XMMWORD[rdi],xmm2
4657	movdqu	XMMWORD[16+rdi],xmm3
4658
4659	movdqa	xmm0,xmm5
4660	movdqa	xmm1,xmm5
4661	pandn	xmm0,XMMWORD[256+rsp]
4662	movdqa	xmm2,xmm5
4663	pandn	xmm1,XMMWORD[((256+16))+rsp]
4664	movdqa	xmm3,xmm5
4665	pand	xmm2,XMMWORD[448+rsp]
4666	pand	xmm3,XMMWORD[((448+16))+rsp]
4667	por	xmm2,xmm0
4668	por	xmm3,xmm1
4669
4670	movdqa	xmm0,xmm4
4671	movdqa	xmm1,xmm4
4672	pandn	xmm0,xmm2
4673	movdqa	xmm2,xmm4
4674	pandn	xmm1,xmm3
4675	movdqa	xmm3,xmm4
4676	pand	xmm2,XMMWORD[352+rsp]
4677	pand	xmm3,XMMWORD[((352+16))+rsp]
4678	por	xmm2,xmm0
4679	por	xmm3,xmm1
4680	movdqu	XMMWORD[32+rdi],xmm2
4681	movdqu	XMMWORD[48+rdi],xmm3
4682
4683	lea	rsi,[((480+56))+rsp]
4684
4685	mov	r15,QWORD[((-48))+rsi]
4686
4687	mov	r14,QWORD[((-40))+rsi]
4688
4689	mov	r13,QWORD[((-32))+rsi]
4690
4691	mov	r12,QWORD[((-24))+rsi]
4692
4693	mov	rbx,QWORD[((-16))+rsi]
4694
4695	mov	rbp,QWORD[((-8))+rsi]
4696
4697	lea	rsp,[rsi]
4698
4699$L$add_affinex_epilogue:
4700	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
4701	mov	rsi,QWORD[16+rsp]
4702	ret
4703
4704$L$SEH_end_ecp_nistz256_point_add_affinex:
4705EXTERN	__imp_RtlVirtualUnwind
4706
4707
4708ALIGN	16
4709short_handler:
4710	push	rsi
4711	push	rdi
4712	push	rbx
4713	push	rbp
4714	push	r12
4715	push	r13
4716	push	r14
4717	push	r15
4718	pushfq
4719	sub	rsp,64
4720
4721	mov	rax,QWORD[120+r8]
4722	mov	rbx,QWORD[248+r8]
4723
4724	mov	rsi,QWORD[8+r9]
4725	mov	r11,QWORD[56+r9]
4726
4727	mov	r10d,DWORD[r11]
4728	lea	r10,[r10*1+rsi]
4729	cmp	rbx,r10
4730	jb	NEAR $L$common_seh_tail
4731
4732	mov	rax,QWORD[152+r8]
4733
4734	mov	r10d,DWORD[4+r11]
4735	lea	r10,[r10*1+rsi]
4736	cmp	rbx,r10
4737	jae	NEAR $L$common_seh_tail
4738
4739	lea	rax,[16+rax]
4740
4741	mov	r12,QWORD[((-8))+rax]
4742	mov	r13,QWORD[((-16))+rax]
4743	mov	QWORD[216+r8],r12
4744	mov	QWORD[224+r8],r13
4745
4746	jmp	NEAR $L$common_seh_tail
4747
4748
4749
4750ALIGN	16
4751full_handler:
4752	push	rsi
4753	push	rdi
4754	push	rbx
4755	push	rbp
4756	push	r12
4757	push	r13
4758	push	r14
4759	push	r15
4760	pushfq
4761	sub	rsp,64
4762
4763	mov	rax,QWORD[120+r8]
4764	mov	rbx,QWORD[248+r8]
4765
4766	mov	rsi,QWORD[8+r9]
4767	mov	r11,QWORD[56+r9]
4768
4769	mov	r10d,DWORD[r11]
4770	lea	r10,[r10*1+rsi]
4771	cmp	rbx,r10
4772	jb	NEAR $L$common_seh_tail
4773
4774	mov	rax,QWORD[152+r8]
4775
4776	mov	r10d,DWORD[4+r11]
4777	lea	r10,[r10*1+rsi]
4778	cmp	rbx,r10
4779	jae	NEAR $L$common_seh_tail
4780
4781	mov	r10d,DWORD[8+r11]
4782	lea	rax,[r10*1+rax]
4783
4784	mov	rbp,QWORD[((-8))+rax]
4785	mov	rbx,QWORD[((-16))+rax]
4786	mov	r12,QWORD[((-24))+rax]
4787	mov	r13,QWORD[((-32))+rax]
4788	mov	r14,QWORD[((-40))+rax]
4789	mov	r15,QWORD[((-48))+rax]
4790	mov	QWORD[144+r8],rbx
4791	mov	QWORD[160+r8],rbp
4792	mov	QWORD[216+r8],r12
4793	mov	QWORD[224+r8],r13
4794	mov	QWORD[232+r8],r14
4795	mov	QWORD[240+r8],r15
4796
4797$L$common_seh_tail:
4798	mov	rdi,QWORD[8+rax]
4799	mov	rsi,QWORD[16+rax]
4800	mov	QWORD[152+r8],rax
4801	mov	QWORD[168+r8],rsi
4802	mov	QWORD[176+r8],rdi
4803
4804	mov	rdi,QWORD[40+r9]
4805	mov	rsi,r8
4806	mov	ecx,154
4807	DD	0xa548f3fc
4808
4809	mov	rsi,r9
4810	xor	rcx,rcx
4811	mov	rdx,QWORD[8+rsi]
4812	mov	r8,QWORD[rsi]
4813	mov	r9,QWORD[16+rsi]
4814	mov	r10,QWORD[40+rsi]
4815	lea	r11,[56+rsi]
4816	lea	r12,[24+rsi]
4817	mov	QWORD[32+rsp],r10
4818	mov	QWORD[40+rsp],r11
4819	mov	QWORD[48+rsp],r12
4820	mov	QWORD[56+rsp],rcx
4821	call	QWORD[__imp_RtlVirtualUnwind]
4822
4823	mov	eax,1
4824	add	rsp,64
4825	popfq
4826	pop	r15
4827	pop	r14
4828	pop	r13
4829	pop	r12
4830	pop	rbp
4831	pop	rbx
4832	pop	rdi
4833	pop	rsi
4834	ret
4835
4836
4837section	.pdata rdata align=4
4838ALIGN	4
4839	DD	$L$SEH_begin_ecp_nistz256_neg wrt ..imagebase
4840	DD	$L$SEH_end_ecp_nistz256_neg wrt ..imagebase
4841	DD	$L$SEH_info_ecp_nistz256_neg wrt ..imagebase
4842
4843	DD	$L$SEH_begin_ecp_nistz256_ord_mul_mont wrt ..imagebase
4844	DD	$L$SEH_end_ecp_nistz256_ord_mul_mont wrt ..imagebase
4845	DD	$L$SEH_info_ecp_nistz256_ord_mul_mont wrt ..imagebase
4846
4847	DD	$L$SEH_begin_ecp_nistz256_ord_sqr_mont wrt ..imagebase
4848	DD	$L$SEH_end_ecp_nistz256_ord_sqr_mont wrt ..imagebase
4849	DD	$L$SEH_info_ecp_nistz256_ord_sqr_mont wrt ..imagebase
4850	DD	$L$SEH_begin_ecp_nistz256_ord_mul_montx wrt ..imagebase
4851	DD	$L$SEH_end_ecp_nistz256_ord_mul_montx wrt ..imagebase
4852	DD	$L$SEH_info_ecp_nistz256_ord_mul_montx wrt ..imagebase
4853
4854	DD	$L$SEH_begin_ecp_nistz256_ord_sqr_montx wrt ..imagebase
4855	DD	$L$SEH_end_ecp_nistz256_ord_sqr_montx wrt ..imagebase
4856	DD	$L$SEH_info_ecp_nistz256_ord_sqr_montx wrt ..imagebase
4857	DD	$L$SEH_begin_ecp_nistz256_mul_mont wrt ..imagebase
4858	DD	$L$SEH_end_ecp_nistz256_mul_mont wrt ..imagebase
4859	DD	$L$SEH_info_ecp_nistz256_mul_mont wrt ..imagebase
4860
4861	DD	$L$SEH_begin_ecp_nistz256_sqr_mont wrt ..imagebase
4862	DD	$L$SEH_end_ecp_nistz256_sqr_mont wrt ..imagebase
4863	DD	$L$SEH_info_ecp_nistz256_sqr_mont wrt ..imagebase
4864
4865	DD	$L$SEH_begin_ecp_nistz256_select_w5 wrt ..imagebase
4866	DD	$L$SEH_end_ecp_nistz256_select_w5 wrt ..imagebase
4867	DD	$L$SEH_info_ecp_nistz256_select_wX wrt ..imagebase
4868
4869	DD	$L$SEH_begin_ecp_nistz256_select_w7 wrt ..imagebase
4870	DD	$L$SEH_end_ecp_nistz256_select_w7 wrt ..imagebase
4871	DD	$L$SEH_info_ecp_nistz256_select_wX wrt ..imagebase
4872	DD	$L$SEH_begin_ecp_nistz256_avx2_select_w5 wrt ..imagebase
4873	DD	$L$SEH_end_ecp_nistz256_avx2_select_w5 wrt ..imagebase
4874	DD	$L$SEH_info_ecp_nistz256_avx2_select_wX wrt ..imagebase
4875
4876	DD	$L$SEH_begin_ecp_nistz256_avx2_select_w7 wrt ..imagebase
4877	DD	$L$SEH_end_ecp_nistz256_avx2_select_w7 wrt ..imagebase
4878	DD	$L$SEH_info_ecp_nistz256_avx2_select_wX wrt ..imagebase
4879	DD	$L$SEH_begin_ecp_nistz256_point_double wrt ..imagebase
4880	DD	$L$SEH_end_ecp_nistz256_point_double wrt ..imagebase
4881	DD	$L$SEH_info_ecp_nistz256_point_double wrt ..imagebase
4882
4883	DD	$L$SEH_begin_ecp_nistz256_point_add wrt ..imagebase
4884	DD	$L$SEH_end_ecp_nistz256_point_add wrt ..imagebase
4885	DD	$L$SEH_info_ecp_nistz256_point_add wrt ..imagebase
4886
4887	DD	$L$SEH_begin_ecp_nistz256_point_add_affine wrt ..imagebase
4888	DD	$L$SEH_end_ecp_nistz256_point_add_affine wrt ..imagebase
4889	DD	$L$SEH_info_ecp_nistz256_point_add_affine wrt ..imagebase
4890	DD	$L$SEH_begin_ecp_nistz256_point_doublex wrt ..imagebase
4891	DD	$L$SEH_end_ecp_nistz256_point_doublex wrt ..imagebase
4892	DD	$L$SEH_info_ecp_nistz256_point_doublex wrt ..imagebase
4893
4894	DD	$L$SEH_begin_ecp_nistz256_point_addx wrt ..imagebase
4895	DD	$L$SEH_end_ecp_nistz256_point_addx wrt ..imagebase
4896	DD	$L$SEH_info_ecp_nistz256_point_addx wrt ..imagebase
4897
4898	DD	$L$SEH_begin_ecp_nistz256_point_add_affinex wrt ..imagebase
4899	DD	$L$SEH_end_ecp_nistz256_point_add_affinex wrt ..imagebase
4900	DD	$L$SEH_info_ecp_nistz256_point_add_affinex wrt ..imagebase
4901
4902section	.xdata rdata align=8
4903ALIGN	8
4904$L$SEH_info_ecp_nistz256_neg:
4905	DB	9,0,0,0
4906	DD	short_handler wrt ..imagebase
4907	DD	$L$neg_body wrt ..imagebase,$L$neg_epilogue wrt ..imagebase
4908$L$SEH_info_ecp_nistz256_ord_mul_mont:
4909	DB	9,0,0,0
4910	DD	full_handler wrt ..imagebase
4911	DD	$L$ord_mul_body wrt ..imagebase,$L$ord_mul_epilogue wrt ..imagebase
4912	DD	48,0
4913$L$SEH_info_ecp_nistz256_ord_sqr_mont:
4914	DB	9,0,0,0
4915	DD	full_handler wrt ..imagebase
4916	DD	$L$ord_sqr_body wrt ..imagebase,$L$ord_sqr_epilogue wrt ..imagebase
4917	DD	48,0
4918$L$SEH_info_ecp_nistz256_ord_mul_montx:
4919	DB	9,0,0,0
4920	DD	full_handler wrt ..imagebase
4921	DD	$L$ord_mulx_body wrt ..imagebase,$L$ord_mulx_epilogue wrt ..imagebase
4922	DD	48,0
4923$L$SEH_info_ecp_nistz256_ord_sqr_montx:
4924	DB	9,0,0,0
4925	DD	full_handler wrt ..imagebase
4926	DD	$L$ord_sqrx_body wrt ..imagebase,$L$ord_sqrx_epilogue wrt ..imagebase
4927	DD	48,0
4928$L$SEH_info_ecp_nistz256_mul_mont:
4929	DB	9,0,0,0
4930	DD	full_handler wrt ..imagebase
4931	DD	$L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase
4932	DD	48,0
4933$L$SEH_info_ecp_nistz256_sqr_mont:
4934	DB	9,0,0,0
4935	DD	full_handler wrt ..imagebase
4936	DD	$L$sqr_body wrt ..imagebase,$L$sqr_epilogue wrt ..imagebase
4937	DD	48,0
4938$L$SEH_info_ecp_nistz256_select_wX:
4939	DB	0x01,0x33,0x16,0x00
4940	DB	0x33,0xf8,0x09,0x00
4941	DB	0x2e,0xe8,0x08,0x00
4942	DB	0x29,0xd8,0x07,0x00
4943	DB	0x24,0xc8,0x06,0x00
4944	DB	0x1f,0xb8,0x05,0x00
4945	DB	0x1a,0xa8,0x04,0x00
4946	DB	0x15,0x98,0x03,0x00
4947	DB	0x10,0x88,0x02,0x00
4948	DB	0x0c,0x78,0x01,0x00
4949	DB	0x08,0x68,0x00,0x00
4950	DB	0x04,0x01,0x15,0x00
4951ALIGN	8
4952$L$SEH_info_ecp_nistz256_avx2_select_wX:
4953	DB	0x01,0x36,0x17,0x0b
4954	DB	0x36,0xf8,0x09,0x00
4955	DB	0x31,0xe8,0x08,0x00
4956	DB	0x2c,0xd8,0x07,0x00
4957	DB	0x27,0xc8,0x06,0x00
4958	DB	0x22,0xb8,0x05,0x00
4959	DB	0x1d,0xa8,0x04,0x00
4960	DB	0x18,0x98,0x03,0x00
4961	DB	0x13,0x88,0x02,0x00
4962	DB	0x0e,0x78,0x01,0x00
4963	DB	0x09,0x68,0x00,0x00
4964	DB	0x04,0x01,0x15,0x00
4965	DB	0x00,0xb3,0x00,0x00
4966ALIGN	8
4967$L$SEH_info_ecp_nistz256_point_double:
4968	DB	9,0,0,0
4969	DD	full_handler wrt ..imagebase
4970	DD	$L$point_doubleq_body wrt ..imagebase,$L$point_doubleq_epilogue wrt ..imagebase
4971	DD	32*5+56,0
4972$L$SEH_info_ecp_nistz256_point_add:
4973	DB	9,0,0,0
4974	DD	full_handler wrt ..imagebase
4975	DD	$L$point_addq_body wrt ..imagebase,$L$point_addq_epilogue wrt ..imagebase
4976	DD	32*18+56,0
4977$L$SEH_info_ecp_nistz256_point_add_affine:
4978	DB	9,0,0,0
4979	DD	full_handler wrt ..imagebase
4980	DD	$L$add_affineq_body wrt ..imagebase,$L$add_affineq_epilogue wrt ..imagebase
4981	DD	32*15+56,0
4982ALIGN	8
4983$L$SEH_info_ecp_nistz256_point_doublex:
4984	DB	9,0,0,0
4985	DD	full_handler wrt ..imagebase
4986	DD	$L$point_doublex_body wrt ..imagebase,$L$point_doublex_epilogue wrt ..imagebase
4987	DD	32*5+56,0
4988$L$SEH_info_ecp_nistz256_point_addx:
4989	DB	9,0,0,0
4990	DD	full_handler wrt ..imagebase
4991	DD	$L$point_addx_body wrt ..imagebase,$L$point_addx_epilogue wrt ..imagebase
4992	DD	32*18+56,0
4993$L$SEH_info_ecp_nistz256_point_add_affinex:
4994	DB	9,0,0,0
4995	DD	full_handler wrt ..imagebase
4996	DD	$L$add_affinex_body wrt ..imagebase,$L$add_affinex_epilogue wrt ..imagebase
4997	DD	32*15+56,0
4998%else
4999; Work around https://bugzilla.nasm.us/show_bug.cgi?id=3392738
5000ret
5001%endif
5002