clarify the purpose of this project
[nyanglibc.git] / stdlib / on_exit.shared.s
blob1edf838db0e1931e2c9ee36cae3f709ea921e2e4
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .rodata.str1.1,"aMS",@progbits,1
7 .LC0:
8 .string "on_exit.c"
9 .LC1:
10 .string "func != NULL"
11 #NO_APP
12 .text
13 .p2align 4,,15
14 .globl __on_exit
15 .type __on_exit, @function
16 __on_exit:
17 testq %rdi, %rdi
18 pushq %r12
19 pushq %rbp
20 pushq %rbx
21 je .L14
22 movq %rdi, %rbp
23 movq %rsi, %r12
24 #APP
25 # 33 "on_exit.c" 1
26 movl %fs:24,%eax
27 # 0 "" 2
28 #NO_APP
29 testl %eax, %eax
30 movq __exit_funcs_lock@GOTPCREL(%rip), %rbx
31 jne .L3
32 movl $1, %edx
33 #APP
34 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
35 cmpxchgl %edx, (%rbx)
36 # 0 "" 2
37 #NO_APP
38 .L4:
39 leaq __exit_funcs(%rip), %rdi
40 call __new_exitfn
41 testq %rax, %rax
42 je .L15
43 movq %rbp, %rdi
44 movq %r12, 16(%rax)
45 movq $2, (%rax)
46 #APP
47 # 43 "on_exit.c" 1
48 xor %fs:48, %rdi
49 rol $2*8+1, %rdi
50 # 0 "" 2
51 #NO_APP
52 movq %rdi, 8(%rax)
53 #APP
54 # 48 "on_exit.c" 1
55 movl %fs:24,%r8d
56 # 0 "" 2
57 #NO_APP
58 testl %r8d, %r8d
59 jne .L8
60 subl $1, (%rbx)
61 .L1:
62 popq %rbx
63 movl %r8d, %eax
64 popq %rbp
65 popq %r12
66 ret
67 .p2align 4,,10
68 .p2align 3
69 .L15:
70 #APP
71 # 38 "on_exit.c" 1
72 movl %fs:24,%eax
73 # 0 "" 2
74 #NO_APP
75 testl %eax, %eax
76 jne .L6
77 subl $1, (%rbx)
78 movl $-1, %r8d
79 popq %rbx
80 movl %r8d, %eax
81 popq %rbp
82 popq %r12
83 ret
84 .p2align 4,,10
85 .p2align 3
86 .L3:
87 xorl %eax, %eax
88 movl $1, %edx
89 lock cmpxchgl %edx, (%rbx)
90 je .L4
91 movq %rbx, %rdi
92 call __lll_lock_wait_private
93 jmp .L4
94 .p2align 4,,10
95 .p2align 3
96 .L8:
97 xorl %eax, %eax
98 #APP
99 # 48 "on_exit.c" 1
100 xchgl %eax, (%rbx)
101 # 0 "" 2
102 #NO_APP
103 xorl %r8d, %r8d
104 cmpl $1, %eax
105 jle .L1
106 .L12:
107 xorl %r10d, %r10d
108 movl $1, %edx
109 movl $129, %esi
110 movq %rbx, %rdi
111 movl $202, %eax
112 #APP
113 # 48 "on_exit.c" 1
114 syscall
116 # 0 "" 2
117 #NO_APP
118 jmp .L1
119 .p2align 4,,10
120 .p2align 3
121 .L6:
122 xorl %eax, %eax
123 #APP
124 # 38 "on_exit.c" 1
125 xchgl %eax, (%rbx)
126 # 0 "" 2
127 #NO_APP
128 cmpl $1, %eax
129 movl $-1, %r8d
130 jle .L1
131 jmp .L12
132 .L14:
133 leaq __PRETTY_FUNCTION__.7661(%rip), %rcx
134 leaq .LC0(%rip), %rsi
135 leaq .LC1(%rip), %rdi
136 movl $31, %edx
137 call __GI___assert_fail
138 .size __on_exit, .-__on_exit
139 .weak on_exit
140 .set on_exit,__on_exit
141 .section .rodata.str1.8,"aMS",@progbits,1
142 .align 8
143 .type __PRETTY_FUNCTION__.7661, @object
144 .size __PRETTY_FUNCTION__.7661, 10
145 __PRETTY_FUNCTION__.7661:
146 .string "__on_exit"
147 .hidden __lll_lock_wait_private
148 .hidden __new_exitfn
149 .hidden __exit_funcs