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