clarify the purpose of this project
[nyanglibc.git] / debug / wcsncat_chk.shared.s
blobfb2acbb86893614f298801fe63ebf21ea4ae3bce
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __wcsncat_chk
9 .type __wcsncat_chk, @function
10 __wcsncat_chk:
11 movq %rdi, %r10
12 jmp .L3
13 .p2align 4,,10
14 .p2align 3
15 .L2:
16 leaq 4(%r10), %r9
17 movl -4(%r9), %eax
18 testl %eax, %eax
19 je .L71
20 movq %r8, %rcx
21 movq %r9, %r10
22 .L3:
23 testq %rcx, %rcx
24 leaq -1(%rcx), %r8
25 jne .L2
26 .L8:
27 subq $8, %rsp
28 call __GI___chk_fail
29 .p2align 4,,10
30 .p2align 3
31 .L71:
32 cmpq $3, %rdx
33 leaq -4(%r10), %r11
34 jbe .L4
35 movl (%rsi), %eax
36 testl %eax, %eax
37 movl %eax, (%r10)
38 je .L35
39 cmpq $1, %rcx
40 je .L8
41 movl 4(%rsi), %eax
42 testl %eax, %eax
43 movl %eax, 4(%r10)
44 je .L35
45 cmpq $2, %rcx
46 je .L8
47 movl 8(%rsi), %eax
48 testl %eax, %eax
49 movl %eax, 8(%r10)
50 je .L35
51 movq %rdx, %rax
52 movq %rcx, %r9
53 andq $-4, %rax
54 subq %rax, %r9
55 .L11:
56 cmpq $3, %rcx
57 leaq -4(%rcx), %r8
58 je .L8
59 addq $16, %rsi
60 movl -4(%rsi), %eax
61 addq $16, %r11
62 testl %eax, %eax
63 movl %eax, (%r11)
64 je .L35
65 cmpq %r8, %r9
66 je .L72
67 testq %r8, %r8
68 je .L8
69 movl (%rsi), %eax
70 testl %eax, %eax
71 movl %eax, 4(%r11)
72 je .L35
73 cmpq $1, %r8
74 je .L8
75 movl 4(%rsi), %eax
76 testl %eax, %eax
77 movl %eax, 8(%r11)
78 je .L35
79 cmpq $2, %r8
80 je .L8
81 movl 8(%rsi), %eax
82 movq %r8, %rcx
83 testl %eax, %eax
84 movl %eax, 12(%r11)
85 jne .L11
86 .L35:
87 movq %rdi, %rax
88 ret
89 .p2align 4,,10
90 .p2align 3
91 .L4:
92 testq %rdx, %rdx
93 je .L35
94 .L16:
95 movl (%rsi), %eax
96 leaq 4(%rsi), %r9
97 leaq 4(%r11), %rcx
98 testl %eax, %eax
99 movl %eax, 4(%r11)
100 je .L35
101 leaq 1(%r8), %rax
102 subq %rdx, %rax
103 jmp .L14
104 .p2align 4,,10
105 .p2align 3
106 .L73:
107 addq $4, %r9
108 movl -4(%r9), %edx
109 addq $4, %rcx
110 subq $1, %r8
111 testl %edx, %edx
112 movl %edx, (%rcx)
113 je .L35
114 .L14:
115 cmpq %r8, %rax
116 je .L13
117 testq %r8, %r8
118 jne .L73
119 jmp .L8
120 .L18:
121 movq %r11, %rcx
122 .L13:
123 testq %r8, %r8
124 je .L8
125 movl $0, 4(%rcx)
126 jmp .L35
127 .L72:
128 andl $3, %edx
129 je .L18
130 testq %r8, %r8
131 je .L8
132 leaq -5(%rcx), %r8
133 jmp .L16
134 .size __wcsncat_chk, .-__wcsncat_chk