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