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