clarify the purpose of this project
[nyanglibc.git] / time / getdate.shared.s
blob7d9634f975cc2b4779e1f205c0c22c43f2347270
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .rodata.str1.1,"aMS",@progbits,1
7 .LC0:
8 .string "DATEMSK"
9 .LC1:
10 .string "rce"
11 #NO_APP
12 .text
13 .p2align 4,,15
14 .globl __getdate_r
15 .hidden __getdate_r
16 .type __getdate_r, @function
17 __getdate_r:
18 .LFB74:
19 pushq %rbp
20 movq %rsp, %rbp
21 pushq %r15
22 pushq %r14
23 pushq %r13
24 pushq %r12
25 movq %rdi, %r12
26 pushq %rbx
27 leaq .LC0(%rip), %rdi
28 movq %rsi, %rbx
29 subq $344, %rsp
30 call __GI_getenv
31 movq %rax, %r13
32 movl $1, %eax
33 testq %r13, %r13
34 je .L1
35 cmpb $0, 0(%r13)
36 jne .L96
37 .L1:
38 leaq -40(%rbp), %rsp
39 popq %rbx
40 popq %r12
41 popq %r13
42 popq %r14
43 popq %r15
44 popq %rbp
45 ret
46 .p2align 4,,10
47 .p2align 3
48 .L96:
49 leaq -192(%rbp), %rsi
50 movq %r13, %rdi
51 call __GI___stat64
52 testl %eax, %eax
53 js .L52
54 movl -168(%rbp), %edx
55 movl $4, %eax
56 andl $61440, %edx
57 cmpl $32768, %edx
58 jne .L1
59 movl $4, %esi
60 movq %r13, %rdi
61 call __GI___access
62 testl %eax, %eax
63 js .L4
64 leaq .LC1(%rip), %rsi
65 movq %r13, %rdi
66 call _IO_new_fopen@PLT
67 testq %rax, %rax
68 movq %rax, %r14
69 je .L4
70 orl $32768, (%rax)
71 movq __libc_tsd_CTYPE_B@gottpoff(%rip), %rax
72 movq %fs:(%rax), %r15
73 movsbq (%r12), %rax
74 testb $32, 1(%r15,%rax,2)
75 je .L5
76 .p2align 4,,10
77 .p2align 3
78 .L6:
79 addq $1, %r12
80 movsbq (%r12), %rax
81 testb $32, 1(%r15,%rax,2)
82 jne .L6
83 .L5:
84 movq %r12, %rdi
85 call __GI_strlen
86 testq %rax, %rax
87 je .L55
88 movsbq -1(%r12,%rax), %rdx
89 leaq -1(%rax), %r13
90 testb $32, 1(%r15,%rdx,2)
91 jne .L8
92 jmp .L55
93 .p2align 4,,10
94 .p2align 3
95 .L10:
96 movsbq -1(%r12,%r13), %rdx
97 leaq -1(%r13), %rcx
98 testb $32, 1(%r15,%rdx,2)
99 je .L9
100 movq %rcx, %r13
101 .L8:
102 testq %r13, %r13
103 jne .L10
104 movl $1, %r15d
105 .L11:
106 addq $30, %r15
107 movq %r12, %rsi
108 movq %r13, %rdx
109 andq $-16, %r15
110 subq %r15, %rsp
111 leaq 15(%rsp), %rcx
112 andq $-16, %rcx
113 movq %rcx, %rdi
114 call __GI_memcpy@PLT
115 movq $0, -376(%rbp)
116 movb $0, (%rax,%r13)
117 movq %rax, %r12
118 .L7:
119 leaq -336(%rbp), %rax
120 movq $0, -344(%rbp)
121 movq $0, -336(%rbp)
122 xorl %r15d, %r15d
123 movabsq $-9223372034707292160, %r13
124 movq %rax, -368(%rbp)
125 leaq -344(%rbp), %rax
126 movq %rax, -360(%rbp)
127 jmp .L18
128 .p2align 4,,10
129 .p2align 3
130 .L97:
131 movq -344(%rbp), %rsi
132 leaq -1(%rsi,%rax), %rax
133 cmpb $10, (%rax)
134 jne .L15
135 movb $0, (%rax)
136 movq -344(%rbp), %rsi
137 .L15:
138 movq %r13, (%rbx)
139 movq %r13, 8(%rbx)
140 movq %rbx, %rdx
141 movq %r13, 16(%rbx)
142 movl $-2147483648, 24(%rbx)
143 movq %r12, %rdi
144 movl $-1, 32(%rbx)
145 movq $0, 40(%rbx)
146 movq $0, 48(%rbx)
147 call __GI_strptime
148 testq %rax, %rax
149 movq %rax, %r15
150 je .L16
151 cmpb $0, (%rax)
152 je .L17
153 .L16:
154 testb $16, (%r14)
155 jne .L14
156 .L18:
157 movq -368(%rbp), %rsi
158 movq -360(%rbp), %rdi
159 movq %r14, %rdx
160 call __getline
161 testq %rax, %rax
162 jns .L97
163 .L14:
164 movq -376(%rbp), %rdi
165 call free@PLT
166 movq -344(%rbp), %rdi
167 call free@PLT
168 testb $32, (%r14)
169 jne .L47
170 movq %r14, %rdi
171 call _IO_new_fclose@PLT
172 testq %r15, %r15
173 je .L21
174 .L20:
175 cmpb $0, (%r15)
176 jne .L21
177 leaq -256(%rbp), %r13
178 movl $5, %edi
179 movq %r13, %rsi
180 call __GI___clock_gettime
181 movq -256(%rbp), %rax
182 leaq -320(%rbp), %rsi
183 leaq -328(%rbp), %rdi
184 movq %rax, -328(%rbp)
185 call __localtime_r
186 movl 24(%rbx), %r12d
187 xorl %esi, %esi
188 cmpl $6, %r12d
189 ja .L22
190 movabsq $-9223372034707292160, %rax
191 cmpq %rax, 16(%rbx)
192 je .L98
193 .L22:
194 movl 16(%rbx), %edx
195 movl 20(%rbx), %ecx
196 cmpl $11, %edx
197 ja .L24
198 cmpl $-2147483648, 12(%rbx)
199 je .L99
200 .L24:
201 movl 8(%rbx), %eax
202 cmpl $-2147483648, %eax
203 je .L27
204 movl 4(%rbx), %r9d
205 movl (%rbx), %r8d
206 movl %eax, %edi
207 .L28:
208 cmpl $-2147483648, %r9d
209 jne .L31
210 movl $0, 4(%rbx)
211 .L31:
212 cmpl $-2147483648, %r8d
213 jne .L32
214 movl $0, (%rbx)
215 .L32:
216 cmpl $23, %edi
217 ja .L33
218 cmpl $-2147483648, %edx
219 je .L100
220 cmpl $-2147483648, %ecx
221 je .L49
222 .L40:
223 testl %esi, %esi
224 jne .L38
225 movl 16(%rbx), %ecx
226 cmpl $11, %ecx
227 ja .L41
228 movl $1, %eax
229 movl 12(%rbx), %esi
230 salq %cl, %rax
231 testl $2773, %eax
232 jne .L42
233 testl $1320, %eax
234 jne .L43
235 testb $2, %al
236 je .L41
237 testl %esi, %esi
238 jle .L41
239 movl 20(%rbx), %eax
240 leal 1900(%rax), %ecx
241 movl $28, %eax
242 testb $3, %cl
243 jne .L46
244 movl %ecx, %eax
245 movl $100, %edi
246 cltd
247 idivl %edi
248 movl $29, %eax
249 testl %edx, %edx
250 jne .L46
251 movl %ecx, %eax
252 movl $400, %edi
253 cltd
254 idivl %edi
255 cmpl $1, %edx
256 sbbl %eax, %eax
257 notl %eax
258 addl $29, %eax
259 .L46:
260 cmpl %eax, %esi
261 jle .L38
262 .L41:
263 movl $8, %eax
264 jmp .L1
265 .p2align 4,,10
266 .p2align 3
267 .L52:
268 movl $3, %eax
269 jmp .L1
270 .p2align 4,,10
271 .p2align 3
272 .L4:
273 movl $2, %eax
274 jmp .L1
275 .p2align 4,,10
276 .p2align 3
277 .L9:
278 cmpq %r13, %rax
279 jbe .L55
280 leaq 1(%r13), %r15
281 movq %r15, %rdi
282 call __GI___libc_alloca_cutoff
283 testl %eax, %eax
284 jne .L11
285 cmpq $4096, %r15
286 jbe .L11
287 movq %r15, %rdi
288 call malloc@PLT
289 testq %rax, %rax
290 movq %rax, -376(%rbp)
291 je .L101
292 movq -376(%rbp), %r15
293 movq %r12, %rsi
294 movq %r13, %rdx
295 movq %r15, %rdi
296 movq %r15, %r12
297 call __GI_memcpy@PLT
298 movb $0, (%r15,%r13)
299 jmp .L7
300 .p2align 4,,10
301 .p2align 3
302 .L21:
303 movl $7, %eax
304 jmp .L1
305 .p2align 4,,10
306 .p2align 3
307 .L55:
308 movq $0, -376(%rbp)
309 jmp .L7
310 .p2align 4,,10
311 .p2align 3
312 .L47:
313 movq %r14, %rdi
314 call _IO_new_fclose@PLT
315 movl $5, %eax
316 jmp .L1
317 .p2align 4,,10
318 .p2align 3
319 .L17:
320 movq -376(%rbp), %rdi
321 call free@PLT
322 movq -344(%rbp), %rdi
323 call free@PLT
324 testb $32, (%r14)
325 jne .L47
326 movq %r14, %rdi
327 call _IO_new_fclose@PLT
328 jmp .L20
329 .L42:
330 subl $1, %esi
331 cmpl $30, %esi
332 ja .L41
333 .L38:
334 movq %rbx, %rdi
335 call __GI_mktime
336 movq %rax, %rdx
337 xorl %eax, %eax
338 cmpq $-1, %rdx
339 jne .L1
340 jmp .L41
341 .L33:
342 cmpl $-2147483648, %ecx
343 je .L49
344 .L39:
345 cmpl $-2147483648, %edx
346 jne .L40
347 .L94:
348 movl -304(%rbp), %edx
349 .L37:
350 movl %edx, 16(%rbx)
351 jmp .L40
352 .L27:
353 movabsq $-9223372034707292160, %rax
354 cmpq %rax, (%rbx)
355 je .L29
356 movl 4(%rbx), %r9d
357 movl (%rbx), %r8d
358 .L30:
359 movl $0, 8(%rbx)
360 xorl %edi, %edi
361 xorl %eax, %eax
362 jmp .L28
363 .L49:
364 movl -300(%rbp), %eax
365 movl %eax, 20(%rbx)
366 jmp .L39
367 .L98:
368 cmpl $-2147483648, 12(%rbx)
369 je .L102
370 movl 16(%rbx), %edx
371 movl 20(%rbx), %ecx
372 jmp .L24
373 .L100:
374 cmpl $-2147483648, 12(%rbx)
375 je .L103
376 .L35:
377 cmpl $-2147483648, %ecx
378 jne .L94
379 movl -300(%rbp), %eax
380 movl %eax, 20(%rbx)
381 jmp .L94
382 .L99:
383 cmpl $-2147483648, %ecx
384 je .L104
385 .L25:
386 cmpl $-2147483648, %r12d
387 movl $1, %eax
388 je .L26
389 pxor %xmm0, %xmm0
390 movq %r13, %rdi
391 movq $0, -208(%rbp)
392 movaps %xmm0, -240(%rbp)
393 movl %ecx, -236(%rbp)
394 movl %edx, -240(%rbp)
395 movaps %xmm0, -256(%rbp)
396 movaps %xmm0, -224(%rbp)
397 movl $1, -244(%rbp)
398 call __GI_mktime
399 movl %r12d, %ecx
400 subl -232(%rbp), %ecx
401 movl $-1840700269, %edx
402 addl $7, %ecx
403 movl %ecx, %eax
404 imull %edx
405 leal (%rdx,%rcx), %eax
406 movl %ecx, %edx
407 sarl $31, %edx
408 sarl $2, %eax
409 subl %edx, %eax
410 leal 0(,%rax,8), %edx
411 subl %eax, %edx
412 subl %edx, %ecx
413 movl 16(%rbx), %edx
414 leal 1(%rcx), %eax
415 movl 20(%rbx), %ecx
416 .L26:
417 movl %eax, 12(%rbx)
418 movl $1, %esi
419 jmp .L24
420 .L29:
421 movl -312(%rbp), %eax
422 movl -316(%rbp), %r9d
423 movl -320(%rbp), %r8d
424 cmpl $-2147483648, %eax
425 movl %eax, 8(%rbx)
426 movl %r9d, 4(%rbx)
427 movl %r8d, (%rbx)
428 je .L30
429 movl %eax, %edi
430 jmp .L28
431 .p2align 4,,10
432 .p2align 3
433 .L43:
434 subl $1, %esi
435 cmpl $29, %esi
436 ja .L41
437 jmp .L38
438 .L102:
439 movl -300(%rbp), %eax
440 movl -304(%rbp), %edx
441 movl $7, %ecx
442 movl $1, %esi
443 movl %eax, 20(%rbx)
444 movl %r12d, %eax
445 subl -296(%rbp), %eax
446 movl %edx, 16(%rbx)
447 addl $7, %eax
448 cltd
449 idivl %ecx
450 movl -308(%rbp), %eax
451 addl %edx, %eax
452 movl %eax, 12(%rbx)
453 jmp .L22
454 .L104:
455 movl %edx, %ecx
456 subl -304(%rbp), %ecx
457 shrl $31, %ecx
458 addl -300(%rbp), %ecx
459 movl %ecx, 20(%rbx)
460 jmp .L25
461 .L103:
462 cmpl $-2147483648, 24(%rbx)
463 jne .L35
464 subl -312(%rbp), %eax
465 movl -304(%rbp), %edx
466 movl %edx, 16(%rbx)
467 shrl $31, %eax
468 addl -308(%rbp), %eax
469 cmpl $-2147483648, %ecx
470 movl %eax, 12(%rbx)
471 jne .L38
472 movl -300(%rbp), %eax
473 cmpl $-2147483648, %edx
474 movl %eax, 20(%rbx)
475 jne .L38
476 movl $1, %esi
477 jmp .L37
478 .L101:
479 movq %r14, %rdi
480 call _IO_new_fclose@PLT
481 movl $6, %eax
482 jmp .L1
483 .LFE74:
484 .size __getdate_r, .-__getdate_r
485 .weak getdate_r
486 .set getdate_r,__getdate_r
487 .p2align 4,,15
488 .globl getdate
489 .type getdate, @function
490 getdate:
491 .LFB75:
492 leaq tmbuf.10015(%rip), %rsi
493 subq $8, %rsp
494 call __getdate_r
495 testl %eax, %eax
496 leaq tmbuf.10015(%rip), %rdx
497 jne .L111
498 .L105:
499 movq %rdx, %rax
500 addq $8, %rsp
502 .p2align 4,,10
503 .p2align 3
504 .L111:
505 movq getdate_err@GOTPCREL(%rip), %rdx
506 movl %eax, (%rdx)
507 xorl %edx, %edx
508 jmp .L105
509 .LFE75:
510 .size getdate, .-getdate
511 .local tmbuf.10015
512 .comm tmbuf.10015,56,32
513 .comm getdate_err,4,4
514 .hidden __localtime_r
515 .hidden __getline