clarify the purpose of this project
[nyanglibc.git] / stdio-common / reg-printf.s
blob2018a55b0267735e4105e6337f07187c895f820e
1 .text
2 #APP
3 .section __libc_freeres_ptrs, "aw", %nobits
4 .previous
5 #NO_APP
6 .p2align 4,,15
7 .globl __register_printf_specifier
8 .hidden __register_printf_specifier
9 .type __register_printf_specifier, @function
10 __register_printf_specifier:
11 cmpl $255, %edi
12 ja .L16
13 pushq %rbp
14 pushq %rbx
15 movq %rsi, %rbp
16 movl %edi, %ebx
17 subq $24, %rsp
18 #APP
19 # 52 "reg-printf.c" 1
20 movl %fs:24,%eax
21 # 0 "" 2
22 #NO_APP
23 testl %eax, %eax
24 jne .L4
25 movl $1, %ecx
26 #APP
27 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
28 cmpxchgl %ecx, lock(%rip)
29 # 0 "" 2
30 #NO_APP
31 .L5:
32 movq __printf_function_table(%rip), %rcx
33 testq %rcx, %rcx
34 je .L6
35 movq __printf_arginfo_table(%rip), %rax
36 .L7:
37 movslq %ebx, %rdi
38 xorl %r8d, %r8d
39 movq %rbp, (%rcx,%rdi,8)
40 movq %rdx, (%rax,%rdi,8)
41 .L8:
42 #APP
43 # 72 "reg-printf.c" 1
44 movl %fs:24,%eax
45 # 0 "" 2
46 #NO_APP
47 testl %eax, %eax
48 jne .L9
49 subl $1, lock(%rip)
50 .L1:
51 addq $24, %rsp
52 movl %r8d, %eax
53 popq %rbx
54 popq %rbp
55 ret
56 .p2align 4,,10
57 .p2align 3
58 .L6:
59 movl $16, %esi
60 movl $256, %edi
61 movq %rdx, 8(%rsp)
62 call calloc@PLT
63 testq %rax, %rax
64 movq %rax, __printf_arginfo_table(%rip)
65 movl $-1, %r8d
66 je .L8
67 leaq 2048(%rax), %rcx
68 movq 8(%rsp), %rdx
69 movq %rcx, __printf_function_table(%rip)
70 jmp .L7
71 .p2align 4,,10
72 .p2align 3
73 .L9:
74 xorl %eax, %eax
75 #APP
76 # 72 "reg-printf.c" 1
77 xchgl %eax, lock(%rip)
78 # 0 "" 2
79 #NO_APP
80 cmpl $1, %eax
81 jle .L1
82 xorl %r10d, %r10d
83 movl $1, %edx
84 movl $129, %esi
85 leaq lock(%rip), %rdi
86 movl $202, %eax
87 #APP
88 # 72 "reg-printf.c" 1
89 syscall
91 # 0 "" 2
92 #NO_APP
93 jmp .L1
94 .p2align 4,,10
95 .p2align 3
96 .L4:
97 xorl %eax, %eax
98 movl $1, %ecx
99 lock cmpxchgl %ecx, lock(%rip)
100 je .L5
101 leaq lock(%rip), %rdi
102 movq %rdx, 8(%rsp)
103 call __lll_lock_wait_private
104 movq 8(%rsp), %rdx
105 jmp .L5
106 .p2align 4,,10
107 .p2align 3
108 .L16:
109 movq __libc_errno@gottpoff(%rip), %rax
110 movl $-1, %r8d
111 movl $22, %fs:(%rax)
112 movl %r8d, %eax
114 .size __register_printf_specifier, .-__register_printf_specifier
115 .weak register_printf_specifier
116 .set register_printf_specifier,__register_printf_specifier
117 .p2align 4,,15
118 .globl __register_printf_function
119 .type __register_printf_function, @function
120 __register_printf_function:
121 jmp __register_printf_specifier
122 .size __register_printf_function, .-__register_printf_function
123 .weak register_printf_function
124 .set register_printf_function,__register_printf_function
125 .local lock
126 .comm lock,4,4
127 .hidden __printf_function_table
128 .comm __printf_function_table,8,8
129 .hidden __printf_arginfo_table
130 .globl __printf_arginfo_table
131 .section __libc_freeres_ptrs
132 #,"aw",@progbits
133 .align 8
134 .type __printf_arginfo_table, @object
135 .size __printf_arginfo_table, 8
136 __printf_arginfo_table:
137 .zero 8
138 .hidden __lll_lock_wait_private