clarify the purpose of this project
[nyanglibc.git] / rt / shm_unlink.s
blob2fc9efccf296261ad082cadd7a39e9438f641b01
1 .text
2 .p2align 4,,15
3 .globl shm_unlink
4 .type shm_unlink, @function
5 shm_unlink:
6 pushq %rbp
7 movq %rsp, %rbp
8 pushq %r14
9 pushq %r13
10 pushq %r12
11 pushq %rbx
12 movq %rdi, %rbx
13 leaq -40(%rbp), %rdi
14 subq $16, %rsp
15 call __shm_directory@PLT
16 testq %rax, %rax
17 je .L2
18 cmpb $47, (%rbx)
19 movq %rax, %r14
20 jne .L4
21 .p2align 4,,10
22 .p2align 3
23 .L3:
24 addq $1, %rbx
25 cmpb $47, (%rbx)
26 je .L3
27 .L4:
28 movq %rbx, %rdi
29 call strlen@PLT
30 leaq 1(%rax), %r12
31 cmpq $1, %r12
32 je .L6
33 cmpq $254, %r12
34 ja .L6
35 movl $47, %esi
36 movq %rbx, %rdi
37 call strchr@PLT
38 testq %rax, %rax
39 jne .L6
40 movq -40(%rbp), %rdx
41 movq %r14, %rsi
42 leaq 30(%rdx,%r12), %rax
43 andq $-16, %rax
44 subq %rax, %rsp
45 leaq 15(%rsp), %r13
46 andq $-16, %r13
47 movq %r13, %rdi
48 call __mempcpy@PLT
49 movq %r12, %rdx
50 movq %rbx, %rsi
51 movq %rax, %rdi
52 call memcpy@PLT
53 movq %r13, %rdi
54 call unlink@PLT
55 testl %eax, %eax
56 js .L12
57 .L1:
58 leaq -32(%rbp), %rsp
59 popq %rbx
60 popq %r12
61 popq %r13
62 popq %r14
63 popq %rbp
64 ret
65 .p2align 4,,10
66 .p2align 3
67 .L12:
68 movq errno@gottpoff(%rip), %rdx
69 cmpl $1, %fs:(%rdx)
70 jne .L1
71 movl $13, %fs:(%rdx)
72 leaq -32(%rbp), %rsp
73 popq %rbx
74 popq %r12
75 popq %r13
76 popq %r14
77 popq %rbp
78 ret
79 .p2align 4,,10
80 .p2align 3
81 .L2:
82 movq errno@gottpoff(%rip), %rax
83 movl $38, %fs:(%rax)
84 leaq -32(%rbp), %rsp
85 movl $-1, %eax
86 popq %rbx
87 popq %r12
88 popq %r13
89 popq %r14
90 popq %rbp
91 ret
92 .p2align 4,,10
93 .p2align 3
94 .L6:
95 movq errno@gottpoff(%rip), %rax
96 movl $2, %fs:(%rax)
97 movl $-1, %eax
98 jmp .L1
99 .size shm_unlink, .-shm_unlink