clarify the purpose of this project
[nyanglibc.git] / posix / execlp.s
blobcae96338e9eb7564a8801ca9df419e6a7da9df10
1 .text
2 .p2align 4,,15
3 .globl execlp
4 .hidden execlp
5 .type execlp, @function
6 execlp:
7 pushq %rbp
8 movq %rsi, %r10
9 movq %rsp, %rbp
10 pushq %rbx
11 leaq 16(%rbp), %rax
12 leaq 16(%rbp), %rsi
13 subq $88, %rsp
14 movq %rdx, -48(%rbp)
15 movq %r8, -32(%rbp)
16 movq %rax, -80(%rbp)
17 leaq -64(%rbp), %rax
18 movq %rcx, -40(%rbp)
19 movq %r9, -24(%rbp)
20 movl $16, -88(%rbp)
21 movl $16, %edx
22 movq %rax, -72(%rbp)
23 movq %rax, %r8
24 movl $1, %eax
25 .p2align 4,,10
26 .p2align 3
27 .L2:
28 cmpl $47, %edx
29 ja .L5
30 movl %edx, %ecx
31 addl $8, %edx
32 addq %r8, %rcx
33 .L6:
34 cmpq $0, (%rcx)
35 je .L22
36 cmpq $2147483647, %rax
37 je .L23
38 addq $1, %rax
39 jmp .L2
40 .p2align 4,,10
41 .p2align 3
42 .L22:
43 leaq 8(,%rax,8), %rcx
44 movq %rsp, %rbx
45 leaq 16(%rbp), %rdx
46 movl $16, -88(%rbp)
47 movl $16, %r8d
48 xorl %r9d, %r9d
49 leaq 22(%rcx), %rax
50 movq %rdx, -80(%rbp)
51 leaq -64(%rbp), %rdx
52 andq $-16, %rax
53 movq %rdx, -72(%rbp)
54 movq %rdx, %r11
55 subq %rax, %rsp
56 leaq 7(%rsp), %rax
57 shrq $3, %rax
58 leaq 0(,%rax,8), %rsi
59 movq %r10, 0(,%rax,8)
60 leaq 16(%rbp), %r10
61 leaq 8(%rsi), %rax
62 addq %rsi, %rcx
63 .p2align 4,,10
64 .p2align 3
65 .L11:
66 cmpl $47, %r8d
67 ja .L9
68 movl %r8d, %edx
69 movl $1, %r9d
70 addl $8, %r8d
71 addq %r11, %rdx
72 .L10:
73 movq (%rdx), %rdx
74 addq $8, %rax
75 movq %rdx, -8(%rax)
76 cmpq %rcx, %rax
77 jne .L11
78 testb %r9b, %r9b
79 jne .L24
80 .L12:
81 movq __environ(%rip), %rdx
82 call __execvpe
83 movq %rbx, %rsp
84 movq -8(%rbp), %rbx
85 leave
86 ret
87 .L23:
88 movq __libc_errno@gottpoff(%rip), %rax
89 movq -8(%rbp), %rbx
90 movl $7, %fs:(%rax)
91 movl $-1, %eax
92 leave
93 ret
94 .L9:
95 movq %r10, %rdx
96 addq $8, %r10
97 jmp .L10
98 .L5:
99 movq %rsi, %rcx
100 addq $8, %rsi
101 jmp .L6
102 .L24:
103 movl %r8d, -88(%rbp)
104 jmp .L12
105 .size execlp, .-execlp
106 .hidden __execvpe