clarify the purpose of this project
[nyanglibc.git] / libio / putchar.s
blobc74c0f10f0657b3cf9a4af77ec09a88c871786c1
1 .text
2 .p2align 4,,15
3 .globl putchar
4 .type putchar, @function
5 putchar:
6 .LFB68:
7 pushq %r12
8 pushq %rbp
9 movl %edi, %ebp
10 pushq %rbx
11 movq stdout(%rip), %rbx
12 movl (%rbx), %edx
13 andl $32768, %edx
14 jne .L17
15 movq 136(%rbx), %rcx
16 movq %fs:16, %r12
17 cmpq %r12, 8(%rcx)
18 je .L18
19 #APP
20 # 27 "putchar.c" 1
21 movl %fs:24,%eax
22 # 0 "" 2
23 #NO_APP
24 testl %eax, %eax
25 jne .L4
26 movl $1, %edx
27 #APP
28 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
29 cmpxchgl %edx, (%rcx)
30 # 0 "" 2
31 #NO_APP
32 .L5:
33 movq 136(%rbx), %rcx
34 movq stdout(%rip), %rdi
35 movq %r12, 8(%rcx)
36 .L3:
37 addl $1, 4(%rcx)
38 movq 40(%rdi), %rax
39 movzbl %bpl, %r8d
40 cmpq 48(%rdi), %rax
41 jb .L8
42 .L23:
43 movl %r8d, %esi
44 .LEHB0:
45 call __overflow
46 testl $32768, (%rbx)
47 movl %eax, %r8d
48 je .L22
49 .L1:
50 popq %rbx
51 movl %r8d, %eax
52 popq %rbp
53 popq %r12
54 ret
55 .p2align 4,,10
56 .p2align 3
57 .L17:
58 movq %rbx, %rdi
59 movzbl %bpl, %r8d
60 movq 40(%rdi), %rax
61 cmpq 48(%rdi), %rax
62 jnb .L23
63 .L8:
64 leaq 1(%rax), %rdx
65 movq %rdx, 40(%rdi)
66 movb %bpl, (%rax)
67 testl $32768, (%rbx)
68 jne .L1
69 .L22:
70 movq 136(%rbx), %rdi
71 movl 4(%rdi), %eax
72 subl $1, %eax
73 testl %eax, %eax
74 movl %eax, 4(%rdi)
75 jne .L1
76 movq $0, 8(%rdi)
77 #APP
78 # 885 "libioP.h" 1
79 movl %fs:24,%edx
80 # 0 "" 2
81 #NO_APP
82 testl %edx, %edx
83 jne .L13
84 subl $1, (%rdi)
85 movl %r8d, %eax
86 popq %rbx
87 popq %rbp
88 popq %r12
89 ret
90 .p2align 4,,10
91 .p2align 3
92 .L18:
93 movq %rbx, %rdi
94 jmp .L3
95 .p2align 4,,10
96 .p2align 3
97 .L4:
98 movl $1, %esi
99 movl %edx, %eax
100 lock cmpxchgl %esi, (%rcx)
101 je .L5
102 movq %rcx, %rdi
103 call __lll_lock_wait_private
104 .LEHE0:
105 jmp .L5
106 .p2align 4,,10
107 .p2align 3
108 .L13:
109 #APP
110 # 885 "libioP.h" 1
111 xchgl %eax, (%rdi)
112 # 0 "" 2
113 #NO_APP
114 cmpl $1, %eax
115 jle .L1
116 xorl %r10d, %r10d
117 movl $1, %edx
118 movl $129, %esi
119 movl $202, %eax
120 #APP
121 # 885 "libioP.h" 1
122 syscall
124 # 0 "" 2
125 #NO_APP
126 jmp .L1
127 .L19:
128 testl $32768, (%rbx)
129 movq %rax, %r8
130 jne .L15
131 movq 136(%rbx), %rdi
132 movl 4(%rdi), %eax
133 subl $1, %eax
134 testl %eax, %eax
135 movl %eax, 4(%rdi)
136 jne .L15
137 movq $0, 8(%rdi)
138 #APP
139 # 885 "libioP.h" 1
140 movl %fs:24,%edx
141 # 0 "" 2
142 #NO_APP
143 testl %edx, %edx
144 jne .L16
145 subl $1, (%rdi)
146 .L15:
147 movq %r8, %rdi
148 .LEHB1:
149 call _Unwind_Resume@PLT
150 .LEHE1:
151 .L16:
152 #APP
153 # 885 "libioP.h" 1
154 xchgl %eax, (%rdi)
155 # 0 "" 2
156 #NO_APP
157 subl $1, %eax
158 jle .L15
159 xorl %r10d, %r10d
160 movl $1, %edx
161 movl $129, %esi
162 movl $202, %eax
163 #APP
164 # 885 "libioP.h" 1
165 syscall
167 # 0 "" 2
168 #NO_APP
169 jmp .L15
170 .LFE68:
171 .globl __gcc_personality_v0
172 .section .gcc_except_table,"a",@progbits
173 .LLSDA68:
174 .byte 0xff
175 .byte 0xff
176 .byte 0x1
177 .uleb128 .LLSDACSE68-.LLSDACSB68
178 .LLSDACSB68:
179 .uleb128 .LEHB0-.LFB68
180 .uleb128 .LEHE0-.LEHB0
181 .uleb128 .L19-.LFB68
182 .uleb128 0
183 .uleb128 .LEHB1-.LFB68
184 .uleb128 .LEHE1-.LEHB1
185 .uleb128 0
186 .uleb128 0
187 .LLSDACSE68:
188 .text
189 .size putchar, .-putchar
190 .hidden DW.ref.__gcc_personality_v0
191 .weak DW.ref.__gcc_personality_v0
192 .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
193 .align 8
194 .type DW.ref.__gcc_personality_v0, @object
195 .size DW.ref.__gcc_personality_v0, 8
196 DW.ref.__gcc_personality_v0:
197 .quad __gcc_personality_v0
198 .hidden __lll_lock_wait_private
199 .hidden __overflow