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