clarify the purpose of this project
[nyanglibc.git] / string / strsep.s
blob0dc493c50a4bf87c76891878e6613d61ff499f32
1 .text
2 .p2align 4,,15
3 .globl __strsep
4 .hidden __strsep
5 .type __strsep, @function
6 __strsep:
7 pushq %rbp
8 pushq %rbx
9 subq $8, %rsp
10 movq (%rdi), %rbx
11 testq %rbx, %rbx
12 je .L1
13 movq %rdi, %rbp
14 movq %rbx, %rdi
15 call strcspn
16 addq %rbx, %rax
17 cmpb $0, (%rax)
18 jne .L9
19 movq $0, 0(%rbp)
20 .L1:
21 addq $8, %rsp
22 movq %rbx, %rax
23 popq %rbx
24 popq %rbp
25 ret
26 .p2align 4,,10
27 .p2align 3
28 .L9:
29 movb $0, (%rax)
30 addq $1, %rax
31 movq %rax, 0(%rbp)
32 addq $8, %rsp
33 movq %rbx, %rax
34 popq %rbx
35 popq %rbp
36 ret
37 .size __strsep, .-__strsep
38 .globl __strsep_g
39 .hidden __strsep_g
40 .set __strsep_g,__strsep
41 .weak strsep
42 .set strsep,__strsep
43 .hidden strcspn