1#if defined(__i386__)
2.file	"vpaes-x86.S"
3.text
4.align	64
5.L_vpaes_consts:
6.long	218628480,235210255,168496130,67568393
7.long	252381056,17041926,33884169,51187212
8.long	252645135,252645135,252645135,252645135
9.long	1512730624,3266504856,1377990664,3401244816
10.long	830229760,1275146365,2969422977,3447763452
11.long	3411033600,2979783055,338359620,2782886510
12.long	4209124096,907596821,221174255,1006095553
13.long	191964160,3799684038,3164090317,1589111125
14.long	182528256,1777043520,2877432650,3265356744
15.long	1874708224,3503451415,3305285752,363511674
16.long	1606117888,3487855781,1093350906,2384367825
17.long	197121,67569157,134941193,202313229
18.long	67569157,134941193,202313229,197121
19.long	134941193,202313229,197121,67569157
20.long	202313229,197121,67569157,134941193
21.long	33619971,100992007,168364043,235736079
22.long	235736079,33619971,100992007,168364043
23.long	168364043,235736079,33619971,100992007
24.long	100992007,168364043,235736079,33619971
25.long	50462976,117835012,185207048,252579084
26.long	252314880,51251460,117574920,184942860
27.long	184682752,252054788,50987272,118359308
28.long	118099200,185467140,251790600,50727180
29.long	2946363062,528716217,1300004225,1881839624
30.long	1532713819,1532713819,1532713819,1532713819
31.long	3602276352,4288629033,3737020424,4153884961
32.long	1354558464,32357713,2958822624,3775749553
33.long	1201988352,132424512,1572796698,503232858
34.long	2213177600,1597421020,4103937655,675398315
35.long	2749646592,4273543773,1511898873,121693092
36.long	3040248576,1103263732,2871565598,1608280554
37.long	2236667136,2588920351,482954393,64377734
38.long	3069987328,291237287,2117370568,3650299247
39.long	533321216,3573750986,2572112006,1401264716
40.long	1339849704,2721158661,548607111,3445553514
41.long	2128193280,3054596040,2183486460,1257083700
42.long	655635200,1165381986,3923443150,2344132524
43.long	190078720,256924420,290342170,357187870
44.long	1610966272,2263057382,4103205268,309794674
45.long	2592527872,2233205587,1335446729,3402964816
46.long	3973531904,3225098121,3002836325,1918774430
47.long	3870401024,2102906079,2284471353,4117666579
48.long	617007872,1021508343,366931923,691083277
49.long	2528395776,3491914898,2968704004,1613121270
50.long	3445188352,3247741094,844474987,4093578302
51.long	651481088,1190302358,1689581232,574775300
52.long	4289380608,206939853,2555985458,2489840491
53.long	2130264064,327674451,3566485037,3349835193
54.long	2470714624,316102159,3636825756,3393945945
55.byte	86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
56.byte	111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83
57.byte	83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117
58.byte	114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105
59.byte	118,101,114,115,105,116,121,41,0
60.align	64
61.hidden	_vpaes_preheat
62.type	_vpaes_preheat,@function
63.align	16
64_vpaes_preheat:
65	addl	(%esp),%ebp
66	movdqa	-48(%ebp),%xmm7
67	movdqa	-16(%ebp),%xmm6
68	ret
69.size	_vpaes_preheat,.-_vpaes_preheat
70.hidden	_vpaes_encrypt_core
71.type	_vpaes_encrypt_core,@function
72.align	16
73_vpaes_encrypt_core:
74	movl	$16,%ecx
75	movl	240(%edx),%eax
76	movdqa	%xmm6,%xmm1
77	movdqa	(%ebp),%xmm2
78	pandn	%xmm0,%xmm1
79	pand	%xmm6,%xmm0
80	movdqu	(%edx),%xmm5
81.byte	102,15,56,0,208
82	movdqa	16(%ebp),%xmm0
83	pxor	%xmm5,%xmm2
84	psrld	$4,%xmm1
85	addl	$16,%edx
86.byte	102,15,56,0,193
87	leal	192(%ebp),%ebx
88	pxor	%xmm2,%xmm0
89	jmp	.L000enc_entry
90.align	16
91.L001enc_loop:
92	movdqa	32(%ebp),%xmm4
93	movdqa	48(%ebp),%xmm0
94.byte	102,15,56,0,226
95.byte	102,15,56,0,195
96	pxor	%xmm5,%xmm4
97	movdqa	64(%ebp),%xmm5
98	pxor	%xmm4,%xmm0
99	movdqa	-64(%ebx,%ecx,1),%xmm1
100.byte	102,15,56,0,234
101	movdqa	80(%ebp),%xmm2
102	movdqa	(%ebx,%ecx,1),%xmm4
103.byte	102,15,56,0,211
104	movdqa	%xmm0,%xmm3
105	pxor	%xmm5,%xmm2
106.byte	102,15,56,0,193
107	addl	$16,%edx
108	pxor	%xmm2,%xmm0
109.byte	102,15,56,0,220
110	addl	$16,%ecx
111	pxor	%xmm0,%xmm3
112.byte	102,15,56,0,193
113	andl	$48,%ecx
114	subl	$1,%eax
115	pxor	%xmm3,%xmm0
116.L000enc_entry:
117	movdqa	%xmm6,%xmm1
118	movdqa	-32(%ebp),%xmm5
119	pandn	%xmm0,%xmm1
120	psrld	$4,%xmm1
121	pand	%xmm6,%xmm0
122.byte	102,15,56,0,232
123	movdqa	%xmm7,%xmm3
124	pxor	%xmm1,%xmm0
125.byte	102,15,56,0,217
126	movdqa	%xmm7,%xmm4
127	pxor	%xmm5,%xmm3
128.byte	102,15,56,0,224
129	movdqa	%xmm7,%xmm2
130	pxor	%xmm5,%xmm4
131.byte	102,15,56,0,211
132	movdqa	%xmm7,%xmm3
133	pxor	%xmm0,%xmm2
134.byte	102,15,56,0,220
135	movdqu	(%edx),%xmm5
136	pxor	%xmm1,%xmm3
137	jnz	.L001enc_loop
138	movdqa	96(%ebp),%xmm4
139	movdqa	112(%ebp),%xmm0
140.byte	102,15,56,0,226
141	pxor	%xmm5,%xmm4
142.byte	102,15,56,0,195
143	movdqa	64(%ebx,%ecx,1),%xmm1
144	pxor	%xmm4,%xmm0
145.byte	102,15,56,0,193
146	ret
147.size	_vpaes_encrypt_core,.-_vpaes_encrypt_core
148.hidden	_vpaes_decrypt_core
149.type	_vpaes_decrypt_core,@function
150.align	16
151_vpaes_decrypt_core:
152	leal	608(%ebp),%ebx
153	movl	240(%edx),%eax
154	movdqa	%xmm6,%xmm1
155	movdqa	-64(%ebx),%xmm2
156	pandn	%xmm0,%xmm1
157	movl	%eax,%ecx
158	psrld	$4,%xmm1
159	movdqu	(%edx),%xmm5
160	shll	$4,%ecx
161	pand	%xmm6,%xmm0
162.byte	102,15,56,0,208
163	movdqa	-48(%ebx),%xmm0
164	xorl	$48,%ecx
165.byte	102,15,56,0,193
166	andl	$48,%ecx
167	pxor	%xmm5,%xmm2
168	movdqa	176(%ebp),%xmm5
169	pxor	%xmm2,%xmm0
170	addl	$16,%edx
171	leal	-352(%ebx,%ecx,1),%ecx
172	jmp	.L002dec_entry
173.align	16
174.L003dec_loop:
175	movdqa	-32(%ebx),%xmm4
176	movdqa	-16(%ebx),%xmm1
177.byte	102,15,56,0,226
178.byte	102,15,56,0,203
179	pxor	%xmm4,%xmm0
180	movdqa	(%ebx),%xmm4
181	pxor	%xmm1,%xmm0
182	movdqa	16(%ebx),%xmm1
183.byte	102,15,56,0,226
184.byte	102,15,56,0,197
185.byte	102,15,56,0,203
186	pxor	%xmm4,%xmm0
187	movdqa	32(%ebx),%xmm4
188	pxor	%xmm1,%xmm0
189	movdqa	48(%ebx),%xmm1
190.byte	102,15,56,0,226
191.byte	102,15,56,0,197
192.byte	102,15,56,0,203
193	pxor	%xmm4,%xmm0
194	movdqa	64(%ebx),%xmm4
195	pxor	%xmm1,%xmm0
196	movdqa	80(%ebx),%xmm1
197.byte	102,15,56,0,226
198.byte	102,15,56,0,197
199.byte	102,15,56,0,203
200	pxor	%xmm4,%xmm0
201	addl	$16,%edx
202.byte	102,15,58,15,237,12
203	pxor	%xmm1,%xmm0
204	subl	$1,%eax
205.L002dec_entry:
206	movdqa	%xmm6,%xmm1
207	movdqa	-32(%ebp),%xmm2
208	pandn	%xmm0,%xmm1
209	pand	%xmm6,%xmm0
210	psrld	$4,%xmm1
211.byte	102,15,56,0,208
212	movdqa	%xmm7,%xmm3
213	pxor	%xmm1,%xmm0
214.byte	102,15,56,0,217
215	movdqa	%xmm7,%xmm4
216	pxor	%xmm2,%xmm3
217.byte	102,15,56,0,224
218	pxor	%xmm2,%xmm4
219	movdqa	%xmm7,%xmm2
220.byte	102,15,56,0,211
221	movdqa	%xmm7,%xmm3
222	pxor	%xmm0,%xmm2
223.byte	102,15,56,0,220
224	movdqu	(%edx),%xmm0
225	pxor	%xmm1,%xmm3
226	jnz	.L003dec_loop
227	movdqa	96(%ebx),%xmm4
228.byte	102,15,56,0,226
229	pxor	%xmm0,%xmm4
230	movdqa	112(%ebx),%xmm0
231	movdqa	(%ecx),%xmm2
232.byte	102,15,56,0,195
233	pxor	%xmm4,%xmm0
234.byte	102,15,56,0,194
235	ret
236.size	_vpaes_decrypt_core,.-_vpaes_decrypt_core
237.hidden	_vpaes_schedule_core
238.type	_vpaes_schedule_core,@function
239.align	16
240_vpaes_schedule_core:
241	addl	(%esp),%ebp
242	movdqu	(%esi),%xmm0
243	movdqa	320(%ebp),%xmm2
244	movdqa	%xmm0,%xmm3
245	leal	(%ebp),%ebx
246	movdqa	%xmm2,4(%esp)
247	call	_vpaes_schedule_transform
248	movdqa	%xmm0,%xmm7
249	testl	%edi,%edi
250	jnz	.L004schedule_am_decrypting
251	movdqu	%xmm0,(%edx)
252	jmp	.L005schedule_go
253.L004schedule_am_decrypting:
254	movdqa	256(%ebp,%ecx,1),%xmm1
255.byte	102,15,56,0,217
256	movdqu	%xmm3,(%edx)
257	xorl	$48,%ecx
258.L005schedule_go:
259	cmpl	$192,%eax
260	ja	.L006schedule_256
261	je	.L007schedule_192
262.L008schedule_128:
263	movl	$10,%eax
264.L009loop_schedule_128:
265	call	_vpaes_schedule_round
266	decl	%eax
267	jz	.L010schedule_mangle_last
268	call	_vpaes_schedule_mangle
269	jmp	.L009loop_schedule_128
270.align	16
271.L007schedule_192:
272	movdqu	8(%esi),%xmm0
273	call	_vpaes_schedule_transform
274	movdqa	%xmm0,%xmm6
275	pxor	%xmm4,%xmm4
276	movhlps	%xmm4,%xmm6
277	movl	$4,%eax
278.L011loop_schedule_192:
279	call	_vpaes_schedule_round
280.byte	102,15,58,15,198,8
281	call	_vpaes_schedule_mangle
282	call	_vpaes_schedule_192_smear
283	call	_vpaes_schedule_mangle
284	call	_vpaes_schedule_round
285	decl	%eax
286	jz	.L010schedule_mangle_last
287	call	_vpaes_schedule_mangle
288	call	_vpaes_schedule_192_smear
289	jmp	.L011loop_schedule_192
290.align	16
291.L006schedule_256:
292	movdqu	16(%esi),%xmm0
293	call	_vpaes_schedule_transform
294	movl	$7,%eax
295.L012loop_schedule_256:
296	call	_vpaes_schedule_mangle
297	movdqa	%xmm0,%xmm6
298	call	_vpaes_schedule_round
299	decl	%eax
300	jz	.L010schedule_mangle_last
301	call	_vpaes_schedule_mangle
302	pshufd	$255,%xmm0,%xmm0
303	movdqa	%xmm7,20(%esp)
304	movdqa	%xmm6,%xmm7
305	call	.L_vpaes_schedule_low_round
306	movdqa	20(%esp),%xmm7
307	jmp	.L012loop_schedule_256
308.align	16
309.L010schedule_mangle_last:
310	leal	384(%ebp),%ebx
311	testl	%edi,%edi
312	jnz	.L013schedule_mangle_last_dec
313	movdqa	256(%ebp,%ecx,1),%xmm1
314.byte	102,15,56,0,193
315	leal	352(%ebp),%ebx
316	addl	$32,%edx
317.L013schedule_mangle_last_dec:
318	addl	$-16,%edx
319	pxor	336(%ebp),%xmm0
320	call	_vpaes_schedule_transform
321	movdqu	%xmm0,(%edx)
322	pxor	%xmm0,%xmm0
323	pxor	%xmm1,%xmm1
324	pxor	%xmm2,%xmm2
325	pxor	%xmm3,%xmm3
326	pxor	%xmm4,%xmm4
327	pxor	%xmm5,%xmm5
328	pxor	%xmm6,%xmm6
329	pxor	%xmm7,%xmm7
330	ret
331.size	_vpaes_schedule_core,.-_vpaes_schedule_core
332.hidden	_vpaes_schedule_192_smear
333.type	_vpaes_schedule_192_smear,@function
334.align	16
335_vpaes_schedule_192_smear:
336	pshufd	$128,%xmm6,%xmm1
337	pshufd	$254,%xmm7,%xmm0
338	pxor	%xmm1,%xmm6
339	pxor	%xmm1,%xmm1
340	pxor	%xmm0,%xmm6
341	movdqa	%xmm6,%xmm0
342	movhlps	%xmm1,%xmm6
343	ret
344.size	_vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear
345.hidden	_vpaes_schedule_round
346.type	_vpaes_schedule_round,@function
347.align	16
348_vpaes_schedule_round:
349	movdqa	8(%esp),%xmm2
350	pxor	%xmm1,%xmm1
351.byte	102,15,58,15,202,15
352.byte	102,15,58,15,210,15
353	pxor	%xmm1,%xmm7
354	pshufd	$255,%xmm0,%xmm0
355.byte	102,15,58,15,192,1
356	movdqa	%xmm2,8(%esp)
357.L_vpaes_schedule_low_round:
358	movdqa	%xmm7,%xmm1
359	pslldq	$4,%xmm7
360	pxor	%xmm1,%xmm7
361	movdqa	%xmm7,%xmm1
362	pslldq	$8,%xmm7
363	pxor	%xmm1,%xmm7
364	pxor	336(%ebp),%xmm7
365	movdqa	-16(%ebp),%xmm4
366	movdqa	-48(%ebp),%xmm5
367	movdqa	%xmm4,%xmm1
368	pandn	%xmm0,%xmm1
369	psrld	$4,%xmm1
370	pand	%xmm4,%xmm0
371	movdqa	-32(%ebp),%xmm2
372.byte	102,15,56,0,208
373	pxor	%xmm1,%xmm0
374	movdqa	%xmm5,%xmm3
375.byte	102,15,56,0,217
376	pxor	%xmm2,%xmm3
377	movdqa	%xmm5,%xmm4
378.byte	102,15,56,0,224
379	pxor	%xmm2,%xmm4
380	movdqa	%xmm5,%xmm2
381.byte	102,15,56,0,211
382	pxor	%xmm0,%xmm2
383	movdqa	%xmm5,%xmm3
384.byte	102,15,56,0,220
385	pxor	%xmm1,%xmm3
386	movdqa	32(%ebp),%xmm4
387.byte	102,15,56,0,226
388	movdqa	48(%ebp),%xmm0
389.byte	102,15,56,0,195
390	pxor	%xmm4,%xmm0
391	pxor	%xmm7,%xmm0
392	movdqa	%xmm0,%xmm7
393	ret
394.size	_vpaes_schedule_round,.-_vpaes_schedule_round
395.hidden	_vpaes_schedule_transform
396.type	_vpaes_schedule_transform,@function
397.align	16
398_vpaes_schedule_transform:
399	movdqa	-16(%ebp),%xmm2
400	movdqa	%xmm2,%xmm1
401	pandn	%xmm0,%xmm1
402	psrld	$4,%xmm1
403	pand	%xmm2,%xmm0
404	movdqa	(%ebx),%xmm2
405.byte	102,15,56,0,208
406	movdqa	16(%ebx),%xmm0
407.byte	102,15,56,0,193
408	pxor	%xmm2,%xmm0
409	ret
410.size	_vpaes_schedule_transform,.-_vpaes_schedule_transform
411.hidden	_vpaes_schedule_mangle
412.type	_vpaes_schedule_mangle,@function
413.align	16
414_vpaes_schedule_mangle:
415	movdqa	%xmm0,%xmm4
416	movdqa	128(%ebp),%xmm5
417	testl	%edi,%edi
418	jnz	.L014schedule_mangle_dec
419	addl	$16,%edx
420	pxor	336(%ebp),%xmm4
421.byte	102,15,56,0,229
422	movdqa	%xmm4,%xmm3
423.byte	102,15,56,0,229
424	pxor	%xmm4,%xmm3
425.byte	102,15,56,0,229
426	pxor	%xmm4,%xmm3
427	jmp	.L015schedule_mangle_both
428.align	16
429.L014schedule_mangle_dec:
430	movdqa	-16(%ebp),%xmm2
431	leal	416(%ebp),%esi
432	movdqa	%xmm2,%xmm1
433	pandn	%xmm4,%xmm1
434	psrld	$4,%xmm1
435	pand	%xmm2,%xmm4
436	movdqa	(%esi),%xmm2
437.byte	102,15,56,0,212
438	movdqa	16(%esi),%xmm3
439.byte	102,15,56,0,217
440	pxor	%xmm2,%xmm3
441.byte	102,15,56,0,221
442	movdqa	32(%esi),%xmm2
443.byte	102,15,56,0,212
444	pxor	%xmm3,%xmm2
445	movdqa	48(%esi),%xmm3
446.byte	102,15,56,0,217
447	pxor	%xmm2,%xmm3
448.byte	102,15,56,0,221
449	movdqa	64(%esi),%xmm2
450.byte	102,15,56,0,212
451	pxor	%xmm3,%xmm2
452	movdqa	80(%esi),%xmm3
453.byte	102,15,56,0,217
454	pxor	%xmm2,%xmm3
455.byte	102,15,56,0,221
456	movdqa	96(%esi),%xmm2
457.byte	102,15,56,0,212
458	pxor	%xmm3,%xmm2
459	movdqa	112(%esi),%xmm3
460.byte	102,15,56,0,217
461	pxor	%xmm2,%xmm3
462	addl	$-16,%edx
463.L015schedule_mangle_both:
464	movdqa	256(%ebp,%ecx,1),%xmm1
465.byte	102,15,56,0,217
466	addl	$-16,%ecx
467	andl	$48,%ecx
468	movdqu	%xmm3,(%edx)
469	ret
470.size	_vpaes_schedule_mangle,.-_vpaes_schedule_mangle
471.globl	vpaes_set_encrypt_key
472.hidden	vpaes_set_encrypt_key
473.type	vpaes_set_encrypt_key,@function
474.align	16
475vpaes_set_encrypt_key:
476.L_vpaes_set_encrypt_key_begin:
477	pushl	%ebp
478	pushl	%ebx
479	pushl	%esi
480	pushl	%edi
481	movl	20(%esp),%esi
482	leal	-56(%esp),%ebx
483	movl	24(%esp),%eax
484	andl	$-16,%ebx
485	movl	28(%esp),%edx
486	xchgl	%esp,%ebx
487	movl	%ebx,48(%esp)
488	movl	%eax,%ebx
489	shrl	$5,%ebx
490	addl	$5,%ebx
491	movl	%ebx,240(%edx)
492	movl	$48,%ecx
493	movl	$0,%edi
494	leal	.L_vpaes_consts+0x30-.L016pic_point,%ebp
495	call	_vpaes_schedule_core
496.L016pic_point:
497	movl	48(%esp),%esp
498	xorl	%eax,%eax
499	popl	%edi
500	popl	%esi
501	popl	%ebx
502	popl	%ebp
503	ret
504.size	vpaes_set_encrypt_key,.-.L_vpaes_set_encrypt_key_begin
505.globl	vpaes_set_decrypt_key
506.hidden	vpaes_set_decrypt_key
507.type	vpaes_set_decrypt_key,@function
508.align	16
509vpaes_set_decrypt_key:
510.L_vpaes_set_decrypt_key_begin:
511	pushl	%ebp
512	pushl	%ebx
513	pushl	%esi
514	pushl	%edi
515	movl	20(%esp),%esi
516	leal	-56(%esp),%ebx
517	movl	24(%esp),%eax
518	andl	$-16,%ebx
519	movl	28(%esp),%edx
520	xchgl	%esp,%ebx
521	movl	%ebx,48(%esp)
522	movl	%eax,%ebx
523	shrl	$5,%ebx
524	addl	$5,%ebx
525	movl	%ebx,240(%edx)
526	shll	$4,%ebx
527	leal	16(%edx,%ebx,1),%edx
528	movl	$1,%edi
529	movl	%eax,%ecx
530	shrl	$1,%ecx
531	andl	$32,%ecx
532	xorl	$32,%ecx
533	leal	.L_vpaes_consts+0x30-.L017pic_point,%ebp
534	call	_vpaes_schedule_core
535.L017pic_point:
536	movl	48(%esp),%esp
537	xorl	%eax,%eax
538	popl	%edi
539	popl	%esi
540	popl	%ebx
541	popl	%ebp
542	ret
543.size	vpaes_set_decrypt_key,.-.L_vpaes_set_decrypt_key_begin
544.globl	vpaes_encrypt
545.hidden	vpaes_encrypt
546.type	vpaes_encrypt,@function
547.align	16
548vpaes_encrypt:
549.L_vpaes_encrypt_begin:
550	pushl	%ebp
551	pushl	%ebx
552	pushl	%esi
553	pushl	%edi
554	leal	.L_vpaes_consts+0x30-.L018pic_point,%ebp
555	call	_vpaes_preheat
556.L018pic_point:
557	movl	20(%esp),%esi
558	leal	-56(%esp),%ebx
559	movl	24(%esp),%edi
560	andl	$-16,%ebx
561	movl	28(%esp),%edx
562	xchgl	%esp,%ebx
563	movl	%ebx,48(%esp)
564	movdqu	(%esi),%xmm0
565	call	_vpaes_encrypt_core
566	movdqu	%xmm0,(%edi)
567	movl	48(%esp),%esp
568	popl	%edi
569	popl	%esi
570	popl	%ebx
571	popl	%ebp
572	ret
573.size	vpaes_encrypt,.-.L_vpaes_encrypt_begin
574.globl	vpaes_decrypt
575.hidden	vpaes_decrypt
576.type	vpaes_decrypt,@function
577.align	16
578vpaes_decrypt:
579.L_vpaes_decrypt_begin:
580	pushl	%ebp
581	pushl	%ebx
582	pushl	%esi
583	pushl	%edi
584	leal	.L_vpaes_consts+0x30-.L019pic_point,%ebp
585	call	_vpaes_preheat
586.L019pic_point:
587	movl	20(%esp),%esi
588	leal	-56(%esp),%ebx
589	movl	24(%esp),%edi
590	andl	$-16,%ebx
591	movl	28(%esp),%edx
592	xchgl	%esp,%ebx
593	movl	%ebx,48(%esp)
594	movdqu	(%esi),%xmm0
595	call	_vpaes_decrypt_core
596	movdqu	%xmm0,(%edi)
597	movl	48(%esp),%esp
598	popl	%edi
599	popl	%esi
600	popl	%ebx
601	popl	%ebp
602	ret
603.size	vpaes_decrypt,.-.L_vpaes_decrypt_begin
604.globl	vpaes_cbc_encrypt
605.hidden	vpaes_cbc_encrypt
606.type	vpaes_cbc_encrypt,@function
607.align	16
608vpaes_cbc_encrypt:
609.L_vpaes_cbc_encrypt_begin:
610	pushl	%ebp
611	pushl	%ebx
612	pushl	%esi
613	pushl	%edi
614	movl	20(%esp),%esi
615	movl	24(%esp),%edi
616	movl	28(%esp),%eax
617	movl	32(%esp),%edx
618	subl	$16,%eax
619	jc	.L020cbc_abort
620	leal	-56(%esp),%ebx
621	movl	36(%esp),%ebp
622	andl	$-16,%ebx
623	movl	40(%esp),%ecx
624	xchgl	%esp,%ebx
625	movdqu	(%ebp),%xmm1
626	subl	%esi,%edi
627	movl	%ebx,48(%esp)
628	movl	%edi,(%esp)
629	movl	%edx,4(%esp)
630	movl	%ebp,8(%esp)
631	movl	%eax,%edi
632	leal	.L_vpaes_consts+0x30-.L021pic_point,%ebp
633	call	_vpaes_preheat
634.L021pic_point:
635	cmpl	$0,%ecx
636	je	.L022cbc_dec_loop
637	jmp	.L023cbc_enc_loop
638.align	16
639.L023cbc_enc_loop:
640	movdqu	(%esi),%xmm0
641	pxor	%xmm1,%xmm0
642	call	_vpaes_encrypt_core
643	movl	(%esp),%ebx
644	movl	4(%esp),%edx
645	movdqa	%xmm0,%xmm1
646	movdqu	%xmm0,(%ebx,%esi,1)
647	leal	16(%esi),%esi
648	subl	$16,%edi
649	jnc	.L023cbc_enc_loop
650	jmp	.L024cbc_done
651.align	16
652.L022cbc_dec_loop:
653	movdqu	(%esi),%xmm0
654	movdqa	%xmm1,16(%esp)
655	movdqa	%xmm0,32(%esp)
656	call	_vpaes_decrypt_core
657	movl	(%esp),%ebx
658	movl	4(%esp),%edx
659	pxor	16(%esp),%xmm0
660	movdqa	32(%esp),%xmm1
661	movdqu	%xmm0,(%ebx,%esi,1)
662	leal	16(%esi),%esi
663	subl	$16,%edi
664	jnc	.L022cbc_dec_loop
665.L024cbc_done:
666	movl	8(%esp),%ebx
667	movl	48(%esp),%esp
668	movdqu	%xmm1,(%ebx)
669.L020cbc_abort:
670	popl	%edi
671	popl	%esi
672	popl	%ebx
673	popl	%ebp
674	ret
675.size	vpaes_cbc_encrypt,.-.L_vpaes_cbc_encrypt_begin
676#endif
677