xref: /freebsd/sys/crypto/openssl/i386/cast-586.S (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1/* Do not modify. This file is auto-generated from cast-586.pl. */
2#ifdef PIC
3.text
4.globl	CAST_encrypt
5.type	CAST_encrypt,@function
6.align	16
7CAST_encrypt:
8.L_CAST_encrypt_begin:
9
10	pushl	%ebp
11	pushl	%ebx
12	movl	12(%esp),%ebx
13	movl	16(%esp),%ebp
14	pushl	%esi
15	pushl	%edi
16
17	movl	(%ebx),%edi
18	movl	4(%ebx),%esi
19
20	movl	128(%ebp),%eax
21	pushl	%eax
22	xorl	%eax,%eax
23
24	movl	(%ebp),%edx
25	movl	4(%ebp),%ecx
26	addl	%esi,%edx
27	roll	%cl,%edx
28	xorl	%ecx,%ecx
29	movl	$255,%ebx
30	movb	%dh,%cl
31	andl	%edx,%ebx
32	shrl	$16,%edx
33	xorl	%eax,%eax
34	movb	%dh,%al
35	andl	$255,%edx
36	movl	CAST_S_table0(,%ecx,4),%ecx
37	movl	CAST_S_table1(,%ebx,4),%ebx
38	xorl	%ebx,%ecx
39	movl	CAST_S_table2(,%eax,4),%ebx
40	subl	%ebx,%ecx
41	movl	CAST_S_table3(,%edx,4),%ebx
42	addl	%ebx,%ecx
43	xorl	%ecx,%edi
44
45	movl	8(%ebp),%edx
46	movl	12(%ebp),%ecx
47	xorl	%edi,%edx
48	roll	%cl,%edx
49	xorl	%ecx,%ecx
50	movl	$255,%ebx
51	movb	%dh,%cl
52	andl	%edx,%ebx
53	shrl	$16,%edx
54	xorl	%eax,%eax
55	movb	%dh,%al
56	andl	$255,%edx
57	movl	CAST_S_table0(,%ecx,4),%ecx
58	movl	CAST_S_table1(,%ebx,4),%ebx
59	subl	%ebx,%ecx
60	movl	CAST_S_table2(,%eax,4),%ebx
61	addl	%ebx,%ecx
62	movl	CAST_S_table3(,%edx,4),%ebx
63	xorl	%ebx,%ecx
64	xorl	%ecx,%esi
65
66	movl	16(%ebp),%edx
67	movl	20(%ebp),%ecx
68	subl	%esi,%edx
69	roll	%cl,%edx
70	xorl	%ecx,%ecx
71	movl	$255,%ebx
72	movb	%dh,%cl
73	andl	%edx,%ebx
74	shrl	$16,%edx
75	xorl	%eax,%eax
76	movb	%dh,%al
77	andl	$255,%edx
78	movl	CAST_S_table0(,%ecx,4),%ecx
79	movl	CAST_S_table1(,%ebx,4),%ebx
80	addl	%ebx,%ecx
81	movl	CAST_S_table2(,%eax,4),%ebx
82	xorl	%ebx,%ecx
83	movl	CAST_S_table3(,%edx,4),%ebx
84	subl	%ebx,%ecx
85	xorl	%ecx,%edi
86
87	movl	24(%ebp),%edx
88	movl	28(%ebp),%ecx
89	addl	%edi,%edx
90	roll	%cl,%edx
91	xorl	%ecx,%ecx
92	movl	$255,%ebx
93	movb	%dh,%cl
94	andl	%edx,%ebx
95	shrl	$16,%edx
96	xorl	%eax,%eax
97	movb	%dh,%al
98	andl	$255,%edx
99	movl	CAST_S_table0(,%ecx,4),%ecx
100	movl	CAST_S_table1(,%ebx,4),%ebx
101	xorl	%ebx,%ecx
102	movl	CAST_S_table2(,%eax,4),%ebx
103	subl	%ebx,%ecx
104	movl	CAST_S_table3(,%edx,4),%ebx
105	addl	%ebx,%ecx
106	xorl	%ecx,%esi
107
108	movl	32(%ebp),%edx
109	movl	36(%ebp),%ecx
110	xorl	%esi,%edx
111	roll	%cl,%edx
112	xorl	%ecx,%ecx
113	movl	$255,%ebx
114	movb	%dh,%cl
115	andl	%edx,%ebx
116	shrl	$16,%edx
117	xorl	%eax,%eax
118	movb	%dh,%al
119	andl	$255,%edx
120	movl	CAST_S_table0(,%ecx,4),%ecx
121	movl	CAST_S_table1(,%ebx,4),%ebx
122	subl	%ebx,%ecx
123	movl	CAST_S_table2(,%eax,4),%ebx
124	addl	%ebx,%ecx
125	movl	CAST_S_table3(,%edx,4),%ebx
126	xorl	%ebx,%ecx
127	xorl	%ecx,%edi
128
129	movl	40(%ebp),%edx
130	movl	44(%ebp),%ecx
131	subl	%edi,%edx
132	roll	%cl,%edx
133	xorl	%ecx,%ecx
134	movl	$255,%ebx
135	movb	%dh,%cl
136	andl	%edx,%ebx
137	shrl	$16,%edx
138	xorl	%eax,%eax
139	movb	%dh,%al
140	andl	$255,%edx
141	movl	CAST_S_table0(,%ecx,4),%ecx
142	movl	CAST_S_table1(,%ebx,4),%ebx
143	addl	%ebx,%ecx
144	movl	CAST_S_table2(,%eax,4),%ebx
145	xorl	%ebx,%ecx
146	movl	CAST_S_table3(,%edx,4),%ebx
147	subl	%ebx,%ecx
148	xorl	%ecx,%esi
149
150	movl	48(%ebp),%edx
151	movl	52(%ebp),%ecx
152	addl	%esi,%edx
153	roll	%cl,%edx
154	xorl	%ecx,%ecx
155	movl	$255,%ebx
156	movb	%dh,%cl
157	andl	%edx,%ebx
158	shrl	$16,%edx
159	xorl	%eax,%eax
160	movb	%dh,%al
161	andl	$255,%edx
162	movl	CAST_S_table0(,%ecx,4),%ecx
163	movl	CAST_S_table1(,%ebx,4),%ebx
164	xorl	%ebx,%ecx
165	movl	CAST_S_table2(,%eax,4),%ebx
166	subl	%ebx,%ecx
167	movl	CAST_S_table3(,%edx,4),%ebx
168	addl	%ebx,%ecx
169	xorl	%ecx,%edi
170
171	movl	56(%ebp),%edx
172	movl	60(%ebp),%ecx
173	xorl	%edi,%edx
174	roll	%cl,%edx
175	xorl	%ecx,%ecx
176	movl	$255,%ebx
177	movb	%dh,%cl
178	andl	%edx,%ebx
179	shrl	$16,%edx
180	xorl	%eax,%eax
181	movb	%dh,%al
182	andl	$255,%edx
183	movl	CAST_S_table0(,%ecx,4),%ecx
184	movl	CAST_S_table1(,%ebx,4),%ebx
185	subl	%ebx,%ecx
186	movl	CAST_S_table2(,%eax,4),%ebx
187	addl	%ebx,%ecx
188	movl	CAST_S_table3(,%edx,4),%ebx
189	xorl	%ebx,%ecx
190	xorl	%ecx,%esi
191
192	movl	64(%ebp),%edx
193	movl	68(%ebp),%ecx
194	subl	%esi,%edx
195	roll	%cl,%edx
196	xorl	%ecx,%ecx
197	movl	$255,%ebx
198	movb	%dh,%cl
199	andl	%edx,%ebx
200	shrl	$16,%edx
201	xorl	%eax,%eax
202	movb	%dh,%al
203	andl	$255,%edx
204	movl	CAST_S_table0(,%ecx,4),%ecx
205	movl	CAST_S_table1(,%ebx,4),%ebx
206	addl	%ebx,%ecx
207	movl	CAST_S_table2(,%eax,4),%ebx
208	xorl	%ebx,%ecx
209	movl	CAST_S_table3(,%edx,4),%ebx
210	subl	%ebx,%ecx
211	xorl	%ecx,%edi
212
213	movl	72(%ebp),%edx
214	movl	76(%ebp),%ecx
215	addl	%edi,%edx
216	roll	%cl,%edx
217	xorl	%ecx,%ecx
218	movl	$255,%ebx
219	movb	%dh,%cl
220	andl	%edx,%ebx
221	shrl	$16,%edx
222	xorl	%eax,%eax
223	movb	%dh,%al
224	andl	$255,%edx
225	movl	CAST_S_table0(,%ecx,4),%ecx
226	movl	CAST_S_table1(,%ebx,4),%ebx
227	xorl	%ebx,%ecx
228	movl	CAST_S_table2(,%eax,4),%ebx
229	subl	%ebx,%ecx
230	movl	CAST_S_table3(,%edx,4),%ebx
231	addl	%ebx,%ecx
232	xorl	%ecx,%esi
233
234	movl	80(%ebp),%edx
235	movl	84(%ebp),%ecx
236	xorl	%esi,%edx
237	roll	%cl,%edx
238	xorl	%ecx,%ecx
239	movl	$255,%ebx
240	movb	%dh,%cl
241	andl	%edx,%ebx
242	shrl	$16,%edx
243	xorl	%eax,%eax
244	movb	%dh,%al
245	andl	$255,%edx
246	movl	CAST_S_table0(,%ecx,4),%ecx
247	movl	CAST_S_table1(,%ebx,4),%ebx
248	subl	%ebx,%ecx
249	movl	CAST_S_table2(,%eax,4),%ebx
250	addl	%ebx,%ecx
251	movl	CAST_S_table3(,%edx,4),%ebx
252	xorl	%ebx,%ecx
253	xorl	%ecx,%edi
254
255	movl	88(%ebp),%edx
256	movl	92(%ebp),%ecx
257	subl	%edi,%edx
258	roll	%cl,%edx
259	xorl	%ecx,%ecx
260	movl	$255,%ebx
261	movb	%dh,%cl
262	andl	%edx,%ebx
263	shrl	$16,%edx
264	xorl	%eax,%eax
265	movb	%dh,%al
266	andl	$255,%edx
267	movl	CAST_S_table0(,%ecx,4),%ecx
268	movl	CAST_S_table1(,%ebx,4),%ebx
269	addl	%ebx,%ecx
270	movl	CAST_S_table2(,%eax,4),%ebx
271	xorl	%ebx,%ecx
272	movl	CAST_S_table3(,%edx,4),%ebx
273	subl	%ebx,%ecx
274	xorl	%ecx,%esi
275
276	popl	%edx
277	orl	%edx,%edx
278	jnz	.L000cast_enc_done
279
280	movl	96(%ebp),%edx
281	movl	100(%ebp),%ecx
282	addl	%esi,%edx
283	roll	%cl,%edx
284	xorl	%ecx,%ecx
285	movl	$255,%ebx
286	movb	%dh,%cl
287	andl	%edx,%ebx
288	shrl	$16,%edx
289	xorl	%eax,%eax
290	movb	%dh,%al
291	andl	$255,%edx
292	movl	CAST_S_table0(,%ecx,4),%ecx
293	movl	CAST_S_table1(,%ebx,4),%ebx
294	xorl	%ebx,%ecx
295	movl	CAST_S_table2(,%eax,4),%ebx
296	subl	%ebx,%ecx
297	movl	CAST_S_table3(,%edx,4),%ebx
298	addl	%ebx,%ecx
299	xorl	%ecx,%edi
300
301	movl	104(%ebp),%edx
302	movl	108(%ebp),%ecx
303	xorl	%edi,%edx
304	roll	%cl,%edx
305	xorl	%ecx,%ecx
306	movl	$255,%ebx
307	movb	%dh,%cl
308	andl	%edx,%ebx
309	shrl	$16,%edx
310	xorl	%eax,%eax
311	movb	%dh,%al
312	andl	$255,%edx
313	movl	CAST_S_table0(,%ecx,4),%ecx
314	movl	CAST_S_table1(,%ebx,4),%ebx
315	subl	%ebx,%ecx
316	movl	CAST_S_table2(,%eax,4),%ebx
317	addl	%ebx,%ecx
318	movl	CAST_S_table3(,%edx,4),%ebx
319	xorl	%ebx,%ecx
320	xorl	%ecx,%esi
321
322	movl	112(%ebp),%edx
323	movl	116(%ebp),%ecx
324	subl	%esi,%edx
325	roll	%cl,%edx
326	xorl	%ecx,%ecx
327	movl	$255,%ebx
328	movb	%dh,%cl
329	andl	%edx,%ebx
330	shrl	$16,%edx
331	xorl	%eax,%eax
332	movb	%dh,%al
333	andl	$255,%edx
334	movl	CAST_S_table0(,%ecx,4),%ecx
335	movl	CAST_S_table1(,%ebx,4),%ebx
336	addl	%ebx,%ecx
337	movl	CAST_S_table2(,%eax,4),%ebx
338	xorl	%ebx,%ecx
339	movl	CAST_S_table3(,%edx,4),%ebx
340	subl	%ebx,%ecx
341	xorl	%ecx,%edi
342
343	movl	120(%ebp),%edx
344	movl	124(%ebp),%ecx
345	addl	%edi,%edx
346	roll	%cl,%edx
347	xorl	%ecx,%ecx
348	movl	$255,%ebx
349	movb	%dh,%cl
350	andl	%edx,%ebx
351	shrl	$16,%edx
352	xorl	%eax,%eax
353	movb	%dh,%al
354	andl	$255,%edx
355	movl	CAST_S_table0(,%ecx,4),%ecx
356	movl	CAST_S_table1(,%ebx,4),%ebx
357	xorl	%ebx,%ecx
358	movl	CAST_S_table2(,%eax,4),%ebx
359	subl	%ebx,%ecx
360	movl	CAST_S_table3(,%edx,4),%ebx
361	addl	%ebx,%ecx
362	xorl	%ecx,%esi
363.L000cast_enc_done:
364	nop
365	movl	20(%esp),%eax
366	movl	%edi,4(%eax)
367	movl	%esi,(%eax)
368	popl	%edi
369	popl	%esi
370	popl	%ebx
371	popl	%ebp
372	ret
373.size	CAST_encrypt,.-.L_CAST_encrypt_begin
374.globl	CAST_decrypt
375.type	CAST_decrypt,@function
376.align	16
377CAST_decrypt:
378.L_CAST_decrypt_begin:
379
380	pushl	%ebp
381	pushl	%ebx
382	movl	12(%esp),%ebx
383	movl	16(%esp),%ebp
384	pushl	%esi
385	pushl	%edi
386
387	movl	(%ebx),%edi
388	movl	4(%ebx),%esi
389
390	movl	128(%ebp),%eax
391	orl	%eax,%eax
392	jnz	.L001cast_dec_skip
393	xorl	%eax,%eax
394
395	movl	120(%ebp),%edx
396	movl	124(%ebp),%ecx
397	addl	%esi,%edx
398	roll	%cl,%edx
399	xorl	%ecx,%ecx
400	movl	$255,%ebx
401	movb	%dh,%cl
402	andl	%edx,%ebx
403	shrl	$16,%edx
404	xorl	%eax,%eax
405	movb	%dh,%al
406	andl	$255,%edx
407	movl	CAST_S_table0(,%ecx,4),%ecx
408	movl	CAST_S_table1(,%ebx,4),%ebx
409	xorl	%ebx,%ecx
410	movl	CAST_S_table2(,%eax,4),%ebx
411	subl	%ebx,%ecx
412	movl	CAST_S_table3(,%edx,4),%ebx
413	addl	%ebx,%ecx
414	xorl	%ecx,%edi
415
416	movl	112(%ebp),%edx
417	movl	116(%ebp),%ecx
418	subl	%edi,%edx
419	roll	%cl,%edx
420	xorl	%ecx,%ecx
421	movl	$255,%ebx
422	movb	%dh,%cl
423	andl	%edx,%ebx
424	shrl	$16,%edx
425	xorl	%eax,%eax
426	movb	%dh,%al
427	andl	$255,%edx
428	movl	CAST_S_table0(,%ecx,4),%ecx
429	movl	CAST_S_table1(,%ebx,4),%ebx
430	addl	%ebx,%ecx
431	movl	CAST_S_table2(,%eax,4),%ebx
432	xorl	%ebx,%ecx
433	movl	CAST_S_table3(,%edx,4),%ebx
434	subl	%ebx,%ecx
435	xorl	%ecx,%esi
436
437	movl	104(%ebp),%edx
438	movl	108(%ebp),%ecx
439	xorl	%esi,%edx
440	roll	%cl,%edx
441	xorl	%ecx,%ecx
442	movl	$255,%ebx
443	movb	%dh,%cl
444	andl	%edx,%ebx
445	shrl	$16,%edx
446	xorl	%eax,%eax
447	movb	%dh,%al
448	andl	$255,%edx
449	movl	CAST_S_table0(,%ecx,4),%ecx
450	movl	CAST_S_table1(,%ebx,4),%ebx
451	subl	%ebx,%ecx
452	movl	CAST_S_table2(,%eax,4),%ebx
453	addl	%ebx,%ecx
454	movl	CAST_S_table3(,%edx,4),%ebx
455	xorl	%ebx,%ecx
456	xorl	%ecx,%edi
457
458	movl	96(%ebp),%edx
459	movl	100(%ebp),%ecx
460	addl	%edi,%edx
461	roll	%cl,%edx
462	xorl	%ecx,%ecx
463	movl	$255,%ebx
464	movb	%dh,%cl
465	andl	%edx,%ebx
466	shrl	$16,%edx
467	xorl	%eax,%eax
468	movb	%dh,%al
469	andl	$255,%edx
470	movl	CAST_S_table0(,%ecx,4),%ecx
471	movl	CAST_S_table1(,%ebx,4),%ebx
472	xorl	%ebx,%ecx
473	movl	CAST_S_table2(,%eax,4),%ebx
474	subl	%ebx,%ecx
475	movl	CAST_S_table3(,%edx,4),%ebx
476	addl	%ebx,%ecx
477	xorl	%ecx,%esi
478.L001cast_dec_skip:
479
480	movl	88(%ebp),%edx
481	movl	92(%ebp),%ecx
482	subl	%esi,%edx
483	roll	%cl,%edx
484	xorl	%ecx,%ecx
485	movl	$255,%ebx
486	movb	%dh,%cl
487	andl	%edx,%ebx
488	shrl	$16,%edx
489	xorl	%eax,%eax
490	movb	%dh,%al
491	andl	$255,%edx
492	movl	CAST_S_table0(,%ecx,4),%ecx
493	movl	CAST_S_table1(,%ebx,4),%ebx
494	addl	%ebx,%ecx
495	movl	CAST_S_table2(,%eax,4),%ebx
496	xorl	%ebx,%ecx
497	movl	CAST_S_table3(,%edx,4),%ebx
498	subl	%ebx,%ecx
499	xorl	%ecx,%edi
500
501	movl	80(%ebp),%edx
502	movl	84(%ebp),%ecx
503	xorl	%edi,%edx
504	roll	%cl,%edx
505	xorl	%ecx,%ecx
506	movl	$255,%ebx
507	movb	%dh,%cl
508	andl	%edx,%ebx
509	shrl	$16,%edx
510	xorl	%eax,%eax
511	movb	%dh,%al
512	andl	$255,%edx
513	movl	CAST_S_table0(,%ecx,4),%ecx
514	movl	CAST_S_table1(,%ebx,4),%ebx
515	subl	%ebx,%ecx
516	movl	CAST_S_table2(,%eax,4),%ebx
517	addl	%ebx,%ecx
518	movl	CAST_S_table3(,%edx,4),%ebx
519	xorl	%ebx,%ecx
520	xorl	%ecx,%esi
521
522	movl	72(%ebp),%edx
523	movl	76(%ebp),%ecx
524	addl	%esi,%edx
525	roll	%cl,%edx
526	xorl	%ecx,%ecx
527	movl	$255,%ebx
528	movb	%dh,%cl
529	andl	%edx,%ebx
530	shrl	$16,%edx
531	xorl	%eax,%eax
532	movb	%dh,%al
533	andl	$255,%edx
534	movl	CAST_S_table0(,%ecx,4),%ecx
535	movl	CAST_S_table1(,%ebx,4),%ebx
536	xorl	%ebx,%ecx
537	movl	CAST_S_table2(,%eax,4),%ebx
538	subl	%ebx,%ecx
539	movl	CAST_S_table3(,%edx,4),%ebx
540	addl	%ebx,%ecx
541	xorl	%ecx,%edi
542
543	movl	64(%ebp),%edx
544	movl	68(%ebp),%ecx
545	subl	%edi,%edx
546	roll	%cl,%edx
547	xorl	%ecx,%ecx
548	movl	$255,%ebx
549	movb	%dh,%cl
550	andl	%edx,%ebx
551	shrl	$16,%edx
552	xorl	%eax,%eax
553	movb	%dh,%al
554	andl	$255,%edx
555	movl	CAST_S_table0(,%ecx,4),%ecx
556	movl	CAST_S_table1(,%ebx,4),%ebx
557	addl	%ebx,%ecx
558	movl	CAST_S_table2(,%eax,4),%ebx
559	xorl	%ebx,%ecx
560	movl	CAST_S_table3(,%edx,4),%ebx
561	subl	%ebx,%ecx
562	xorl	%ecx,%esi
563
564	movl	56(%ebp),%edx
565	movl	60(%ebp),%ecx
566	xorl	%esi,%edx
567	roll	%cl,%edx
568	xorl	%ecx,%ecx
569	movl	$255,%ebx
570	movb	%dh,%cl
571	andl	%edx,%ebx
572	shrl	$16,%edx
573	xorl	%eax,%eax
574	movb	%dh,%al
575	andl	$255,%edx
576	movl	CAST_S_table0(,%ecx,4),%ecx
577	movl	CAST_S_table1(,%ebx,4),%ebx
578	subl	%ebx,%ecx
579	movl	CAST_S_table2(,%eax,4),%ebx
580	addl	%ebx,%ecx
581	movl	CAST_S_table3(,%edx,4),%ebx
582	xorl	%ebx,%ecx
583	xorl	%ecx,%edi
584
585	movl	48(%ebp),%edx
586	movl	52(%ebp),%ecx
587	addl	%edi,%edx
588	roll	%cl,%edx
589	xorl	%ecx,%ecx
590	movl	$255,%ebx
591	movb	%dh,%cl
592	andl	%edx,%ebx
593	shrl	$16,%edx
594	xorl	%eax,%eax
595	movb	%dh,%al
596	andl	$255,%edx
597	movl	CAST_S_table0(,%ecx,4),%ecx
598	movl	CAST_S_table1(,%ebx,4),%ebx
599	xorl	%ebx,%ecx
600	movl	CAST_S_table2(,%eax,4),%ebx
601	subl	%ebx,%ecx
602	movl	CAST_S_table3(,%edx,4),%ebx
603	addl	%ebx,%ecx
604	xorl	%ecx,%esi
605
606	movl	40(%ebp),%edx
607	movl	44(%ebp),%ecx
608	subl	%esi,%edx
609	roll	%cl,%edx
610	xorl	%ecx,%ecx
611	movl	$255,%ebx
612	movb	%dh,%cl
613	andl	%edx,%ebx
614	shrl	$16,%edx
615	xorl	%eax,%eax
616	movb	%dh,%al
617	andl	$255,%edx
618	movl	CAST_S_table0(,%ecx,4),%ecx
619	movl	CAST_S_table1(,%ebx,4),%ebx
620	addl	%ebx,%ecx
621	movl	CAST_S_table2(,%eax,4),%ebx
622	xorl	%ebx,%ecx
623	movl	CAST_S_table3(,%edx,4),%ebx
624	subl	%ebx,%ecx
625	xorl	%ecx,%edi
626
627	movl	32(%ebp),%edx
628	movl	36(%ebp),%ecx
629	xorl	%edi,%edx
630	roll	%cl,%edx
631	xorl	%ecx,%ecx
632	movl	$255,%ebx
633	movb	%dh,%cl
634	andl	%edx,%ebx
635	shrl	$16,%edx
636	xorl	%eax,%eax
637	movb	%dh,%al
638	andl	$255,%edx
639	movl	CAST_S_table0(,%ecx,4),%ecx
640	movl	CAST_S_table1(,%ebx,4),%ebx
641	subl	%ebx,%ecx
642	movl	CAST_S_table2(,%eax,4),%ebx
643	addl	%ebx,%ecx
644	movl	CAST_S_table3(,%edx,4),%ebx
645	xorl	%ebx,%ecx
646	xorl	%ecx,%esi
647
648	movl	24(%ebp),%edx
649	movl	28(%ebp),%ecx
650	addl	%esi,%edx
651	roll	%cl,%edx
652	xorl	%ecx,%ecx
653	movl	$255,%ebx
654	movb	%dh,%cl
655	andl	%edx,%ebx
656	shrl	$16,%edx
657	xorl	%eax,%eax
658	movb	%dh,%al
659	andl	$255,%edx
660	movl	CAST_S_table0(,%ecx,4),%ecx
661	movl	CAST_S_table1(,%ebx,4),%ebx
662	xorl	%ebx,%ecx
663	movl	CAST_S_table2(,%eax,4),%ebx
664	subl	%ebx,%ecx
665	movl	CAST_S_table3(,%edx,4),%ebx
666	addl	%ebx,%ecx
667	xorl	%ecx,%edi
668
669	movl	16(%ebp),%edx
670	movl	20(%ebp),%ecx
671	subl	%edi,%edx
672	roll	%cl,%edx
673	xorl	%ecx,%ecx
674	movl	$255,%ebx
675	movb	%dh,%cl
676	andl	%edx,%ebx
677	shrl	$16,%edx
678	xorl	%eax,%eax
679	movb	%dh,%al
680	andl	$255,%edx
681	movl	CAST_S_table0(,%ecx,4),%ecx
682	movl	CAST_S_table1(,%ebx,4),%ebx
683	addl	%ebx,%ecx
684	movl	CAST_S_table2(,%eax,4),%ebx
685	xorl	%ebx,%ecx
686	movl	CAST_S_table3(,%edx,4),%ebx
687	subl	%ebx,%ecx
688	xorl	%ecx,%esi
689
690	movl	8(%ebp),%edx
691	movl	12(%ebp),%ecx
692	xorl	%esi,%edx
693	roll	%cl,%edx
694	xorl	%ecx,%ecx
695	movl	$255,%ebx
696	movb	%dh,%cl
697	andl	%edx,%ebx
698	shrl	$16,%edx
699	xorl	%eax,%eax
700	movb	%dh,%al
701	andl	$255,%edx
702	movl	CAST_S_table0(,%ecx,4),%ecx
703	movl	CAST_S_table1(,%ebx,4),%ebx
704	subl	%ebx,%ecx
705	movl	CAST_S_table2(,%eax,4),%ebx
706	addl	%ebx,%ecx
707	movl	CAST_S_table3(,%edx,4),%ebx
708	xorl	%ebx,%ecx
709	xorl	%ecx,%edi
710
711	movl	(%ebp),%edx
712	movl	4(%ebp),%ecx
713	addl	%edi,%edx
714	roll	%cl,%edx
715	xorl	%ecx,%ecx
716	movl	$255,%ebx
717	movb	%dh,%cl
718	andl	%edx,%ebx
719	shrl	$16,%edx
720	xorl	%eax,%eax
721	movb	%dh,%al
722	andl	$255,%edx
723	movl	CAST_S_table0(,%ecx,4),%ecx
724	movl	CAST_S_table1(,%ebx,4),%ebx
725	xorl	%ebx,%ecx
726	movl	CAST_S_table2(,%eax,4),%ebx
727	subl	%ebx,%ecx
728	movl	CAST_S_table3(,%edx,4),%ebx
729	addl	%ebx,%ecx
730	xorl	%ecx,%esi
731	nop
732	movl	20(%esp),%eax
733	movl	%edi,4(%eax)
734	movl	%esi,(%eax)
735	popl	%edi
736	popl	%esi
737	popl	%ebx
738	popl	%ebp
739	ret
740.size	CAST_decrypt,.-.L_CAST_decrypt_begin
741.globl	CAST_cbc_encrypt
742.type	CAST_cbc_encrypt,@function
743.align	16
744CAST_cbc_encrypt:
745.L_CAST_cbc_encrypt_begin:
746
747	pushl	%ebp
748	pushl	%ebx
749	pushl	%esi
750	pushl	%edi
751	movl	28(%esp),%ebp
752
753	movl	36(%esp),%ebx
754	movl	(%ebx),%esi
755	movl	4(%ebx),%edi
756	pushl	%edi
757	pushl	%esi
758	pushl	%edi
759	pushl	%esi
760	movl	%esp,%ebx
761	movl	36(%esp),%esi
762	movl	40(%esp),%edi
763
764	movl	56(%esp),%ecx
765
766	movl	48(%esp),%eax
767	pushl	%eax
768	pushl	%ebx
769	cmpl	$0,%ecx
770	jz	.L002decrypt
771	andl	$4294967288,%ebp
772	movl	8(%esp),%eax
773	movl	12(%esp),%ebx
774	jz	.L003encrypt_finish
775.L004encrypt_loop:
776	movl	(%esi),%ecx
777	movl	4(%esi),%edx
778	xorl	%ecx,%eax
779	xorl	%edx,%ebx
780	bswap	%eax
781	bswap	%ebx
782	movl	%eax,8(%esp)
783	movl	%ebx,12(%esp)
784	call	.L_CAST_encrypt_begin
785	movl	8(%esp),%eax
786	movl	12(%esp),%ebx
787	bswap	%eax
788	bswap	%ebx
789	movl	%eax,(%edi)
790	movl	%ebx,4(%edi)
791	addl	$8,%esi
792	addl	$8,%edi
793	subl	$8,%ebp
794	jnz	.L004encrypt_loop
795.L003encrypt_finish:
796	movl	52(%esp),%ebp
797	andl	$7,%ebp
798	jz	.L005finish
799	call	.L006PIC_point
800.L006PIC_point:
801	popl	%edx
802	leal	.L007cbc_enc_jmp_table-.L006PIC_point(%edx),%ecx
803	movl	(%ecx,%ebp,4),%ebp
804	addl	%edx,%ebp
805	xorl	%ecx,%ecx
806	xorl	%edx,%edx
807	jmp	*%ebp
808.L008ej7:
809	movb	6(%esi),%dh
810	shll	$8,%edx
811.L009ej6:
812	movb	5(%esi),%dh
813.L010ej5:
814	movb	4(%esi),%dl
815.L011ej4:
816	movl	(%esi),%ecx
817	jmp	.L012ejend
818.L013ej3:
819	movb	2(%esi),%ch
820	shll	$8,%ecx
821.L014ej2:
822	movb	1(%esi),%ch
823.L015ej1:
824	movb	(%esi),%cl
825.L012ejend:
826	xorl	%ecx,%eax
827	xorl	%edx,%ebx
828	bswap	%eax
829	bswap	%ebx
830	movl	%eax,8(%esp)
831	movl	%ebx,12(%esp)
832	call	.L_CAST_encrypt_begin
833	movl	8(%esp),%eax
834	movl	12(%esp),%ebx
835	bswap	%eax
836	bswap	%ebx
837	movl	%eax,(%edi)
838	movl	%ebx,4(%edi)
839	jmp	.L005finish
840.L002decrypt:
841	andl	$4294967288,%ebp
842	movl	16(%esp),%eax
843	movl	20(%esp),%ebx
844	jz	.L016decrypt_finish
845.L017decrypt_loop:
846	movl	(%esi),%eax
847	movl	4(%esi),%ebx
848	bswap	%eax
849	bswap	%ebx
850	movl	%eax,8(%esp)
851	movl	%ebx,12(%esp)
852	call	.L_CAST_decrypt_begin
853	movl	8(%esp),%eax
854	movl	12(%esp),%ebx
855	bswap	%eax
856	bswap	%ebx
857	movl	16(%esp),%ecx
858	movl	20(%esp),%edx
859	xorl	%eax,%ecx
860	xorl	%ebx,%edx
861	movl	(%esi),%eax
862	movl	4(%esi),%ebx
863	movl	%ecx,(%edi)
864	movl	%edx,4(%edi)
865	movl	%eax,16(%esp)
866	movl	%ebx,20(%esp)
867	addl	$8,%esi
868	addl	$8,%edi
869	subl	$8,%ebp
870	jnz	.L017decrypt_loop
871.L016decrypt_finish:
872	movl	52(%esp),%ebp
873	andl	$7,%ebp
874	jz	.L005finish
875	movl	(%esi),%eax
876	movl	4(%esi),%ebx
877	bswap	%eax
878	bswap	%ebx
879	movl	%eax,8(%esp)
880	movl	%ebx,12(%esp)
881	call	.L_CAST_decrypt_begin
882	movl	8(%esp),%eax
883	movl	12(%esp),%ebx
884	bswap	%eax
885	bswap	%ebx
886	movl	16(%esp),%ecx
887	movl	20(%esp),%edx
888	xorl	%eax,%ecx
889	xorl	%ebx,%edx
890	movl	(%esi),%eax
891	movl	4(%esi),%ebx
892.L018dj7:
893	rorl	$16,%edx
894	movb	%dl,6(%edi)
895	shrl	$16,%edx
896.L019dj6:
897	movb	%dh,5(%edi)
898.L020dj5:
899	movb	%dl,4(%edi)
900.L021dj4:
901	movl	%ecx,(%edi)
902	jmp	.L022djend
903.L023dj3:
904	rorl	$16,%ecx
905	movb	%cl,2(%edi)
906	shll	$16,%ecx
907.L024dj2:
908	movb	%ch,1(%esi)
909.L025dj1:
910	movb	%cl,(%esi)
911.L022djend:
912	jmp	.L005finish
913.L005finish:
914	movl	60(%esp),%ecx
915	addl	$24,%esp
916	movl	%eax,(%ecx)
917	movl	%ebx,4(%ecx)
918	popl	%edi
919	popl	%esi
920	popl	%ebx
921	popl	%ebp
922	ret
923.align	64
924.L007cbc_enc_jmp_table:
925.long	0
926.long	.L015ej1-.L006PIC_point
927.long	.L014ej2-.L006PIC_point
928.long	.L013ej3-.L006PIC_point
929.long	.L011ej4-.L006PIC_point
930.long	.L010ej5-.L006PIC_point
931.long	.L009ej6-.L006PIC_point
932.long	.L008ej7-.L006PIC_point
933.align	64
934.size	CAST_cbc_encrypt,.-.L_CAST_cbc_encrypt_begin
935#else
936.text
937.globl	CAST_encrypt
938.type	CAST_encrypt,@function
939.align	16
940CAST_encrypt:
941.L_CAST_encrypt_begin:
942
943	pushl	%ebp
944	pushl	%ebx
945	movl	12(%esp),%ebx
946	movl	16(%esp),%ebp
947	pushl	%esi
948	pushl	%edi
949
950	movl	(%ebx),%edi
951	movl	4(%ebx),%esi
952
953	movl	128(%ebp),%eax
954	pushl	%eax
955	xorl	%eax,%eax
956
957	movl	(%ebp),%edx
958	movl	4(%ebp),%ecx
959	addl	%esi,%edx
960	roll	%cl,%edx
961	xorl	%ecx,%ecx
962	movl	$255,%ebx
963	movb	%dh,%cl
964	andl	%edx,%ebx
965	shrl	$16,%edx
966	xorl	%eax,%eax
967	movb	%dh,%al
968	andl	$255,%edx
969	movl	CAST_S_table0(,%ecx,4),%ecx
970	movl	CAST_S_table1(,%ebx,4),%ebx
971	xorl	%ebx,%ecx
972	movl	CAST_S_table2(,%eax,4),%ebx
973	subl	%ebx,%ecx
974	movl	CAST_S_table3(,%edx,4),%ebx
975	addl	%ebx,%ecx
976	xorl	%ecx,%edi
977
978	movl	8(%ebp),%edx
979	movl	12(%ebp),%ecx
980	xorl	%edi,%edx
981	roll	%cl,%edx
982	xorl	%ecx,%ecx
983	movl	$255,%ebx
984	movb	%dh,%cl
985	andl	%edx,%ebx
986	shrl	$16,%edx
987	xorl	%eax,%eax
988	movb	%dh,%al
989	andl	$255,%edx
990	movl	CAST_S_table0(,%ecx,4),%ecx
991	movl	CAST_S_table1(,%ebx,4),%ebx
992	subl	%ebx,%ecx
993	movl	CAST_S_table2(,%eax,4),%ebx
994	addl	%ebx,%ecx
995	movl	CAST_S_table3(,%edx,4),%ebx
996	xorl	%ebx,%ecx
997	xorl	%ecx,%esi
998
999	movl	16(%ebp),%edx
1000	movl	20(%ebp),%ecx
1001	subl	%esi,%edx
1002	roll	%cl,%edx
1003	xorl	%ecx,%ecx
1004	movl	$255,%ebx
1005	movb	%dh,%cl
1006	andl	%edx,%ebx
1007	shrl	$16,%edx
1008	xorl	%eax,%eax
1009	movb	%dh,%al
1010	andl	$255,%edx
1011	movl	CAST_S_table0(,%ecx,4),%ecx
1012	movl	CAST_S_table1(,%ebx,4),%ebx
1013	addl	%ebx,%ecx
1014	movl	CAST_S_table2(,%eax,4),%ebx
1015	xorl	%ebx,%ecx
1016	movl	CAST_S_table3(,%edx,4),%ebx
1017	subl	%ebx,%ecx
1018	xorl	%ecx,%edi
1019
1020	movl	24(%ebp),%edx
1021	movl	28(%ebp),%ecx
1022	addl	%edi,%edx
1023	roll	%cl,%edx
1024	xorl	%ecx,%ecx
1025	movl	$255,%ebx
1026	movb	%dh,%cl
1027	andl	%edx,%ebx
1028	shrl	$16,%edx
1029	xorl	%eax,%eax
1030	movb	%dh,%al
1031	andl	$255,%edx
1032	movl	CAST_S_table0(,%ecx,4),%ecx
1033	movl	CAST_S_table1(,%ebx,4),%ebx
1034	xorl	%ebx,%ecx
1035	movl	CAST_S_table2(,%eax,4),%ebx
1036	subl	%ebx,%ecx
1037	movl	CAST_S_table3(,%edx,4),%ebx
1038	addl	%ebx,%ecx
1039	xorl	%ecx,%esi
1040
1041	movl	32(%ebp),%edx
1042	movl	36(%ebp),%ecx
1043	xorl	%esi,%edx
1044	roll	%cl,%edx
1045	xorl	%ecx,%ecx
1046	movl	$255,%ebx
1047	movb	%dh,%cl
1048	andl	%edx,%ebx
1049	shrl	$16,%edx
1050	xorl	%eax,%eax
1051	movb	%dh,%al
1052	andl	$255,%edx
1053	movl	CAST_S_table0(,%ecx,4),%ecx
1054	movl	CAST_S_table1(,%ebx,4),%ebx
1055	subl	%ebx,%ecx
1056	movl	CAST_S_table2(,%eax,4),%ebx
1057	addl	%ebx,%ecx
1058	movl	CAST_S_table3(,%edx,4),%ebx
1059	xorl	%ebx,%ecx
1060	xorl	%ecx,%edi
1061
1062	movl	40(%ebp),%edx
1063	movl	44(%ebp),%ecx
1064	subl	%edi,%edx
1065	roll	%cl,%edx
1066	xorl	%ecx,%ecx
1067	movl	$255,%ebx
1068	movb	%dh,%cl
1069	andl	%edx,%ebx
1070	shrl	$16,%edx
1071	xorl	%eax,%eax
1072	movb	%dh,%al
1073	andl	$255,%edx
1074	movl	CAST_S_table0(,%ecx,4),%ecx
1075	movl	CAST_S_table1(,%ebx,4),%ebx
1076	addl	%ebx,%ecx
1077	movl	CAST_S_table2(,%eax,4),%ebx
1078	xorl	%ebx,%ecx
1079	movl	CAST_S_table3(,%edx,4),%ebx
1080	subl	%ebx,%ecx
1081	xorl	%ecx,%esi
1082
1083	movl	48(%ebp),%edx
1084	movl	52(%ebp),%ecx
1085	addl	%esi,%edx
1086	roll	%cl,%edx
1087	xorl	%ecx,%ecx
1088	movl	$255,%ebx
1089	movb	%dh,%cl
1090	andl	%edx,%ebx
1091	shrl	$16,%edx
1092	xorl	%eax,%eax
1093	movb	%dh,%al
1094	andl	$255,%edx
1095	movl	CAST_S_table0(,%ecx,4),%ecx
1096	movl	CAST_S_table1(,%ebx,4),%ebx
1097	xorl	%ebx,%ecx
1098	movl	CAST_S_table2(,%eax,4),%ebx
1099	subl	%ebx,%ecx
1100	movl	CAST_S_table3(,%edx,4),%ebx
1101	addl	%ebx,%ecx
1102	xorl	%ecx,%edi
1103
1104	movl	56(%ebp),%edx
1105	movl	60(%ebp),%ecx
1106	xorl	%edi,%edx
1107	roll	%cl,%edx
1108	xorl	%ecx,%ecx
1109	movl	$255,%ebx
1110	movb	%dh,%cl
1111	andl	%edx,%ebx
1112	shrl	$16,%edx
1113	xorl	%eax,%eax
1114	movb	%dh,%al
1115	andl	$255,%edx
1116	movl	CAST_S_table0(,%ecx,4),%ecx
1117	movl	CAST_S_table1(,%ebx,4),%ebx
1118	subl	%ebx,%ecx
1119	movl	CAST_S_table2(,%eax,4),%ebx
1120	addl	%ebx,%ecx
1121	movl	CAST_S_table3(,%edx,4),%ebx
1122	xorl	%ebx,%ecx
1123	xorl	%ecx,%esi
1124
1125	movl	64(%ebp),%edx
1126	movl	68(%ebp),%ecx
1127	subl	%esi,%edx
1128	roll	%cl,%edx
1129	xorl	%ecx,%ecx
1130	movl	$255,%ebx
1131	movb	%dh,%cl
1132	andl	%edx,%ebx
1133	shrl	$16,%edx
1134	xorl	%eax,%eax
1135	movb	%dh,%al
1136	andl	$255,%edx
1137	movl	CAST_S_table0(,%ecx,4),%ecx
1138	movl	CAST_S_table1(,%ebx,4),%ebx
1139	addl	%ebx,%ecx
1140	movl	CAST_S_table2(,%eax,4),%ebx
1141	xorl	%ebx,%ecx
1142	movl	CAST_S_table3(,%edx,4),%ebx
1143	subl	%ebx,%ecx
1144	xorl	%ecx,%edi
1145
1146	movl	72(%ebp),%edx
1147	movl	76(%ebp),%ecx
1148	addl	%edi,%edx
1149	roll	%cl,%edx
1150	xorl	%ecx,%ecx
1151	movl	$255,%ebx
1152	movb	%dh,%cl
1153	andl	%edx,%ebx
1154	shrl	$16,%edx
1155	xorl	%eax,%eax
1156	movb	%dh,%al
1157	andl	$255,%edx
1158	movl	CAST_S_table0(,%ecx,4),%ecx
1159	movl	CAST_S_table1(,%ebx,4),%ebx
1160	xorl	%ebx,%ecx
1161	movl	CAST_S_table2(,%eax,4),%ebx
1162	subl	%ebx,%ecx
1163	movl	CAST_S_table3(,%edx,4),%ebx
1164	addl	%ebx,%ecx
1165	xorl	%ecx,%esi
1166
1167	movl	80(%ebp),%edx
1168	movl	84(%ebp),%ecx
1169	xorl	%esi,%edx
1170	roll	%cl,%edx
1171	xorl	%ecx,%ecx
1172	movl	$255,%ebx
1173	movb	%dh,%cl
1174	andl	%edx,%ebx
1175	shrl	$16,%edx
1176	xorl	%eax,%eax
1177	movb	%dh,%al
1178	andl	$255,%edx
1179	movl	CAST_S_table0(,%ecx,4),%ecx
1180	movl	CAST_S_table1(,%ebx,4),%ebx
1181	subl	%ebx,%ecx
1182	movl	CAST_S_table2(,%eax,4),%ebx
1183	addl	%ebx,%ecx
1184	movl	CAST_S_table3(,%edx,4),%ebx
1185	xorl	%ebx,%ecx
1186	xorl	%ecx,%edi
1187
1188	movl	88(%ebp),%edx
1189	movl	92(%ebp),%ecx
1190	subl	%edi,%edx
1191	roll	%cl,%edx
1192	xorl	%ecx,%ecx
1193	movl	$255,%ebx
1194	movb	%dh,%cl
1195	andl	%edx,%ebx
1196	shrl	$16,%edx
1197	xorl	%eax,%eax
1198	movb	%dh,%al
1199	andl	$255,%edx
1200	movl	CAST_S_table0(,%ecx,4),%ecx
1201	movl	CAST_S_table1(,%ebx,4),%ebx
1202	addl	%ebx,%ecx
1203	movl	CAST_S_table2(,%eax,4),%ebx
1204	xorl	%ebx,%ecx
1205	movl	CAST_S_table3(,%edx,4),%ebx
1206	subl	%ebx,%ecx
1207	xorl	%ecx,%esi
1208
1209	popl	%edx
1210	orl	%edx,%edx
1211	jnz	.L000cast_enc_done
1212
1213	movl	96(%ebp),%edx
1214	movl	100(%ebp),%ecx
1215	addl	%esi,%edx
1216	roll	%cl,%edx
1217	xorl	%ecx,%ecx
1218	movl	$255,%ebx
1219	movb	%dh,%cl
1220	andl	%edx,%ebx
1221	shrl	$16,%edx
1222	xorl	%eax,%eax
1223	movb	%dh,%al
1224	andl	$255,%edx
1225	movl	CAST_S_table0(,%ecx,4),%ecx
1226	movl	CAST_S_table1(,%ebx,4),%ebx
1227	xorl	%ebx,%ecx
1228	movl	CAST_S_table2(,%eax,4),%ebx
1229	subl	%ebx,%ecx
1230	movl	CAST_S_table3(,%edx,4),%ebx
1231	addl	%ebx,%ecx
1232	xorl	%ecx,%edi
1233
1234	movl	104(%ebp),%edx
1235	movl	108(%ebp),%ecx
1236	xorl	%edi,%edx
1237	roll	%cl,%edx
1238	xorl	%ecx,%ecx
1239	movl	$255,%ebx
1240	movb	%dh,%cl
1241	andl	%edx,%ebx
1242	shrl	$16,%edx
1243	xorl	%eax,%eax
1244	movb	%dh,%al
1245	andl	$255,%edx
1246	movl	CAST_S_table0(,%ecx,4),%ecx
1247	movl	CAST_S_table1(,%ebx,4),%ebx
1248	subl	%ebx,%ecx
1249	movl	CAST_S_table2(,%eax,4),%ebx
1250	addl	%ebx,%ecx
1251	movl	CAST_S_table3(,%edx,4),%ebx
1252	xorl	%ebx,%ecx
1253	xorl	%ecx,%esi
1254
1255	movl	112(%ebp),%edx
1256	movl	116(%ebp),%ecx
1257	subl	%esi,%edx
1258	roll	%cl,%edx
1259	xorl	%ecx,%ecx
1260	movl	$255,%ebx
1261	movb	%dh,%cl
1262	andl	%edx,%ebx
1263	shrl	$16,%edx
1264	xorl	%eax,%eax
1265	movb	%dh,%al
1266	andl	$255,%edx
1267	movl	CAST_S_table0(,%ecx,4),%ecx
1268	movl	CAST_S_table1(,%ebx,4),%ebx
1269	addl	%ebx,%ecx
1270	movl	CAST_S_table2(,%eax,4),%ebx
1271	xorl	%ebx,%ecx
1272	movl	CAST_S_table3(,%edx,4),%ebx
1273	subl	%ebx,%ecx
1274	xorl	%ecx,%edi
1275
1276	movl	120(%ebp),%edx
1277	movl	124(%ebp),%ecx
1278	addl	%edi,%edx
1279	roll	%cl,%edx
1280	xorl	%ecx,%ecx
1281	movl	$255,%ebx
1282	movb	%dh,%cl
1283	andl	%edx,%ebx
1284	shrl	$16,%edx
1285	xorl	%eax,%eax
1286	movb	%dh,%al
1287	andl	$255,%edx
1288	movl	CAST_S_table0(,%ecx,4),%ecx
1289	movl	CAST_S_table1(,%ebx,4),%ebx
1290	xorl	%ebx,%ecx
1291	movl	CAST_S_table2(,%eax,4),%ebx
1292	subl	%ebx,%ecx
1293	movl	CAST_S_table3(,%edx,4),%ebx
1294	addl	%ebx,%ecx
1295	xorl	%ecx,%esi
1296.L000cast_enc_done:
1297	nop
1298	movl	20(%esp),%eax
1299	movl	%edi,4(%eax)
1300	movl	%esi,(%eax)
1301	popl	%edi
1302	popl	%esi
1303	popl	%ebx
1304	popl	%ebp
1305	ret
1306.size	CAST_encrypt,.-.L_CAST_encrypt_begin
1307.globl	CAST_decrypt
1308.type	CAST_decrypt,@function
1309.align	16
1310CAST_decrypt:
1311.L_CAST_decrypt_begin:
1312
1313	pushl	%ebp
1314	pushl	%ebx
1315	movl	12(%esp),%ebx
1316	movl	16(%esp),%ebp
1317	pushl	%esi
1318	pushl	%edi
1319
1320	movl	(%ebx),%edi
1321	movl	4(%ebx),%esi
1322
1323	movl	128(%ebp),%eax
1324	orl	%eax,%eax
1325	jnz	.L001cast_dec_skip
1326	xorl	%eax,%eax
1327
1328	movl	120(%ebp),%edx
1329	movl	124(%ebp),%ecx
1330	addl	%esi,%edx
1331	roll	%cl,%edx
1332	xorl	%ecx,%ecx
1333	movl	$255,%ebx
1334	movb	%dh,%cl
1335	andl	%edx,%ebx
1336	shrl	$16,%edx
1337	xorl	%eax,%eax
1338	movb	%dh,%al
1339	andl	$255,%edx
1340	movl	CAST_S_table0(,%ecx,4),%ecx
1341	movl	CAST_S_table1(,%ebx,4),%ebx
1342	xorl	%ebx,%ecx
1343	movl	CAST_S_table2(,%eax,4),%ebx
1344	subl	%ebx,%ecx
1345	movl	CAST_S_table3(,%edx,4),%ebx
1346	addl	%ebx,%ecx
1347	xorl	%ecx,%edi
1348
1349	movl	112(%ebp),%edx
1350	movl	116(%ebp),%ecx
1351	subl	%edi,%edx
1352	roll	%cl,%edx
1353	xorl	%ecx,%ecx
1354	movl	$255,%ebx
1355	movb	%dh,%cl
1356	andl	%edx,%ebx
1357	shrl	$16,%edx
1358	xorl	%eax,%eax
1359	movb	%dh,%al
1360	andl	$255,%edx
1361	movl	CAST_S_table0(,%ecx,4),%ecx
1362	movl	CAST_S_table1(,%ebx,4),%ebx
1363	addl	%ebx,%ecx
1364	movl	CAST_S_table2(,%eax,4),%ebx
1365	xorl	%ebx,%ecx
1366	movl	CAST_S_table3(,%edx,4),%ebx
1367	subl	%ebx,%ecx
1368	xorl	%ecx,%esi
1369
1370	movl	104(%ebp),%edx
1371	movl	108(%ebp),%ecx
1372	xorl	%esi,%edx
1373	roll	%cl,%edx
1374	xorl	%ecx,%ecx
1375	movl	$255,%ebx
1376	movb	%dh,%cl
1377	andl	%edx,%ebx
1378	shrl	$16,%edx
1379	xorl	%eax,%eax
1380	movb	%dh,%al
1381	andl	$255,%edx
1382	movl	CAST_S_table0(,%ecx,4),%ecx
1383	movl	CAST_S_table1(,%ebx,4),%ebx
1384	subl	%ebx,%ecx
1385	movl	CAST_S_table2(,%eax,4),%ebx
1386	addl	%ebx,%ecx
1387	movl	CAST_S_table3(,%edx,4),%ebx
1388	xorl	%ebx,%ecx
1389	xorl	%ecx,%edi
1390
1391	movl	96(%ebp),%edx
1392	movl	100(%ebp),%ecx
1393	addl	%edi,%edx
1394	roll	%cl,%edx
1395	xorl	%ecx,%ecx
1396	movl	$255,%ebx
1397	movb	%dh,%cl
1398	andl	%edx,%ebx
1399	shrl	$16,%edx
1400	xorl	%eax,%eax
1401	movb	%dh,%al
1402	andl	$255,%edx
1403	movl	CAST_S_table0(,%ecx,4),%ecx
1404	movl	CAST_S_table1(,%ebx,4),%ebx
1405	xorl	%ebx,%ecx
1406	movl	CAST_S_table2(,%eax,4),%ebx
1407	subl	%ebx,%ecx
1408	movl	CAST_S_table3(,%edx,4),%ebx
1409	addl	%ebx,%ecx
1410	xorl	%ecx,%esi
1411.L001cast_dec_skip:
1412
1413	movl	88(%ebp),%edx
1414	movl	92(%ebp),%ecx
1415	subl	%esi,%edx
1416	roll	%cl,%edx
1417	xorl	%ecx,%ecx
1418	movl	$255,%ebx
1419	movb	%dh,%cl
1420	andl	%edx,%ebx
1421	shrl	$16,%edx
1422	xorl	%eax,%eax
1423	movb	%dh,%al
1424	andl	$255,%edx
1425	movl	CAST_S_table0(,%ecx,4),%ecx
1426	movl	CAST_S_table1(,%ebx,4),%ebx
1427	addl	%ebx,%ecx
1428	movl	CAST_S_table2(,%eax,4),%ebx
1429	xorl	%ebx,%ecx
1430	movl	CAST_S_table3(,%edx,4),%ebx
1431	subl	%ebx,%ecx
1432	xorl	%ecx,%edi
1433
1434	movl	80(%ebp),%edx
1435	movl	84(%ebp),%ecx
1436	xorl	%edi,%edx
1437	roll	%cl,%edx
1438	xorl	%ecx,%ecx
1439	movl	$255,%ebx
1440	movb	%dh,%cl
1441	andl	%edx,%ebx
1442	shrl	$16,%edx
1443	xorl	%eax,%eax
1444	movb	%dh,%al
1445	andl	$255,%edx
1446	movl	CAST_S_table0(,%ecx,4),%ecx
1447	movl	CAST_S_table1(,%ebx,4),%ebx
1448	subl	%ebx,%ecx
1449	movl	CAST_S_table2(,%eax,4),%ebx
1450	addl	%ebx,%ecx
1451	movl	CAST_S_table3(,%edx,4),%ebx
1452	xorl	%ebx,%ecx
1453	xorl	%ecx,%esi
1454
1455	movl	72(%ebp),%edx
1456	movl	76(%ebp),%ecx
1457	addl	%esi,%edx
1458	roll	%cl,%edx
1459	xorl	%ecx,%ecx
1460	movl	$255,%ebx
1461	movb	%dh,%cl
1462	andl	%edx,%ebx
1463	shrl	$16,%edx
1464	xorl	%eax,%eax
1465	movb	%dh,%al
1466	andl	$255,%edx
1467	movl	CAST_S_table0(,%ecx,4),%ecx
1468	movl	CAST_S_table1(,%ebx,4),%ebx
1469	xorl	%ebx,%ecx
1470	movl	CAST_S_table2(,%eax,4),%ebx
1471	subl	%ebx,%ecx
1472	movl	CAST_S_table3(,%edx,4),%ebx
1473	addl	%ebx,%ecx
1474	xorl	%ecx,%edi
1475
1476	movl	64(%ebp),%edx
1477	movl	68(%ebp),%ecx
1478	subl	%edi,%edx
1479	roll	%cl,%edx
1480	xorl	%ecx,%ecx
1481	movl	$255,%ebx
1482	movb	%dh,%cl
1483	andl	%edx,%ebx
1484	shrl	$16,%edx
1485	xorl	%eax,%eax
1486	movb	%dh,%al
1487	andl	$255,%edx
1488	movl	CAST_S_table0(,%ecx,4),%ecx
1489	movl	CAST_S_table1(,%ebx,4),%ebx
1490	addl	%ebx,%ecx
1491	movl	CAST_S_table2(,%eax,4),%ebx
1492	xorl	%ebx,%ecx
1493	movl	CAST_S_table3(,%edx,4),%ebx
1494	subl	%ebx,%ecx
1495	xorl	%ecx,%esi
1496
1497	movl	56(%ebp),%edx
1498	movl	60(%ebp),%ecx
1499	xorl	%esi,%edx
1500	roll	%cl,%edx
1501	xorl	%ecx,%ecx
1502	movl	$255,%ebx
1503	movb	%dh,%cl
1504	andl	%edx,%ebx
1505	shrl	$16,%edx
1506	xorl	%eax,%eax
1507	movb	%dh,%al
1508	andl	$255,%edx
1509	movl	CAST_S_table0(,%ecx,4),%ecx
1510	movl	CAST_S_table1(,%ebx,4),%ebx
1511	subl	%ebx,%ecx
1512	movl	CAST_S_table2(,%eax,4),%ebx
1513	addl	%ebx,%ecx
1514	movl	CAST_S_table3(,%edx,4),%ebx
1515	xorl	%ebx,%ecx
1516	xorl	%ecx,%edi
1517
1518	movl	48(%ebp),%edx
1519	movl	52(%ebp),%ecx
1520	addl	%edi,%edx
1521	roll	%cl,%edx
1522	xorl	%ecx,%ecx
1523	movl	$255,%ebx
1524	movb	%dh,%cl
1525	andl	%edx,%ebx
1526	shrl	$16,%edx
1527	xorl	%eax,%eax
1528	movb	%dh,%al
1529	andl	$255,%edx
1530	movl	CAST_S_table0(,%ecx,4),%ecx
1531	movl	CAST_S_table1(,%ebx,4),%ebx
1532	xorl	%ebx,%ecx
1533	movl	CAST_S_table2(,%eax,4),%ebx
1534	subl	%ebx,%ecx
1535	movl	CAST_S_table3(,%edx,4),%ebx
1536	addl	%ebx,%ecx
1537	xorl	%ecx,%esi
1538
1539	movl	40(%ebp),%edx
1540	movl	44(%ebp),%ecx
1541	subl	%esi,%edx
1542	roll	%cl,%edx
1543	xorl	%ecx,%ecx
1544	movl	$255,%ebx
1545	movb	%dh,%cl
1546	andl	%edx,%ebx
1547	shrl	$16,%edx
1548	xorl	%eax,%eax
1549	movb	%dh,%al
1550	andl	$255,%edx
1551	movl	CAST_S_table0(,%ecx,4),%ecx
1552	movl	CAST_S_table1(,%ebx,4),%ebx
1553	addl	%ebx,%ecx
1554	movl	CAST_S_table2(,%eax,4),%ebx
1555	xorl	%ebx,%ecx
1556	movl	CAST_S_table3(,%edx,4),%ebx
1557	subl	%ebx,%ecx
1558	xorl	%ecx,%edi
1559
1560	movl	32(%ebp),%edx
1561	movl	36(%ebp),%ecx
1562	xorl	%edi,%edx
1563	roll	%cl,%edx
1564	xorl	%ecx,%ecx
1565	movl	$255,%ebx
1566	movb	%dh,%cl
1567	andl	%edx,%ebx
1568	shrl	$16,%edx
1569	xorl	%eax,%eax
1570	movb	%dh,%al
1571	andl	$255,%edx
1572	movl	CAST_S_table0(,%ecx,4),%ecx
1573	movl	CAST_S_table1(,%ebx,4),%ebx
1574	subl	%ebx,%ecx
1575	movl	CAST_S_table2(,%eax,4),%ebx
1576	addl	%ebx,%ecx
1577	movl	CAST_S_table3(,%edx,4),%ebx
1578	xorl	%ebx,%ecx
1579	xorl	%ecx,%esi
1580
1581	movl	24(%ebp),%edx
1582	movl	28(%ebp),%ecx
1583	addl	%esi,%edx
1584	roll	%cl,%edx
1585	xorl	%ecx,%ecx
1586	movl	$255,%ebx
1587	movb	%dh,%cl
1588	andl	%edx,%ebx
1589	shrl	$16,%edx
1590	xorl	%eax,%eax
1591	movb	%dh,%al
1592	andl	$255,%edx
1593	movl	CAST_S_table0(,%ecx,4),%ecx
1594	movl	CAST_S_table1(,%ebx,4),%ebx
1595	xorl	%ebx,%ecx
1596	movl	CAST_S_table2(,%eax,4),%ebx
1597	subl	%ebx,%ecx
1598	movl	CAST_S_table3(,%edx,4),%ebx
1599	addl	%ebx,%ecx
1600	xorl	%ecx,%edi
1601
1602	movl	16(%ebp),%edx
1603	movl	20(%ebp),%ecx
1604	subl	%edi,%edx
1605	roll	%cl,%edx
1606	xorl	%ecx,%ecx
1607	movl	$255,%ebx
1608	movb	%dh,%cl
1609	andl	%edx,%ebx
1610	shrl	$16,%edx
1611	xorl	%eax,%eax
1612	movb	%dh,%al
1613	andl	$255,%edx
1614	movl	CAST_S_table0(,%ecx,4),%ecx
1615	movl	CAST_S_table1(,%ebx,4),%ebx
1616	addl	%ebx,%ecx
1617	movl	CAST_S_table2(,%eax,4),%ebx
1618	xorl	%ebx,%ecx
1619	movl	CAST_S_table3(,%edx,4),%ebx
1620	subl	%ebx,%ecx
1621	xorl	%ecx,%esi
1622
1623	movl	8(%ebp),%edx
1624	movl	12(%ebp),%ecx
1625	xorl	%esi,%edx
1626	roll	%cl,%edx
1627	xorl	%ecx,%ecx
1628	movl	$255,%ebx
1629	movb	%dh,%cl
1630	andl	%edx,%ebx
1631	shrl	$16,%edx
1632	xorl	%eax,%eax
1633	movb	%dh,%al
1634	andl	$255,%edx
1635	movl	CAST_S_table0(,%ecx,4),%ecx
1636	movl	CAST_S_table1(,%ebx,4),%ebx
1637	subl	%ebx,%ecx
1638	movl	CAST_S_table2(,%eax,4),%ebx
1639	addl	%ebx,%ecx
1640	movl	CAST_S_table3(,%edx,4),%ebx
1641	xorl	%ebx,%ecx
1642	xorl	%ecx,%edi
1643
1644	movl	(%ebp),%edx
1645	movl	4(%ebp),%ecx
1646	addl	%edi,%edx
1647	roll	%cl,%edx
1648	xorl	%ecx,%ecx
1649	movl	$255,%ebx
1650	movb	%dh,%cl
1651	andl	%edx,%ebx
1652	shrl	$16,%edx
1653	xorl	%eax,%eax
1654	movb	%dh,%al
1655	andl	$255,%edx
1656	movl	CAST_S_table0(,%ecx,4),%ecx
1657	movl	CAST_S_table1(,%ebx,4),%ebx
1658	xorl	%ebx,%ecx
1659	movl	CAST_S_table2(,%eax,4),%ebx
1660	subl	%ebx,%ecx
1661	movl	CAST_S_table3(,%edx,4),%ebx
1662	addl	%ebx,%ecx
1663	xorl	%ecx,%esi
1664	nop
1665	movl	20(%esp),%eax
1666	movl	%edi,4(%eax)
1667	movl	%esi,(%eax)
1668	popl	%edi
1669	popl	%esi
1670	popl	%ebx
1671	popl	%ebp
1672	ret
1673.size	CAST_decrypt,.-.L_CAST_decrypt_begin
1674.globl	CAST_cbc_encrypt
1675.type	CAST_cbc_encrypt,@function
1676.align	16
1677CAST_cbc_encrypt:
1678.L_CAST_cbc_encrypt_begin:
1679
1680	pushl	%ebp
1681	pushl	%ebx
1682	pushl	%esi
1683	pushl	%edi
1684	movl	28(%esp),%ebp
1685
1686	movl	36(%esp),%ebx
1687	movl	(%ebx),%esi
1688	movl	4(%ebx),%edi
1689	pushl	%edi
1690	pushl	%esi
1691	pushl	%edi
1692	pushl	%esi
1693	movl	%esp,%ebx
1694	movl	36(%esp),%esi
1695	movl	40(%esp),%edi
1696
1697	movl	56(%esp),%ecx
1698
1699	movl	48(%esp),%eax
1700	pushl	%eax
1701	pushl	%ebx
1702	cmpl	$0,%ecx
1703	jz	.L002decrypt
1704	andl	$4294967288,%ebp
1705	movl	8(%esp),%eax
1706	movl	12(%esp),%ebx
1707	jz	.L003encrypt_finish
1708.L004encrypt_loop:
1709	movl	(%esi),%ecx
1710	movl	4(%esi),%edx
1711	xorl	%ecx,%eax
1712	xorl	%edx,%ebx
1713	bswap	%eax
1714	bswap	%ebx
1715	movl	%eax,8(%esp)
1716	movl	%ebx,12(%esp)
1717	call	.L_CAST_encrypt_begin
1718	movl	8(%esp),%eax
1719	movl	12(%esp),%ebx
1720	bswap	%eax
1721	bswap	%ebx
1722	movl	%eax,(%edi)
1723	movl	%ebx,4(%edi)
1724	addl	$8,%esi
1725	addl	$8,%edi
1726	subl	$8,%ebp
1727	jnz	.L004encrypt_loop
1728.L003encrypt_finish:
1729	movl	52(%esp),%ebp
1730	andl	$7,%ebp
1731	jz	.L005finish
1732	call	.L006PIC_point
1733.L006PIC_point:
1734	popl	%edx
1735	leal	.L007cbc_enc_jmp_table-.L006PIC_point(%edx),%ecx
1736	movl	(%ecx,%ebp,4),%ebp
1737	addl	%edx,%ebp
1738	xorl	%ecx,%ecx
1739	xorl	%edx,%edx
1740	jmp	*%ebp
1741.L008ej7:
1742	movb	6(%esi),%dh
1743	shll	$8,%edx
1744.L009ej6:
1745	movb	5(%esi),%dh
1746.L010ej5:
1747	movb	4(%esi),%dl
1748.L011ej4:
1749	movl	(%esi),%ecx
1750	jmp	.L012ejend
1751.L013ej3:
1752	movb	2(%esi),%ch
1753	shll	$8,%ecx
1754.L014ej2:
1755	movb	1(%esi),%ch
1756.L015ej1:
1757	movb	(%esi),%cl
1758.L012ejend:
1759	xorl	%ecx,%eax
1760	xorl	%edx,%ebx
1761	bswap	%eax
1762	bswap	%ebx
1763	movl	%eax,8(%esp)
1764	movl	%ebx,12(%esp)
1765	call	.L_CAST_encrypt_begin
1766	movl	8(%esp),%eax
1767	movl	12(%esp),%ebx
1768	bswap	%eax
1769	bswap	%ebx
1770	movl	%eax,(%edi)
1771	movl	%ebx,4(%edi)
1772	jmp	.L005finish
1773.L002decrypt:
1774	andl	$4294967288,%ebp
1775	movl	16(%esp),%eax
1776	movl	20(%esp),%ebx
1777	jz	.L016decrypt_finish
1778.L017decrypt_loop:
1779	movl	(%esi),%eax
1780	movl	4(%esi),%ebx
1781	bswap	%eax
1782	bswap	%ebx
1783	movl	%eax,8(%esp)
1784	movl	%ebx,12(%esp)
1785	call	.L_CAST_decrypt_begin
1786	movl	8(%esp),%eax
1787	movl	12(%esp),%ebx
1788	bswap	%eax
1789	bswap	%ebx
1790	movl	16(%esp),%ecx
1791	movl	20(%esp),%edx
1792	xorl	%eax,%ecx
1793	xorl	%ebx,%edx
1794	movl	(%esi),%eax
1795	movl	4(%esi),%ebx
1796	movl	%ecx,(%edi)
1797	movl	%edx,4(%edi)
1798	movl	%eax,16(%esp)
1799	movl	%ebx,20(%esp)
1800	addl	$8,%esi
1801	addl	$8,%edi
1802	subl	$8,%ebp
1803	jnz	.L017decrypt_loop
1804.L016decrypt_finish:
1805	movl	52(%esp),%ebp
1806	andl	$7,%ebp
1807	jz	.L005finish
1808	movl	(%esi),%eax
1809	movl	4(%esi),%ebx
1810	bswap	%eax
1811	bswap	%ebx
1812	movl	%eax,8(%esp)
1813	movl	%ebx,12(%esp)
1814	call	.L_CAST_decrypt_begin
1815	movl	8(%esp),%eax
1816	movl	12(%esp),%ebx
1817	bswap	%eax
1818	bswap	%ebx
1819	movl	16(%esp),%ecx
1820	movl	20(%esp),%edx
1821	xorl	%eax,%ecx
1822	xorl	%ebx,%edx
1823	movl	(%esi),%eax
1824	movl	4(%esi),%ebx
1825.L018dj7:
1826	rorl	$16,%edx
1827	movb	%dl,6(%edi)
1828	shrl	$16,%edx
1829.L019dj6:
1830	movb	%dh,5(%edi)
1831.L020dj5:
1832	movb	%dl,4(%edi)
1833.L021dj4:
1834	movl	%ecx,(%edi)
1835	jmp	.L022djend
1836.L023dj3:
1837	rorl	$16,%ecx
1838	movb	%cl,2(%edi)
1839	shll	$16,%ecx
1840.L024dj2:
1841	movb	%ch,1(%esi)
1842.L025dj1:
1843	movb	%cl,(%esi)
1844.L022djend:
1845	jmp	.L005finish
1846.L005finish:
1847	movl	60(%esp),%ecx
1848	addl	$24,%esp
1849	movl	%eax,(%ecx)
1850	movl	%ebx,4(%ecx)
1851	popl	%edi
1852	popl	%esi
1853	popl	%ebx
1854	popl	%ebp
1855	ret
1856.align	64
1857.L007cbc_enc_jmp_table:
1858.long	0
1859.long	.L015ej1-.L006PIC_point
1860.long	.L014ej2-.L006PIC_point
1861.long	.L013ej3-.L006PIC_point
1862.long	.L011ej4-.L006PIC_point
1863.long	.L010ej5-.L006PIC_point
1864.long	.L009ej6-.L006PIC_point
1865.long	.L008ej7-.L006PIC_point
1866.align	64
1867.size	CAST_cbc_encrypt,.-.L_CAST_cbc_encrypt_begin
1868#endif
1869