clarify the purpose of this project
[nyanglibc.git] / resolv / inet_addr.shared.s
blob171298e5eb5a7db4b473be604f23dfcd233a7b2f
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .type inet_aton_end, @function
9 inet_aton_end:
10 pushq %r15
11 pushq %r14
12 pushq %r13
13 pushq %r12
14 pushq %rbp
15 pushq %rbx
16 subq $40, %rsp
17 movq __libc_errno@gottpoff(%rip), %rax
18 movq %rsi, (%rsp)
19 movq %rdx, 8(%rsp)
20 movl $0, 20(%rsp)
21 movl %fs:(%rax), %r15d
22 movl $0, %fs:(%rax)
23 movsbl (%rdi), %eax
24 subl $48, %eax
25 cmpl $9, %eax
26 ja .L6
27 leaq 20(%rsp), %rbp
28 movq %rdi, %rbx
29 leaq 24(%rsp), %r13
30 movl $4294967295, %r12d
31 movq %rbp, %r14
32 jmp .L7
33 .p2align 4,,10
34 .p2align 3
35 .L23:
36 movq 24(%rsp), %rdx
37 movsbq (%rdx), %rsi
38 cmpb $46, %sil
39 jne .L20
40 cmpq $255, %rax
41 ja .L6
42 leaq 2(%rbp), %rsi
43 cmpq %rsi, %r14
44 ja .L6
45 addq $1, %r14
46 movb %al, -1(%r14)
47 movsbl 1(%rdx), %eax
48 leaq 1(%rdx), %rbx
49 subl $48, %eax
50 cmpl $9, %eax
51 ja .L6
52 .L7:
53 xorl %edx, %edx
54 movq %r13, %rsi
55 movq %rbx, %rdi
56 call __GI_strtoul
57 cmpq %r12, %rax
58 jbe .L23
59 .L6:
60 movq __libc_errno@gottpoff(%rip), %rax
61 movl %r15d, %fs:(%rax)
62 xorl %eax, %eax
63 .L1:
64 addq $40, %rsp
65 popq %rbx
66 popq %rbp
67 popq %r12
68 popq %r13
69 popq %r14
70 popq %r15
71 ret
72 .p2align 4,,10
73 .p2align 3
74 .L20:
75 testb %sil, %sil
76 je .L8
77 js .L6
78 movq __libc_tsd_CTYPE_B@gottpoff(%rip), %rdi
79 movq %fs:(%rdi), %rdi
80 testb $32, 1(%rdi,%rsi,2)
81 je .L6
82 .L8:
83 cmpq %rbx, %rdx
84 je .L6
85 movq %r14, %rcx
86 leaq max.8101(%rip), %rsi
87 subq %rbp, %rcx
88 cmpl %eax, (%rsi,%rcx,4)
89 jb .L6
90 movq (%rsp), %rcx
91 testq %rcx, %rcx
92 je .L9
93 bswap %eax
94 orl 20(%rsp), %eax
95 movl %eax, (%rcx)
96 .L9:
97 movq 8(%rsp), %rax
98 movq %rdx, (%rax)
99 movq __libc_errno@gottpoff(%rip), %rax
100 movl %r15d, %fs:(%rax)
101 movl $1, %eax
102 jmp .L1
103 .size inet_aton_end, .-inet_aton_end
104 .p2align 4,,15
105 .globl __GI___inet_aton_exact
106 .hidden __GI___inet_aton_exact
107 .type __GI___inet_aton_exact, @function
108 __GI___inet_aton_exact:
109 pushq %rbx
110 movq %rsi, %rbx
111 subq $16, %rsp
112 leaq 8(%rsp), %rdx
113 leaq 4(%rsp), %rsi
114 call inet_aton_end
115 testl %eax, %eax
116 je .L24
117 movq 8(%rsp), %rdx
118 xorl %eax, %eax
119 cmpb $0, (%rdx)
120 jne .L24
121 movl 4(%rsp), %eax
122 movl %eax, (%rbx)
123 movl $1, %eax
124 .L24:
125 addq $16, %rsp
126 popq %rbx
128 .size __GI___inet_aton_exact, .-__GI___inet_aton_exact
129 .globl __inet_aton_exact
130 .set __inet_aton_exact,__GI___inet_aton_exact
131 .p2align 4,,15
132 .globl __inet_aton_ignore_trailing
133 .type __inet_aton_ignore_trailing, @function
134 __inet_aton_ignore_trailing:
135 subq $24, %rsp
136 leaq 8(%rsp), %rdx
137 call inet_aton_end
138 addq $24, %rsp
140 .size __inet_aton_ignore_trailing, .-__inet_aton_ignore_trailing
141 .weak inet_aton
142 .set inet_aton,__inet_aton_ignore_trailing
143 .p2align 4,,15
144 .globl __inet_addr
145 .type __inet_addr, @function
146 __inet_addr:
147 subq $24, %rsp
148 leaq 8(%rsp), %rdx
149 leaq 4(%rsp), %rsi
150 call inet_aton_end
151 testl %eax, %eax
152 movl $-1, %edx
153 je .L33
154 movl 4(%rsp), %edx
155 .L33:
156 movl %edx, %eax
157 addq $24, %rsp
159 .size __inet_addr, .-__inet_addr
160 .weak inet_addr
161 .set inet_addr,__inet_addr
162 .section .rodata.cst16,"aM",@progbits,16
163 .align 16
164 .type max.8101, @object
165 .size max.8101, 16
166 max.8101:
167 .long -1
168 .long 16777215
169 .long 65535
170 .long 255