clarify the purpose of this project
[nyanglibc.git] / debug / readonly-area.shared.s
blobfcfe8e6e591bdfa801bd6f23c4424a27f5f53d15
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 "rce"
9 .LC1:
10 .string "/proc/self/maps"
11 #NO_APP
12 .text
13 .p2align 4,,15
14 .globl __readonly_area
15 .type __readonly_area, @function
16 __readonly_area:
17 pushq %r15
18 pushq %r14
19 pushq %r13
20 pushq %r12
21 movq %rdi, %r12
22 pushq %rbp
23 pushq %rbx
24 movq %rsi, %rbp
25 leaq .LC1(%rip), %rdi
26 leaq .LC0(%rip), %rsi
27 subq $72, %rsp
28 call _IO_new_fopen@PLT
29 testq %rax, %rax
30 je .L40
31 movq %rax, %rbx
32 movl (%rax), %eax
33 movl %eax, %edx
34 orb $-128, %dh
35 testb $16, %al
36 movl %edx, (%rbx)
37 movq $0, 32(%rsp)
38 movq $0, 40(%rsp)
39 jne .L6
40 leaq 32(%rsp), %rax
41 leaq 40(%rsp), %r15
42 leaq (%r12,%rbp), %r13
43 movq %rax, 8(%rsp)
44 leaq 48(%rsp), %rax
45 movq %rax, 16(%rsp)
46 leaq 56(%rsp), %rax
47 movq %rax, 24(%rsp)
48 jmp .L13
49 .p2align 4,,10
50 .p2align 3
51 .L41:
52 addq %r12, %rbp
53 subq %rax, %rbp
54 .L11:
55 testq %rbp, %rbp
56 je .L6
57 .L8:
58 testb $16, (%rbx)
59 jne .L6
60 .L13:
61 movq 8(%rsp), %rdi
62 movq %rbx, %rcx
63 movl $10, %edx
64 movq %r15, %rsi
65 call _IO_getdelim@PLT
66 testq %rax, %rax
67 jle .L6
68 movq 16(%rsp), %rsi
69 movq 32(%rsp), %rdi
70 movl $16, %edx
71 call __GI_strtoul
72 movq %rax, %r14
73 movq 48(%rsp), %rax
74 cmpq 32(%rsp), %rax
75 je .L6
76 leaq 1(%rax), %rdi
77 movq %rdi, 48(%rsp)
78 cmpb $45, (%rax)
79 jne .L6
80 movq 24(%rsp), %rsi
81 movl $16, %edx
82 call __GI_strtoul
83 movq 56(%rsp), %rdx
84 cmpq 48(%rsp), %rdx
85 je .L6
86 leaq 1(%rdx), %rsi
87 movq %rsi, 56(%rsp)
88 cmpb $32, (%rdx)
89 jne .L6
90 cmpq %r14, %r13
91 jbe .L8
92 cmpq %rax, %r12
93 jnb .L8
94 leaq 2(%rdx), %rsi
95 movq %rsi, 56(%rsp)
96 cmpb $114, 1(%rdx)
97 jne .L6
98 leaq 3(%rdx), %rsi
99 movq %rsi, 56(%rsp)
100 cmpb $45, 2(%rdx)
101 jne .L6
102 cmpq %r14, %r12
103 jb .L17
104 cmpq %rax, %r13
105 jbe .L16
106 .L17:
107 cmpq %r14, %r12
108 jnb .L41
109 cmpq %rax, %r13
110 ja .L12
111 subq %r13, %rbp
112 addq %r14, %rbp
113 jmp .L11
114 .L16:
115 xorl %ebp, %ebp
116 .p2align 4,,10
117 .p2align 3
118 .L6:
119 movq %rbx, %rdi
120 call _IO_new_fclose@PLT
121 movq 32(%rsp), %rdi
122 call free@PLT
123 testq %rbp, %rbp
124 jne .L3
125 .L14:
126 movl $1, %eax
127 .L1:
128 addq $72, %rsp
129 popq %rbx
130 popq %rbp
131 popq %r12
132 popq %r13
133 popq %r14
134 popq %r15
136 .p2align 4,,10
137 .p2align 3
138 .L12:
139 addq %r14, %rbp
140 subq %rax, %rbp
141 jmp .L11
142 .p2align 4,,10
143 .p2align 3
144 .L40:
145 movq __libc_errno@gottpoff(%rip), %rax
146 movl %fs:(%rax), %eax
147 cmpl $2, %eax
148 je .L14
149 cmpl $13, %eax
150 je .L14
151 .L3:
152 movl $-1, %eax
153 jmp .L1
154 .size __readonly_area, .-__readonly_area