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