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