clarify the purpose of this project
[nyanglibc.git] / stdlib / makecontext.s
blobda762ecffa217c357bcecbbdd296b6636e7e5af6
1 .text
2 .p2align 4,,15
3 .globl __makecontext
4 .type __makecontext, @function
5 __makecontext:
6 pushq %rbx
7 movq $-8, %rax
8 movq %rcx, -24(%rsp)
9 movq 32(%rdi), %rcx
10 addq 16(%rdi), %rcx
11 cmpl $6, %edx
12 movq %r8, -16(%rsp)
13 movq %r9, -8(%rsp)
14 jle .L2
15 leal -6(%rdx), %r8d
16 movslq %r8d, %r8
17 salq $3, %r8
18 subq %r8, %rax
19 .L2:
20 addq %rax, %rcx
21 movl $6, %eax
22 movq %rsi, 168(%rdi)
23 andq $-16, %rcx
24 cmpl $6, %edx
25 movq 8(%rdi), %rsi
26 cmovge %edx, %eax
27 leaq -8(%rcx), %r8
28 leaq __start_context(%rip), %rbx
29 subl $5, %eax
30 testl %edx, %edx
31 movl $24, -72(%rsp)
32 cltq
33 movq %r8, 160(%rdi)
34 leaq (%r8,%rax,8), %rax
35 movq %rax, 128(%rdi)
36 movq %rbx, -8(%rcx)
37 movq %rsi, (%rax)
38 leaq 16(%rsp), %rax
39 movq %rax, -64(%rsp)
40 leaq -48(%rsp), %rax
41 movq %rax, -56(%rsp)
42 jle .L1
43 leal -1(%rdx), %r8d
44 leaq 16(%rsp), %rbx
45 leaq .L6(%rip), %rsi
46 movq %rax, %r11
47 movl $24, %r9d
48 xorl %eax, %eax
49 addq $1, %r8
50 subq $48, %rcx
51 .p2align 4,,10
52 .p2align 3
53 .L27:
54 cmpl $5, %eax
55 ja .L4
56 movl %eax, %edx
57 movslq (%rsi,%rdx,4), %rdx
58 addq %rsi, %rdx
59 cmpl $47, %r9d
60 jmp *%rdx
61 .section .rodata
62 .align 4
63 .align 4
64 .L6:
65 .long .L5-.L6
66 .long .L7-.L6
67 .long .L8-.L6
68 .long .L9-.L6
69 .long .L10-.L6
70 .long .L11-.L6
71 .text
72 .p2align 4,,10
73 .p2align 3
74 .L4:
75 cmpl $47, %r9d
76 leaq (%rcx,%rax,8), %rdx
77 ja .L25
78 movl %r9d, %r10d
79 addl $8, %r9d
80 addq %r11, %r10
81 .L26:
82 movq (%r10), %r10
83 movq %r10, (%rdx)
84 .p2align 4,,10
85 .p2align 3
86 .L14:
87 addq $1, %rax
88 cmpq %rax, %r8
89 jne .L27
90 .L1:
91 popq %rbx
92 ret
93 .L10:
94 ja .L21
95 movl %r9d, %edx
96 addl $8, %r9d
97 addq %r11, %rdx
98 .L22:
99 movq (%rdx), %rdx
100 movq %rdx, 40(%rdi)
101 jmp .L14
102 .L9:
103 ja .L19
104 movl %r9d, %edx
105 addl $8, %r9d
106 addq %r11, %rdx
107 .L20:
108 movq (%rdx), %rdx
109 movq %rdx, 152(%rdi)
110 jmp .L14
111 .L8:
112 ja .L17
113 movl %r9d, %edx
114 addl $8, %r9d
115 addq %r11, %rdx
116 .L18:
117 movq (%rdx), %rdx
118 movq %rdx, 136(%rdi)
119 jmp .L14
120 .L5:
121 ja .L12
122 movl %r9d, %edx
123 addl $8, %r9d
124 addq %r11, %rdx
125 .L13:
126 movq (%rdx), %rdx
127 movq %rdx, 104(%rdi)
128 jmp .L14
129 .L7:
130 ja .L15
131 movl %r9d, %edx
132 addl $8, %r9d
133 addq %r11, %rdx
134 .L16:
135 movq (%rdx), %rdx
136 movq %rdx, 112(%rdi)
137 jmp .L14
138 .L11:
139 ja .L23
140 movl %r9d, %edx
141 addl $8, %r9d
142 addq %r11, %rdx
143 .L24:
144 movq (%rdx), %rdx
145 movq %rdx, 48(%rdi)
146 jmp .L14
147 .L25:
148 movq %rbx, %r10
149 addq $8, %rbx
150 jmp .L26
151 .L21:
152 movq %rbx, %rdx
153 addq $8, %rbx
154 jmp .L22
155 .L23:
156 movq %rbx, %rdx
157 addq $8, %rbx
158 jmp .L24
159 .L19:
160 movq %rbx, %rdx
161 addq $8, %rbx
162 jmp .L20
163 .L12:
164 movq %rbx, %rdx
165 addq $8, %rbx
166 jmp .L13
167 .L17:
168 movq %rbx, %rdx
169 addq $8, %rbx
170 jmp .L18
171 .L15:
172 movq %rbx, %rdx
173 addq $8, %rbx
174 jmp .L16
175 .size __makecontext, .-__makecontext
176 .weak makecontext
177 .set makecontext,__makecontext
178 .hidden __start_context