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