• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* -----------------------------------------------------------------------
2   win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009  Red Hat, Inc.
3	     Copyright (c) 2001  John Beniton
4	     Copyright (c) 2002  Ranjit Mathew
5	     Copyright (c) 2009  Daniel Witte
6
7
8   X86 Foreign Function Interface
9
10   Permission is hereby granted, free of charge, to any person obtaining
11   a copy of this software and associated documentation files (the
12   ``Software''), to deal in the Software without restriction, including
13   without limitation the rights to use, copy, modify, merge, publish,
14   distribute, sublicense, and/or sell copies of the Software, and to
15   permit persons to whom the Software is furnished to do so, subject to
16   the following conditions:
17
18   The above copyright notice and this permission notice shall be included
19   in all copies or substantial portions of the Software.
20
21   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
22   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28   DEALINGS IN THE SOFTWARE.
29   -----------------------------------------------------------------------
30   */
31
32#define LIBFFI_ASM
33#include <fficonfig.h>
34#include <ffi.h>
35
36#define CIF_ABI_OFFSET 0
37#define CIF_BYTES_OFFSET 16
38
39#ifdef _MSC_VER
40
41#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
42
43.386
44.MODEL FLAT, C
45
46EXTRN ffi_closure_SYSV_inner:NEAR
47
48_TEXT SEGMENT
49
50ffi_call_win32 PROC NEAR,
51    ffi_prep_args : NEAR PTR DWORD,
52    ecif          : NEAR PTR DWORD,
53    cif_abi       : DWORD,
54    cif_bytes     : DWORD,
55    cif_flags     : DWORD,
56    rvalue        : NEAR PTR DWORD,
57    fn            : NEAR PTR DWORD
58
59        ;; Make room for all of the new args.
60        mov  ecx, cif_bytes
61        sub  esp, ecx
62
63        mov  eax, esp
64
65        ;; Place all of the ffi_prep_args in position
66        push ecif
67        push eax
68        call ffi_prep_args
69
70        ;; Return stack to previous state and call the function
71        add  esp, 8
72
73	;; Handle thiscall and fastcall
74	cmp cif_abi, 3 ;; FFI_THISCALL
75	jz do_thiscall
76	cmp cif_abi, 4 ;; FFI_FASTCALL
77	jnz do_stdcall
78	mov ecx, DWORD PTR [esp]
79	mov edx, DWORD PTR [esp+4]
80	add esp, 8
81	jmp do_stdcall
82do_thiscall:
83	mov ecx, DWORD PTR [esp]
84	add esp, 4
85do_stdcall:
86        call fn
87
88        ;; cdecl:   we restore esp in the epilogue, so there's no need to
89        ;;          remove the space we pushed for the args.
90        ;; stdcall: the callee has already cleaned the stack.
91
92        ;; Load ecx with the return type code
93        mov  ecx, cif_flags
94
95        ;; If the return value pointer is NULL, assume no return value.
96        cmp  rvalue, 0
97        jne  ca_jumptable
98
99        ;; Even if there is no space for the return value, we are
100        ;; obliged to handle floating-point values.
101        cmp  ecx, FFI_TYPE_FLOAT
102        jne  ca_epilogue
103        fstp st(0)
104
105        jmp  ca_epilogue
106
107ca_jumptable:
108        jmp  [ca_jumpdata + 4 * ecx]
109ca_jumpdata:
110        ;; Do not insert anything here between label and jump table.
111        dd offset ca_epilogue       ;; FFI_TYPE_VOID
112        dd offset ca_retint         ;; FFI_TYPE_INT
113        dd offset ca_retfloat       ;; FFI_TYPE_FLOAT
114        dd offset ca_retdouble      ;; FFI_TYPE_DOUBLE
115        dd offset ca_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
116        dd offset ca_retuint8       ;; FFI_TYPE_UINT8
117        dd offset ca_retsint8       ;; FFI_TYPE_SINT8
118        dd offset ca_retuint16      ;; FFI_TYPE_UINT16
119        dd offset ca_retsint16      ;; FFI_TYPE_SINT16
120        dd offset ca_retint         ;; FFI_TYPE_UINT32
121        dd offset ca_retint         ;; FFI_TYPE_SINT32
122        dd offset ca_retint64       ;; FFI_TYPE_UINT64
123        dd offset ca_retint64       ;; FFI_TYPE_SINT64
124        dd offset ca_epilogue       ;; FFI_TYPE_STRUCT
125        dd offset ca_retint         ;; FFI_TYPE_POINTER
126        dd offset ca_retstruct1b    ;; FFI_TYPE_SMALL_STRUCT_1B
127        dd offset ca_retstruct2b    ;; FFI_TYPE_SMALL_STRUCT_2B
128        dd offset ca_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
129        dd offset ca_epilogue       ;; FFI_TYPE_MS_STRUCT
130
131        /* Sign/zero extend as appropriate.  */
132ca_retuint8:
133        movzx eax, al
134        jmp   ca_retint
135
136ca_retsint8:
137        movsx eax, al
138        jmp   ca_retint
139
140ca_retuint16:
141        movzx eax, ax
142        jmp   ca_retint
143
144ca_retsint16:
145        movsx eax, ax
146        jmp   ca_retint
147
148ca_retint:
149        ;; Load %ecx with the pointer to storage for the return value
150        mov   ecx, rvalue
151        mov   [ecx + 0], eax
152        jmp   ca_epilogue
153
154ca_retint64:
155        ;; Load %ecx with the pointer to storage for the return value
156        mov   ecx, rvalue
157        mov   [ecx + 0], eax
158        mov   [ecx + 4], edx
159        jmp   ca_epilogue
160
161ca_retfloat:
162        ;; Load %ecx with the pointer to storage for the return value
163        mov   ecx, rvalue
164        fstp  DWORD PTR [ecx]
165        jmp   ca_epilogue
166
167ca_retdouble:
168        ;; Load %ecx with the pointer to storage for the return value
169        mov   ecx, rvalue
170        fstp  QWORD PTR [ecx]
171        jmp   ca_epilogue
172
173ca_retlongdouble:
174        ;; Load %ecx with the pointer to storage for the return value
175        mov   ecx, rvalue
176        fstp  TBYTE PTR [ecx]
177        jmp   ca_epilogue
178
179ca_retstruct1b:
180        ;; Load %ecx with the pointer to storage for the return value
181        mov   ecx, rvalue
182        mov   [ecx + 0], al
183        jmp   ca_epilogue
184
185ca_retstruct2b:
186        ;; Load %ecx with the pointer to storage for the return value
187        mov   ecx, rvalue
188        mov   [ecx + 0], ax
189        jmp   ca_epilogue
190
191ca_epilogue:
192        ;; Epilogue code is autogenerated.
193        ret
194ffi_call_win32 ENDP
195
196ffi_closure_THISCALL PROC NEAR
197	;; Insert the register argument on the stack as the first argument
198	xchg	DWORD PTR [esp+4], ecx
199	xchg	DWORD PTR [esp], ecx
200	push	ecx
201	jmp	ffi_closure_STDCALL
202ffi_closure_THISCALL ENDP
203
204ffi_closure_FASTCALL PROC NEAR
205	;; Insert the register argument on the stack as the first argument
206	xchg	DWORD PTR [esp+4], edx
207	xchg	DWORD PTR [esp], ecx
208	push	edx
209	push	ecx
210	jmp	ffi_closure_STDCALL
211ffi_closure_FASTCALL ENDP
212
213ffi_closure_SYSV PROC NEAR FORCEFRAME
214    ;; the ffi_closure ctx is passed in eax by the trampoline.
215
216        sub  esp, 40
217        lea  edx, [ebp - 24]
218        mov  [ebp - 12], edx         ;; resp
219        lea  edx, [ebp + 8]
220stub::
221        mov  [esp + 8], edx          ;; args
222        lea  edx, [ebp - 12]
223        mov  [esp + 4], edx          ;; &resp
224        mov  [esp], eax              ;; closure
225        call ffi_closure_SYSV_inner
226        mov  ecx, [ebp - 12]
227
228cs_jumptable:
229        jmp  [cs_jumpdata + 4 * eax]
230cs_jumpdata:
231        ;; Do not insert anything here between the label and jump table.
232        dd offset cs_epilogue       ;; FFI_TYPE_VOID
233        dd offset cs_retint         ;; FFI_TYPE_INT
234        dd offset cs_retfloat       ;; FFI_TYPE_FLOAT
235        dd offset cs_retdouble      ;; FFI_TYPE_DOUBLE
236        dd offset cs_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
237        dd offset cs_retuint8       ;; FFI_TYPE_UINT8
238        dd offset cs_retsint8       ;; FFI_TYPE_SINT8
239        dd offset cs_retuint16      ;; FFI_TYPE_UINT16
240        dd offset cs_retsint16      ;; FFI_TYPE_SINT16
241        dd offset cs_retint         ;; FFI_TYPE_UINT32
242        dd offset cs_retint         ;; FFI_TYPE_SINT32
243        dd offset cs_retint64       ;; FFI_TYPE_UINT64
244        dd offset cs_retint64       ;; FFI_TYPE_SINT64
245        dd offset cs_retstruct      ;; FFI_TYPE_STRUCT
246        dd offset cs_retint         ;; FFI_TYPE_POINTER
247        dd offset cs_retsint8       ;; FFI_TYPE_SMALL_STRUCT_1B
248        dd offset cs_retsint16      ;; FFI_TYPE_SMALL_STRUCT_2B
249        dd offset cs_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
250        dd offset cs_retmsstruct    ;; FFI_TYPE_MS_STRUCT
251
252cs_retuint8:
253        movzx eax, BYTE PTR [ecx]
254        jmp   cs_epilogue
255
256cs_retsint8:
257        movsx eax, BYTE PTR [ecx]
258        jmp   cs_epilogue
259
260cs_retuint16:
261        movzx eax, WORD PTR [ecx]
262        jmp   cs_epilogue
263
264cs_retsint16:
265        movsx eax, WORD PTR [ecx]
266        jmp   cs_epilogue
267
268cs_retint:
269        mov   eax, [ecx]
270        jmp   cs_epilogue
271
272cs_retint64:
273        mov   eax, [ecx + 0]
274        mov   edx, [ecx + 4]
275        jmp   cs_epilogue
276
277cs_retfloat:
278        fld   DWORD PTR [ecx]
279        jmp   cs_epilogue
280
281cs_retdouble:
282        fld   QWORD PTR [ecx]
283        jmp   cs_epilogue
284
285cs_retlongdouble:
286        fld   TBYTE PTR [ecx]
287        jmp   cs_epilogue
288
289cs_retstruct:
290        ;; Caller expects us to pop struct return value pointer hidden arg.
291        ;; Epilogue code is autogenerated.
292        ret	4
293
294cs_retmsstruct:
295        ;; Caller expects us to return a pointer to the real return value.
296        mov   eax, ecx
297        ;; Caller doesn't expects us to pop struct return value pointer hidden arg.
298        jmp   cs_epilogue
299
300cs_epilogue:
301        ;; Epilogue code is autogenerated.
302        ret
303ffi_closure_SYSV ENDP
304
305#if !FFI_NO_RAW_API
306
307#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
308#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
309#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
310#define CIF_FLAGS_OFFSET 20
311
312ffi_closure_raw_THISCALL PROC NEAR USES esi FORCEFRAME
313	sub esp, 36
314	mov  esi, [eax + RAW_CLOSURE_CIF_OFFSET]        ;; closure->cif
315	mov  edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET]  ;; closure->user_data
316	mov [esp + 12], edx
317	lea edx, [ebp + 12]
318	jmp stubraw
319ffi_closure_raw_THISCALL ENDP
320
321ffi_closure_raw_SYSV PROC NEAR USES esi FORCEFRAME
322    ;; the ffi_closure ctx is passed in eax by the trampoline.
323
324        sub  esp, 40
325        mov  esi, [eax + RAW_CLOSURE_CIF_OFFSET]        ;; closure->cif
326        mov  edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET]  ;; closure->user_data
327        mov  [esp + 12], edx                            ;; user_data
328        lea  edx, [ebp + 8]
329stubraw::
330        mov  [esp + 8], edx                             ;; raw_args
331        lea  edx, [ebp - 24]
332        mov  [esp + 4], edx                             ;; &res
333        mov  [esp], esi                                 ;; cif
334        call DWORD PTR [eax + RAW_CLOSURE_FUN_OFFSET]   ;; closure->fun
335        mov  eax, [esi + CIF_FLAGS_OFFSET]              ;; cif->flags
336        lea  ecx, [ebp - 24]
337
338cr_jumptable:
339        jmp  [cr_jumpdata + 4 * eax]
340cr_jumpdata:
341        ;; Do not insert anything here between the label and jump table.
342        dd offset cr_epilogue       ;; FFI_TYPE_VOID
343        dd offset cr_retint         ;; FFI_TYPE_INT
344        dd offset cr_retfloat       ;; FFI_TYPE_FLOAT
345        dd offset cr_retdouble      ;; FFI_TYPE_DOUBLE
346        dd offset cr_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
347        dd offset cr_retuint8       ;; FFI_TYPE_UINT8
348        dd offset cr_retsint8       ;; FFI_TYPE_SINT8
349        dd offset cr_retuint16      ;; FFI_TYPE_UINT16
350        dd offset cr_retsint16      ;; FFI_TYPE_SINT16
351        dd offset cr_retint         ;; FFI_TYPE_UINT32
352        dd offset cr_retint         ;; FFI_TYPE_SINT32
353        dd offset cr_retint64       ;; FFI_TYPE_UINT64
354        dd offset cr_retint64       ;; FFI_TYPE_SINT64
355        dd offset cr_epilogue       ;; FFI_TYPE_STRUCT
356        dd offset cr_retint         ;; FFI_TYPE_POINTER
357        dd offset cr_retsint8       ;; FFI_TYPE_SMALL_STRUCT_1B
358        dd offset cr_retsint16      ;; FFI_TYPE_SMALL_STRUCT_2B
359        dd offset cr_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
360        dd offset cr_epilogue       ;; FFI_TYPE_MS_STRUCT
361
362cr_retuint8:
363        movzx eax, BYTE PTR [ecx]
364        jmp   cr_epilogue
365
366cr_retsint8:
367        movsx eax, BYTE PTR [ecx]
368        jmp   cr_epilogue
369
370cr_retuint16:
371        movzx eax, WORD PTR [ecx]
372        jmp   cr_epilogue
373
374cr_retsint16:
375        movsx eax, WORD PTR [ecx]
376        jmp   cr_epilogue
377
378cr_retint:
379        mov   eax, [ecx]
380        jmp   cr_epilogue
381
382cr_retint64:
383        mov   eax, [ecx + 0]
384        mov   edx, [ecx + 4]
385        jmp   cr_epilogue
386
387cr_retfloat:
388        fld   DWORD PTR [ecx]
389        jmp   cr_epilogue
390
391cr_retdouble:
392        fld   QWORD PTR [ecx]
393        jmp   cr_epilogue
394
395cr_retlongdouble:
396        fld   TBYTE PTR [ecx]
397        jmp   cr_epilogue
398
399cr_epilogue:
400        ;; Epilogue code is autogenerated.
401        ret
402ffi_closure_raw_SYSV ENDP
403
404#endif /* !FFI_NO_RAW_API */
405
406ffi_closure_STDCALL PROC NEAR FORCEFRAME
407    ;; the ffi_closure ctx is passed in eax by the trampoline.
408
409        sub  esp, 40
410        lea  edx, [ebp - 24]
411        mov  [ebp - 12], edx         ;; resp
412        lea  edx, [ebp + 12]         ;; account for stub return address on stack
413        mov  [esp + 8], edx          ;; args
414        lea  edx, [ebp - 12]
415        mov  [esp + 4], edx          ;; &resp
416        mov  [esp], eax              ;; closure
417        call ffi_closure_SYSV_inner
418        mov  ecx, [ebp - 12]
419
420cd_jumptable:
421        jmp  [cd_jumpdata + 4 * eax]
422cd_jumpdata:
423        ;; Do not insert anything here between the label and jump table.
424        dd offset cd_epilogue       ;; FFI_TYPE_VOID
425        dd offset cd_retint         ;; FFI_TYPE_INT
426        dd offset cd_retfloat       ;; FFI_TYPE_FLOAT
427        dd offset cd_retdouble      ;; FFI_TYPE_DOUBLE
428        dd offset cd_retlongdouble  ;; FFI_TYPE_LONGDOUBLE
429        dd offset cd_retuint8       ;; FFI_TYPE_UINT8
430        dd offset cd_retsint8       ;; FFI_TYPE_SINT8
431        dd offset cd_retuint16      ;; FFI_TYPE_UINT16
432        dd offset cd_retsint16      ;; FFI_TYPE_SINT16
433        dd offset cd_retint         ;; FFI_TYPE_UINT32
434        dd offset cd_retint         ;; FFI_TYPE_SINT32
435        dd offset cd_retint64       ;; FFI_TYPE_UINT64
436        dd offset cd_retint64       ;; FFI_TYPE_SINT64
437        dd offset cd_epilogue       ;; FFI_TYPE_STRUCT
438        dd offset cd_retint         ;; FFI_TYPE_POINTER
439        dd offset cd_retsint8       ;; FFI_TYPE_SMALL_STRUCT_1B
440        dd offset cd_retsint16      ;; FFI_TYPE_SMALL_STRUCT_2B
441        dd offset cd_retint         ;; FFI_TYPE_SMALL_STRUCT_4B
442
443cd_retuint8:
444        movzx eax, BYTE PTR [ecx]
445        jmp   cd_epilogue
446
447cd_retsint8:
448        movsx eax, BYTE PTR [ecx]
449        jmp   cd_epilogue
450
451cd_retuint16:
452        movzx eax, WORD PTR [ecx]
453        jmp   cd_epilogue
454
455cd_retsint16:
456        movsx eax, WORD PTR [ecx]
457        jmp   cd_epilogue
458
459cd_retint:
460        mov   eax, [ecx]
461        jmp   cd_epilogue
462
463cd_retint64:
464        mov   eax, [ecx + 0]
465        mov   edx, [ecx + 4]
466        jmp   cd_epilogue
467
468cd_retfloat:
469        fld   DWORD PTR [ecx]
470        jmp   cd_epilogue
471
472cd_retdouble:
473        fld   QWORD PTR [ecx]
474        jmp   cd_epilogue
475
476cd_retlongdouble:
477        fld   TBYTE PTR [ecx]
478        jmp   cd_epilogue
479
480cd_epilogue:
481        mov   esp, ebp
482        pop   ebp
483        pop   ecx
484        pop   edx
485        mov   ecx, DWORD PTR [ecx + (CLOSURE_CIF_OFFSET-10)]
486        add   esp, DWORD PTR [ecx + CIF_BYTES_OFFSET]
487        mov   ecx, DWORD PTR [ecx + CIF_ABI_OFFSET]
488        cmp   ecx, 3
489        je    cd_thiscall
490        cmp   ecx, 4
491        jne   cd_not_fastcall
492
493        add   esp, 4
494cd_thiscall:
495        add   esp, 4
496cd_not_fastcall:
497        jmp   edx
498ffi_closure_STDCALL ENDP
499
500_TEXT ENDS
501END
502
503#else
504
505#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
506
507#if defined(SYMBOL_UNDERSCORE)
508#define USCORE_SYMBOL(x) _##x
509#else
510#define USCORE_SYMBOL(x) x
511#endif
512	.text
513
514        # This assumes we are using gas.
515        .balign 16
516FFI_HIDDEN(ffi_call_win32)
517	.globl	USCORE_SYMBOL(ffi_call_win32)
518#if defined(X86_WIN32) && !defined(__OS2__)
519	.def	_ffi_call_win32;	.scl	2;	.type	32;	.endef
520#endif
521USCORE_SYMBOL(ffi_call_win32):
522.LFB1:
523        pushl %ebp
524.LCFI0:
525        movl  %esp,%ebp
526.LCFI1:
527        # Make room for all of the new args.
528        movl  20(%ebp),%ecx
529        subl  %ecx,%esp
530
531        movl  %esp,%eax
532
533        # Place all of the ffi_prep_args in position
534        pushl 12(%ebp)
535        pushl %eax
536        call  *8(%ebp)
537
538        # Return stack to previous state and call the function
539        addl  $8,%esp
540
541	# Handle fastcall and thiscall
542	cmpl $3, 16(%ebp)  # FFI_THISCALL
543	jz .do_thiscall
544	cmpl $4, 16(%ebp) # FFI_FASTCALL
545	jnz .do_fncall
546	movl (%esp), %ecx
547	movl 4(%esp), %edx
548	addl $8, %esp
549	jmp .do_fncall
550.do_thiscall:
551	movl (%esp), %ecx
552	addl $4, %esp
553
554.do_fncall:
555
556        # FIXME: Align the stack to a 128-bit boundary to avoid
557        # potential performance hits.
558
559        call  *32(%ebp)
560
561        # stdcall functions pop arguments off the stack themselves
562
563        # Load %ecx with the return type code
564        movl  24(%ebp),%ecx
565
566        # If the return value pointer is NULL, assume no return value.
567        cmpl  $0,28(%ebp)
568        jne   0f
569
570        # Even if there is no space for the return value, we are
571        # obliged to handle floating-point values.
572        cmpl  $FFI_TYPE_FLOAT,%ecx
573        jne   .Lnoretval
574        fstp  %st(0)
575
576        jmp   .Lepilogue
577
5780:
579	call	1f
580	# Do not insert anything here between the call and the jump table.
581.Lstore_table:
582	.long	.Lnoretval-.Lstore_table	/* FFI_TYPE_VOID */
583	.long	.Lretint-.Lstore_table		/* FFI_TYPE_INT */
584	.long	.Lretfloat-.Lstore_table	/* FFI_TYPE_FLOAT */
585	.long	.Lretdouble-.Lstore_table	/* FFI_TYPE_DOUBLE */
586	.long	.Lretlongdouble-.Lstore_table	/* FFI_TYPE_LONGDOUBLE */
587	.long	.Lretuint8-.Lstore_table	/* FFI_TYPE_UINT8 */
588	.long	.Lretsint8-.Lstore_table	/* FFI_TYPE_SINT8 */
589	.long	.Lretuint16-.Lstore_table	/* FFI_TYPE_UINT16 */
590	.long	.Lretsint16-.Lstore_table	/* FFI_TYPE_SINT16 */
591	.long	.Lretint-.Lstore_table		/* FFI_TYPE_UINT32 */
592	.long	.Lretint-.Lstore_table		/* FFI_TYPE_SINT32 */
593	.long	.Lretint64-.Lstore_table	/* FFI_TYPE_UINT64 */
594	.long	.Lretint64-.Lstore_table	/* FFI_TYPE_SINT64 */
595	.long	.Lretstruct-.Lstore_table	/* FFI_TYPE_STRUCT */
596	.long	.Lretint-.Lstore_table		/* FFI_TYPE_POINTER */
597	.long	.Lretstruct1b-.Lstore_table	/* FFI_TYPE_SMALL_STRUCT_1B */
598	.long	.Lretstruct2b-.Lstore_table	/* FFI_TYPE_SMALL_STRUCT_2B */
599	.long	.Lretstruct4b-.Lstore_table	/* FFI_TYPE_SMALL_STRUCT_4B */
600	.long	.Lretstruct-.Lstore_table	/* FFI_TYPE_MS_STRUCT */
6011:
602	shl	$2, %ecx
603	add	(%esp),%ecx
604	mov	(%ecx),%ecx
605	add	(%esp),%ecx
606	add	$4, %esp
607	jmp	*%ecx
608
609	/* Sign/zero extend as appropriate.  */
610.Lretsint8:
611	movsbl	%al, %eax
612	jmp	.Lretint
613
614.Lretsint16:
615	movswl	%ax, %eax
616	jmp	.Lretint
617
618.Lretuint8:
619	movzbl	%al, %eax
620	jmp	.Lretint
621
622.Lretuint16:
623	movzwl	%ax, %eax
624	jmp	.Lretint
625
626.Lretint:
627        # Load %ecx with the pointer to storage for the return value
628        movl  28(%ebp),%ecx
629        movl  %eax,0(%ecx)
630        jmp   .Lepilogue
631
632.Lretfloat:
633         # Load %ecx with the pointer to storage for the return value
634        movl  28(%ebp),%ecx
635        fstps (%ecx)
636        jmp   .Lepilogue
637
638.Lretdouble:
639        # Load %ecx with the pointer to storage for the return value
640        movl  28(%ebp),%ecx
641        fstpl (%ecx)
642        jmp   .Lepilogue
643
644.Lretlongdouble:
645        # Load %ecx with the pointer to storage for the return value
646        movl  28(%ebp),%ecx
647        fstpt (%ecx)
648        jmp   .Lepilogue
649
650.Lretint64:
651        # Load %ecx with the pointer to storage for the return value
652        movl  28(%ebp),%ecx
653        movl  %eax,0(%ecx)
654        movl  %edx,4(%ecx)
655	jmp   .Lepilogue
656
657.Lretstruct1b:
658        # Load %ecx with the pointer to storage for the return value
659        movl  28(%ebp),%ecx
660        movb  %al,0(%ecx)
661        jmp   .Lepilogue
662
663.Lretstruct2b:
664        # Load %ecx with the pointer to storage for the return value
665        movl  28(%ebp),%ecx
666        movw  %ax,0(%ecx)
667        jmp   .Lepilogue
668
669.Lretstruct4b:
670        # Load %ecx with the pointer to storage for the return value
671        movl  28(%ebp),%ecx
672        movl  %eax,0(%ecx)
673        jmp   .Lepilogue
674
675.Lretstruct:
676        # Nothing to do!
677
678.Lnoretval:
679.Lepilogue:
680        movl %ebp,%esp
681        popl %ebp
682        ret
683.ffi_call_win32_end:
684        .balign 16
685FFI_HIDDEN(ffi_closure_THISCALL)
686	.globl	USCORE_SYMBOL(ffi_closure_THISCALL)
687#if defined(X86_WIN32) && !defined(__OS2__)
688	.def	_ffi_closure_THISCALL;	.scl	2;	.type	32;	.endef
689#endif
690USCORE_SYMBOL(ffi_closure_THISCALL):
691	/* Insert the register argument on the stack as the first argument */
692	xchg	%ecx, 4(%esp)
693	xchg	%ecx, (%esp)
694	push	%ecx
695	jmp	.ffi_closure_STDCALL_internal
696
697        .balign 16
698FFI_HIDDEN(ffi_closure_FASTCALL)
699	.globl	USCORE_SYMBOL(ffi_closure_FASTCALL)
700#if defined(X86_WIN32) && !defined(__OS2__)
701	.def	_ffi_closure_FASTCALL;	.scl	2;	.type	32;	.endef
702#endif
703USCORE_SYMBOL(ffi_closure_FASTCALL):
704	/* Insert the register arguments on the stack as the first two arguments */
705	xchg	%edx, 4(%esp)
706	xchg	%ecx, (%esp)
707	push	%edx
708	push	%ecx
709	jmp	.ffi_closure_STDCALL_internal
710.LFE1:
711
712        # This assumes we are using gas.
713        .balign 16
714FFI_HIDDEN(ffi_closure_SYSV)
715#if defined(X86_WIN32)
716	.globl	USCORE_SYMBOL(ffi_closure_SYSV)
717#if defined(X86_WIN32) && !defined(__OS2__)
718	.def	_ffi_closure_SYSV;	.scl	2;	.type	32;	.endef
719#endif
720USCORE_SYMBOL(ffi_closure_SYSV):
721#endif
722.LFB3:
723	pushl	%ebp
724.LCFI4:
725	movl	%esp, %ebp
726.LCFI5:
727	subl	$40, %esp
728	leal	-24(%ebp), %edx
729	movl	%edx, -12(%ebp)	/* resp */
730	leal	8(%ebp), %edx
731	movl	%edx, 4(%esp)	/* args = __builtin_dwarf_cfa () */
732	leal	-12(%ebp), %edx
733	movl	%edx, (%esp)	/* &resp */
734#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
735	call	USCORE_SYMBOL(ffi_closure_SYSV_inner)
736#elif defined(X86_DARWIN)
737	calll	L_ffi_closure_SYSV_inner$stub
738#else
739	movl	%ebx, 8(%esp)
740	call	1f
7411:	popl	%ebx
742	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
743	call	ffi_closure_SYSV_inner@PLT
744	movl	8(%esp), %ebx
745#endif
746	movl	-12(%ebp), %ecx
747
7480:
749	call	1f
750	# Do not insert anything here between the call and the jump table.
751.Lcls_store_table:
752	.long	.Lcls_noretval-.Lcls_store_table	/* FFI_TYPE_VOID */
753	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_INT */
754	.long	.Lcls_retfloat-.Lcls_store_table	/* FFI_TYPE_FLOAT */
755	.long	.Lcls_retdouble-.Lcls_store_table	/* FFI_TYPE_DOUBLE */
756	.long	.Lcls_retldouble-.Lcls_store_table	/* FFI_TYPE_LONGDOUBLE */
757	.long	.Lcls_retuint8-.Lcls_store_table	/* FFI_TYPE_UINT8 */
758	.long	.Lcls_retsint8-.Lcls_store_table	/* FFI_TYPE_SINT8 */
759	.long	.Lcls_retuint16-.Lcls_store_table	/* FFI_TYPE_UINT16 */
760	.long	.Lcls_retsint16-.Lcls_store_table	/* FFI_TYPE_SINT16 */
761	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_UINT32 */
762	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_SINT32 */
763	.long	.Lcls_retllong-.Lcls_store_table	/* FFI_TYPE_UINT64 */
764	.long	.Lcls_retllong-.Lcls_store_table	/* FFI_TYPE_SINT64 */
765	.long	.Lcls_retstruct-.Lcls_store_table	/* FFI_TYPE_STRUCT */
766	.long	.Lcls_retint-.Lcls_store_table		/* FFI_TYPE_POINTER */
767	.long	.Lcls_retstruct1-.Lcls_store_table	/* FFI_TYPE_SMALL_STRUCT_1B */
768	.long	.Lcls_retstruct2-.Lcls_store_table	/* FFI_TYPE_SMALL_STRUCT_2B */
769	.long	.Lcls_retstruct4-.Lcls_store_table	/* FFI_TYPE_SMALL_STRUCT_4B */
770	.long	.Lcls_retmsstruct-.Lcls_store_table	/* FFI_TYPE_MS_STRUCT */
771
7721:
773	shl	$2, %eax
774	add	(%esp),%eax
775	mov	(%eax),%eax
776	add	(%esp),%eax
777	add	$4, %esp
778	jmp	*%eax
779
780	/* Sign/zero extend as appropriate.  */
781.Lcls_retsint8:
782	movsbl	(%ecx), %eax
783	jmp	.Lcls_epilogue
784
785.Lcls_retsint16:
786	movswl	(%ecx), %eax
787	jmp	.Lcls_epilogue
788
789.Lcls_retuint8:
790	movzbl	(%ecx), %eax
791	jmp	.Lcls_epilogue
792
793.Lcls_retuint16:
794	movzwl	(%ecx), %eax
795	jmp	.Lcls_epilogue
796
797.Lcls_retint:
798	movl	(%ecx), %eax
799	jmp	.Lcls_epilogue
800
801.Lcls_retfloat:
802	flds	(%ecx)
803	jmp	.Lcls_epilogue
804
805.Lcls_retdouble:
806	fldl	(%ecx)
807	jmp	.Lcls_epilogue
808
809.Lcls_retldouble:
810	fldt	(%ecx)
811	jmp	.Lcls_epilogue
812
813.Lcls_retllong:
814	movl	(%ecx), %eax
815	movl	4(%ecx), %edx
816	jmp	.Lcls_epilogue
817
818.Lcls_retstruct1:
819	movsbl	(%ecx), %eax
820	jmp	.Lcls_epilogue
821
822.Lcls_retstruct2:
823	movswl	(%ecx), %eax
824	jmp	.Lcls_epilogue
825
826.Lcls_retstruct4:
827	movl	(%ecx), %eax
828	jmp	.Lcls_epilogue
829
830.Lcls_retstruct:
831        # Caller expects us to pop struct return value pointer hidden arg.
832	movl	%ebp, %esp
833	popl	%ebp
834	ret	$0x4
835
836.Lcls_retmsstruct:
837	# Caller expects us to return a pointer to the real return value.
838	mov	%ecx, %eax
839	# Caller doesn't expects us to pop struct return value pointer hidden arg.
840	jmp	.Lcls_epilogue
841
842.Lcls_noretval:
843.Lcls_epilogue:
844	movl	%ebp, %esp
845	popl	%ebp
846	ret
847.ffi_closure_SYSV_end:
848.LFE3:
849
850#if !FFI_NO_RAW_API
851
852#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
853#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
854#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
855#define CIF_FLAGS_OFFSET 20
856
857#ifdef X86_WIN32
858        .balign 16
859FFI_HIDDEN(ffi_closure_raw_THISCALL)
860	.globl	USCORE_SYMBOL(ffi_closure_raw_THISCALL)
861#if defined(X86_WIN32) && !defined(__OS2__)
862	.def	_ffi_closure_raw_THISCALL;	.scl	2;	.type	32;	.endef
863#endif
864USCORE_SYMBOL(ffi_closure_raw_THISCALL):
865	pushl	%ebp
866	movl	%esp, %ebp
867	pushl	%esi
868	subl	$36, %esp
869	movl	RAW_CLOSURE_CIF_OFFSET(%eax), %esi	 /* closure->cif */
870	movl	RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
871	movl	%edx, 12(%esp)	/* user_data */
872	leal	12(%ebp), %edx	/* __builtin_dwarf_cfa () */
873	jmp	.stubraw
874#endif /* X86_WIN32 */
875
876        # This assumes we are using gas.
877        .balign 16
878#if defined(X86_WIN32)
879	.globl	USCORE_SYMBOL(ffi_closure_raw_SYSV)
880#if defined(X86_WIN32) && !defined(__OS2__)
881	.def	_ffi_closure_raw_SYSV;	.scl	2;	.type	32;	.endef
882#endif
883USCORE_SYMBOL(ffi_closure_raw_SYSV):
884#endif /* defined(X86_WIN32) */
885.LFB4:
886	pushl	%ebp
887.LCFI6:
888	movl	%esp, %ebp
889.LCFI7:
890	pushl	%esi
891.LCFI8:
892	subl	$36, %esp
893	movl	RAW_CLOSURE_CIF_OFFSET(%eax), %esi	 /* closure->cif */
894	movl	RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
895	movl	%edx, 12(%esp)	/* user_data */
896	leal	8(%ebp), %edx	/* __builtin_dwarf_cfa () */
897.stubraw:
898	movl	%edx, 8(%esp)	/* raw_args */
899	leal	-24(%ebp), %edx
900	movl	%edx, 4(%esp)	/* &res */
901	movl	%esi, (%esp)	/* cif */
902	call	*RAW_CLOSURE_FUN_OFFSET(%eax)		 /* closure->fun */
903	movl	CIF_FLAGS_OFFSET(%esi), %eax		 /* rtype */
9040:
905	call	1f
906	# Do not insert anything here between the call and the jump table.
907.Lrcls_store_table:
908	.long	.Lrcls_noretval-.Lrcls_store_table	/* FFI_TYPE_VOID */
909	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_INT */
910	.long	.Lrcls_retfloat-.Lrcls_store_table	/* FFI_TYPE_FLOAT */
911	.long	.Lrcls_retdouble-.Lrcls_store_table	/* FFI_TYPE_DOUBLE */
912	.long	.Lrcls_retldouble-.Lrcls_store_table	/* FFI_TYPE_LONGDOUBLE */
913	.long	.Lrcls_retuint8-.Lrcls_store_table	/* FFI_TYPE_UINT8 */
914	.long	.Lrcls_retsint8-.Lrcls_store_table	/* FFI_TYPE_SINT8 */
915	.long	.Lrcls_retuint16-.Lrcls_store_table	/* FFI_TYPE_UINT16 */
916	.long	.Lrcls_retsint16-.Lrcls_store_table	/* FFI_TYPE_SINT16 */
917	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_UINT32 */
918	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_SINT32 */
919	.long	.Lrcls_retllong-.Lrcls_store_table	/* FFI_TYPE_UINT64 */
920	.long	.Lrcls_retllong-.Lrcls_store_table	/* FFI_TYPE_SINT64 */
921	.long	.Lrcls_retstruct-.Lrcls_store_table	/* FFI_TYPE_STRUCT */
922	.long	.Lrcls_retint-.Lrcls_store_table	/* FFI_TYPE_POINTER */
923	.long	.Lrcls_retstruct1-.Lrcls_store_table	/* FFI_TYPE_SMALL_STRUCT_1B */
924	.long	.Lrcls_retstruct2-.Lrcls_store_table	/* FFI_TYPE_SMALL_STRUCT_2B */
925	.long	.Lrcls_retstruct4-.Lrcls_store_table	/* FFI_TYPE_SMALL_STRUCT_4B */
926	.long	.Lrcls_retstruct-.Lrcls_store_table	/* FFI_TYPE_MS_STRUCT */
9271:
928	shl	$2, %eax
929	add	(%esp),%eax
930	mov	(%eax),%eax
931	add	(%esp),%eax
932	add	$4, %esp
933	jmp	*%eax
934
935	/* Sign/zero extend as appropriate.  */
936.Lrcls_retsint8:
937	movsbl	-24(%ebp), %eax
938	jmp	.Lrcls_epilogue
939
940.Lrcls_retsint16:
941	movswl	-24(%ebp), %eax
942	jmp	.Lrcls_epilogue
943
944.Lrcls_retuint8:
945	movzbl	-24(%ebp), %eax
946	jmp	.Lrcls_epilogue
947
948.Lrcls_retuint16:
949	movzwl	-24(%ebp), %eax
950	jmp	.Lrcls_epilogue
951
952.Lrcls_retint:
953	movl	-24(%ebp), %eax
954	jmp	.Lrcls_epilogue
955
956.Lrcls_retfloat:
957	flds	-24(%ebp)
958	jmp	.Lrcls_epilogue
959
960.Lrcls_retdouble:
961	fldl	-24(%ebp)
962	jmp	.Lrcls_epilogue
963
964.Lrcls_retldouble:
965	fldt	-24(%ebp)
966	jmp	.Lrcls_epilogue
967
968.Lrcls_retllong:
969	movl	-24(%ebp), %eax
970	movl	-20(%ebp), %edx
971	jmp	.Lrcls_epilogue
972
973.Lrcls_retstruct1:
974	movsbl	-24(%ebp), %eax
975	jmp	.Lrcls_epilogue
976
977.Lrcls_retstruct2:
978	movswl	-24(%ebp), %eax
979	jmp	.Lrcls_epilogue
980
981.Lrcls_retstruct4:
982	movl	-24(%ebp), %eax
983	jmp	.Lrcls_epilogue
984
985.Lrcls_retstruct:
986	# Nothing to do!
987
988.Lrcls_noretval:
989.Lrcls_epilogue:
990	addl	$36, %esp
991	popl	%esi
992	popl	%ebp
993	ret
994.ffi_closure_raw_SYSV_end:
995.LFE4:
996
997#endif /* !FFI_NO_RAW_API */
998
999        # This assumes we are using gas.
1000	.balign	16
1001FFI_HIDDEN(ffi_closure_STDCALL)
1002	.globl	USCORE_SYMBOL(ffi_closure_STDCALL)
1003#if defined(X86_WIN32) && !defined(__OS2__)
1004	.def	_ffi_closure_STDCALL;	.scl	2;	.type	32;	.endef
1005#endif
1006USCORE_SYMBOL(ffi_closure_STDCALL):
1007.ffi_closure_STDCALL_internal:
1008.LFB5:
1009	pushl	%ebp
1010.LCFI9:
1011	movl	%esp, %ebp
1012.LCFI10:
1013	subl	$40, %esp
1014	leal	-24(%ebp), %edx
1015	movl	%edx, -12(%ebp)	/* resp */
1016	leal	12(%ebp), %edx  /* account for stub return address on stack */
1017	movl	%edx, 4(%esp)	/* args */
1018	leal	-12(%ebp), %edx
1019	movl	%edx, (%esp)	/* &resp */
1020#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
1021	call	USCORE_SYMBOL(ffi_closure_SYSV_inner)
1022#elif defined(X86_DARWIN)
1023	calll	L_ffi_closure_SYSV_inner$stub
1024#else
1025	movl	%ebx, 8(%esp)
1026	call	1f
10271:	popl	%ebx
1028	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
1029	call	ffi_closure_SYSV_inner@PLT
1030	movl	8(%esp), %ebx
1031#endif
1032	movl	-12(%ebp), %ecx
10330:
1034	call	1f
1035	# Do not insert anything here between the call and the jump table.
1036.Lscls_store_table:
1037	.long	.Lscls_noretval-.Lscls_store_table	/* FFI_TYPE_VOID */
1038	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_INT */
1039	.long	.Lscls_retfloat-.Lscls_store_table	/* FFI_TYPE_FLOAT */
1040	.long	.Lscls_retdouble-.Lscls_store_table	/* FFI_TYPE_DOUBLE */
1041	.long	.Lscls_retldouble-.Lscls_store_table	/* FFI_TYPE_LONGDOUBLE */
1042	.long	.Lscls_retuint8-.Lscls_store_table	/* FFI_TYPE_UINT8 */
1043	.long	.Lscls_retsint8-.Lscls_store_table	/* FFI_TYPE_SINT8 */
1044	.long	.Lscls_retuint16-.Lscls_store_table	/* FFI_TYPE_UINT16 */
1045	.long	.Lscls_retsint16-.Lscls_store_table	/* FFI_TYPE_SINT16 */
1046	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_UINT32 */
1047	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_SINT32 */
1048	.long	.Lscls_retllong-.Lscls_store_table	/* FFI_TYPE_UINT64 */
1049	.long	.Lscls_retllong-.Lscls_store_table	/* FFI_TYPE_SINT64 */
1050	.long	.Lscls_retstruct-.Lscls_store_table	/* FFI_TYPE_STRUCT */
1051	.long	.Lscls_retint-.Lscls_store_table	/* FFI_TYPE_POINTER */
1052	.long	.Lscls_retstruct1-.Lscls_store_table	/* FFI_TYPE_SMALL_STRUCT_1B */
1053	.long	.Lscls_retstruct2-.Lscls_store_table	/* FFI_TYPE_SMALL_STRUCT_2B */
1054	.long	.Lscls_retstruct4-.Lscls_store_table	/* FFI_TYPE_SMALL_STRUCT_4B */
10551:
1056	shl	$2, %eax
1057	add	(%esp),%eax
1058	mov	(%eax),%eax
1059	add	(%esp),%eax
1060	add	$4, %esp
1061	jmp	*%eax
1062
1063	/* Sign/zero extend as appropriate.  */
1064.Lscls_retsint8:
1065	movsbl	(%ecx), %eax
1066	jmp	.Lscls_epilogue
1067
1068.Lscls_retsint16:
1069	movswl	(%ecx), %eax
1070	jmp	.Lscls_epilogue
1071
1072.Lscls_retuint8:
1073	movzbl	(%ecx), %eax
1074	jmp	.Lscls_epilogue
1075
1076.Lscls_retuint16:
1077	movzwl	(%ecx), %eax
1078	jmp	.Lscls_epilogue
1079
1080.Lscls_retint:
1081	movl	(%ecx), %eax
1082	jmp	.Lscls_epilogue
1083
1084.Lscls_retfloat:
1085	flds	(%ecx)
1086	jmp	.Lscls_epilogue
1087
1088.Lscls_retdouble:
1089	fldl	(%ecx)
1090	jmp	.Lscls_epilogue
1091
1092.Lscls_retldouble:
1093	fldt	(%ecx)
1094	jmp	.Lscls_epilogue
1095
1096.Lscls_retllong:
1097	movl	(%ecx), %eax
1098	movl	4(%ecx), %edx
1099	jmp	.Lscls_epilogue
1100
1101.Lscls_retstruct1:
1102	movsbl	(%ecx), %eax
1103	jmp	.Lscls_epilogue
1104
1105.Lscls_retstruct2:
1106	movswl	(%ecx), %eax
1107	jmp	.Lscls_epilogue
1108
1109.Lscls_retstruct4:
1110	movl	(%ecx), %eax
1111	jmp	.Lscls_epilogue
1112
1113.Lscls_retstruct:
1114	# Nothing to do!
1115
1116.Lscls_noretval:
1117.Lscls_epilogue:
1118	movl	%ebp, %esp
1119	popl	%ebp
1120	popl	%ecx
1121	popl	%edx
1122	movl	(CLOSURE_CIF_OFFSET-10)(%ecx), %ecx
1123	addl	CIF_BYTES_OFFSET(%ecx), %esp
1124	movl	CIF_ABI_OFFSET(%ecx), %ecx
1125	cmpl	$3, %ecx /* FFI_THISCALL */
1126	je	1f
1127	cmpl	$4, %ecx /* FFI_FASTCALL */
1128	jne	2f
1129
1130	addl	$4, %esp
11311:	addl	$4, %esp
11322:	jmp	*%edx
1133.ffi_closure_STDCALL_end:
1134.LFE5:
1135
1136#if defined(X86_DARWIN)
1137.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
1138L_ffi_closure_SYSV_inner$stub:
1139	.indirect_symbol _ffi_closure_SYSV_inner
1140	hlt ; hlt ; hlt ; hlt ; hlt
1141#endif
1142
1143#if defined(X86_WIN32) && !defined(__OS2__)
1144	.section	.eh_frame,"w"
1145#endif
1146.Lframe1:
1147.LSCIE1:
1148	.long	.LECIE1-.LASCIE1  /* Length of Common Information Entry */
1149.LASCIE1:
1150	.long	0x0	/* CIE Identifier Tag */
1151	.byte	0x1	/* CIE Version */
1152#ifdef __PIC__
1153	.ascii "zR\0"	/* CIE Augmentation */
1154#else
1155	.ascii "\0"	/* CIE Augmentation */
1156#endif
1157	.byte	0x1	/* .uleb128 0x1; CIE Code Alignment Factor */
1158	.byte	0x7c	/* .sleb128 -4; CIE Data Alignment Factor */
1159	.byte	0x8	/* CIE RA Column */
1160#ifdef __PIC__
1161	.byte	0x1	/* .uleb128 0x1; Augmentation size */
1162	.byte	0x1b	/* FDE Encoding (pcrel sdata4) */
1163#endif
1164	.byte	0xc	/* DW_CFA_def_cfa CFA = r4 + 4 = 4(%esp) */
1165	.byte	0x4	/* .uleb128 0x4 */
1166	.byte	0x4	/* .uleb128 0x4 */
1167	.byte	0x88	/* DW_CFA_offset, column 0x8 %eip at CFA + 1 * -4 */
1168	.byte	0x1	/* .uleb128 0x1 */
1169	.align 4
1170.LECIE1:
1171
1172.LSFDE1:
1173	.long	.LEFDE1-.LASFDE1	/* FDE Length */
1174.LASFDE1:
1175	.long	.LASFDE1-.Lframe1	/* FDE CIE offset */
1176#if defined __PIC__ && defined HAVE_AS_X86_PCREL
1177	.long	.LFB1-.	/* FDE initial location */
1178#else
1179	.long	.LFB1
1180#endif
1181	.long	.LFE1-.LFB1	/* FDE address range */
1182#ifdef __PIC__
1183	.byte	0x0	/* .uleb128 0x0; Augmentation size */
1184#endif
1185	/* DW_CFA_xxx CFI instructions go here.  */
1186
1187	.byte	0x4	/* DW_CFA_advance_loc4 */
1188	.long	.LCFI0-.LFB1
1189	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
1190	.byte	0x8	/* .uleb128 0x8 */
1191	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
1192	.byte	0x2	/* .uleb128 0x2 */
1193
1194	.byte	0x4	/* DW_CFA_advance_loc4 */
1195	.long	.LCFI1-.LCFI0
1196	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
1197	.byte	0x5	/* .uleb128 0x5 */
1198
1199	/* End of DW_CFA_xxx CFI instructions.  */
1200	.align 4
1201.LEFDE1:
1202
1203.LSFDE3:
1204	.long	.LEFDE3-.LASFDE3	/* FDE Length */
1205.LASFDE3:
1206	.long	.LASFDE3-.Lframe1	/* FDE CIE offset */
1207#if defined __PIC__ && defined HAVE_AS_X86_PCREL
1208	.long	.LFB3-.	/* FDE initial location */
1209#else
1210	.long	.LFB3
1211#endif
1212	.long	.LFE3-.LFB3	/* FDE address range */
1213#ifdef __PIC__
1214	.byte	0x0	/* .uleb128 0x0; Augmentation size */
1215#endif
1216	/* DW_CFA_xxx CFI instructions go here.  */
1217
1218	.byte	0x4	/* DW_CFA_advance_loc4 */
1219	.long	.LCFI4-.LFB3
1220	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
1221	.byte	0x8	/* .uleb128 0x8 */
1222	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
1223	.byte	0x2	/* .uleb128 0x2 */
1224
1225	.byte	0x4	/* DW_CFA_advance_loc4 */
1226	.long	.LCFI5-.LCFI4
1227	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
1228	.byte	0x5	/* .uleb128 0x5 */
1229
1230	/* End of DW_CFA_xxx CFI instructions.  */
1231	.align 4
1232.LEFDE3:
1233
1234#if !FFI_NO_RAW_API
1235
1236.LSFDE4:
1237	.long	.LEFDE4-.LASFDE4	/* FDE Length */
1238.LASFDE4:
1239	.long	.LASFDE4-.Lframe1	/* FDE CIE offset */
1240#if defined __PIC__ && defined HAVE_AS_X86_PCREL
1241	.long	.LFB4-.	/* FDE initial location */
1242#else
1243	.long	.LFB4
1244#endif
1245	.long	.LFE4-.LFB4	/* FDE address range */
1246#ifdef __PIC__
1247	.byte	0x0	/* .uleb128 0x0; Augmentation size */
1248#endif
1249	/* DW_CFA_xxx CFI instructions go here.  */
1250
1251	.byte	0x4	/* DW_CFA_advance_loc4 */
1252	.long	.LCFI6-.LFB4
1253	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
1254	.byte	0x8	/* .uleb128 0x8 */
1255	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
1256	.byte	0x2	/* .uleb128 0x2 */
1257
1258	.byte	0x4	/* DW_CFA_advance_loc4 */
1259	.long	.LCFI7-.LCFI6
1260	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
1261	.byte	0x5	/* .uleb128 0x5 */
1262
1263	.byte	0x4	/* DW_CFA_advance_loc4 */
1264	.long	.LCFI8-.LCFI7
1265	.byte	0x86	/* DW_CFA_offset, column 0x6 %esi at CFA + 3 * -4 */
1266	.byte	0x3	/* .uleb128 0x3 */
1267
1268	/* End of DW_CFA_xxx CFI instructions.  */
1269	.align 4
1270.LEFDE4:
1271
1272#endif /* !FFI_NO_RAW_API */
1273
1274.LSFDE5:
1275	.long	.LEFDE5-.LASFDE5	/* FDE Length */
1276.LASFDE5:
1277	.long	.LASFDE5-.Lframe1	/* FDE CIE offset */
1278#if defined __PIC__ && defined HAVE_AS_X86_PCREL
1279	.long	.LFB5-.	/* FDE initial location */
1280#else
1281	.long	.LFB5
1282#endif
1283	.long	.LFE5-.LFB5	/* FDE address range */
1284#ifdef __PIC__
1285	.byte	0x0	/* .uleb128 0x0; Augmentation size */
1286#endif
1287	/* DW_CFA_xxx CFI instructions go here.  */
1288
1289	.byte	0x4	/* DW_CFA_advance_loc4 */
1290	.long	.LCFI9-.LFB5
1291	.byte	0xe	/* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
1292	.byte	0x8	/* .uleb128 0x8 */
1293	.byte	0x85	/* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
1294	.byte	0x2	/* .uleb128 0x2 */
1295
1296	.byte	0x4	/* DW_CFA_advance_loc4 */
1297	.long	.LCFI10-.LCFI9
1298	.byte	0xd	/* DW_CFA_def_cfa_register CFA = r5 = %ebp */
1299	.byte	0x5	/* .uleb128 0x5 */
1300
1301	/* End of DW_CFA_xxx CFI instructions.  */
1302	.align 4
1303.LEFDE5:
1304
1305#endif /* !_MSC_VER */
1306
1307