clarify the purpose of this project
[nyanglibc.git] / libio / iofopen.s
blob684ebe249554ddde19d0d44493983a755c505bce
1 .text
2 .p2align 4,,15
3 .globl __fopen_maybe_mmap
4 .hidden __fopen_maybe_mmap
5 .type __fopen_maybe_mmap, @function
6 __fopen_maybe_mmap:
7 .LFB68:
8 testb $1, 116(%rdi)
9 movq %rdi, %rax
10 je .L2
11 testb $8, (%rdi)
12 je .L2
13 movl 192(%rdi), %edx
14 testl %edx, %edx
15 jle .L12
16 leaq _IO_wfile_jumps_maybe_mmap(%rip), %rdx
17 movq %rdx, 216(%rdi)
18 .L4:
19 movq 160(%rax), %rcx
20 movq %rdx, 224(%rcx)
21 .L2:
22 rep ret
23 .p2align 4,,10
24 .p2align 3
25 .L12:
26 leaq _IO_file_jumps_maybe_mmap(%rip), %rsi
27 leaq _IO_wfile_jumps_maybe_mmap(%rip), %rdx
28 movq %rsi, 216(%rdi)
29 jmp .L4
30 .LFE68:
31 .size __fopen_maybe_mmap, .-__fopen_maybe_mmap
32 .p2align 4,,15
33 .globl __fopen_internal
34 .hidden __fopen_internal
35 .type __fopen_internal, @function
36 __fopen_internal:
37 .LFB69:
38 pushq %r14
39 pushq %r13
40 movl %edx, %r14d
41 pushq %r12
42 pushq %rbp
43 movq %rdi, %r12
44 pushq %rbx
45 movl $472, %edi
46 movq %rsi, %r13
47 call malloc@PLT
48 testq %rax, %rax
49 je .L18
50 movq %rax, %rbx
51 leaq 224(%rax), %rax
52 leaq _IO_wfile_jumps(%rip), %r8
53 leaq 240(%rbx), %rcx
54 xorl %edx, %edx
55 xorl %esi, %esi
56 movq %rax, 136(%rbx)
57 movq %rbx, %rdi
58 movq %rbx, %rbp
59 call _IO_no_init@PLT
60 leaq _IO_file_jumps(%rip), %rax
61 movq %rbx, %rdi
62 movq %rax, 216(%rbx)
63 call _IO_new_file_init_internal
64 movl %r14d, %ecx
65 movq %r13, %rdx
66 movq %r12, %rsi
67 movq %rbx, %rdi
68 call _IO_file_fopen
69 testq %rax, %rax
70 je .L15
71 testb $1, 116(%rbx)
72 je .L13
73 testb $8, (%rbx)
74 jne .L26
75 .L13:
76 popq %rbx
77 movq %rbp, %rax
78 popq %rbp
79 popq %r12
80 popq %r13
81 popq %r14
82 ret
83 .p2align 4,,10
84 .p2align 3
85 .L26:
86 movl 192(%rbx), %eax
87 testl %eax, %eax
88 jle .L27
89 leaq _IO_wfile_jumps_maybe_mmap(%rip), %rax
90 movq %rax, 216(%rbx)
91 .L17:
92 movq 160(%rbx), %rdx
93 movq %rax, 224(%rdx)
94 movq %rbp, %rax
95 popq %rbx
96 popq %rbp
97 popq %r12
98 popq %r13
99 popq %r14
101 .p2align 4,,10
102 .p2align 3
103 .L18:
104 xorl %ebp, %ebp
105 jmp .L13
106 .p2align 4,,10
107 .p2align 3
108 .L27:
109 leaq _IO_file_jumps_maybe_mmap(%rip), %rax
110 movq %rax, 216(%rbx)
111 leaq _IO_wfile_jumps_maybe_mmap(%rip), %rax
112 jmp .L17
113 .p2align 4,,10
114 .p2align 3
115 .L15:
116 movq %rbx, %rdi
117 xorl %ebp, %ebp
118 call _IO_un_link
119 movq %rbx, %rdi
120 call free@PLT
121 jmp .L13
122 .LFE69:
123 .size __fopen_internal, .-__fopen_internal
124 .p2align 4,,15
125 .globl _IO_new_fopen
126 .type _IO_new_fopen, @function
127 _IO_new_fopen:
128 .LFB70:
129 movl $1, %edx
130 jmp __fopen_internal
131 .LFE70:
132 .size _IO_new_fopen, .-_IO_new_fopen
133 .weak fopen64
134 .set fopen64,_IO_new_fopen
135 .weak _IO_fopen64
136 .set _IO_fopen64,_IO_new_fopen
137 .weak _IO_fopen
138 .set _IO_fopen,_IO_new_fopen
139 .globl __new_fopen
140 .set __new_fopen,_IO_new_fopen
141 .weak fopen
142 .set fopen,__new_fopen
143 .hidden _IO_un_link
144 .hidden _IO_file_fopen
145 .hidden _IO_new_file_init_internal
146 .hidden _IO_file_jumps
147 .hidden _IO_wfile_jumps
148 .hidden _IO_file_jumps_maybe_mmap
149 .hidden _IO_wfile_jumps_maybe_mmap