	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_wait                      ## -- Begin function proc_wait
	.p2align	4, 0x90
_proc_wait:                             ## @proc_wait
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	_errno@GOTPCREL(%rip), %r12
	leaq	-44(%rbp), %r14
	movq	_EINTR@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, (%r12)
	movl	%r13d, %edi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r12), %rax
	cmpq	(%r15), %rax
	je	LBB0_1
## %bb.3:
	movq	_M_SYSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_msgq
	movl	$1, %r15d
	jmp	LBB0_19
LBB0_4:
	movl	-44(%rbp), %edi
	callq	_WIFSIGNALED
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_7
## %bb.6:
	movl	-44(%rbp), %edi
	callq	_WTERMSIG
	movq	_SIGPIPE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
LBB0_11:
	movl	-44(%rbp), %edi
	callq	_WIFEXITED
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_19
## %bb.12:
	movl	-44(%rbp), %edi
	callq	_WEXITSTATUS
	testq	%rax, %rax
	je	LBB0_19
## %bb.13:
	movl	$1, %r15d
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_19
## %bb.14:
	decq	%rbx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movsbl	1(%rbx), %edi
	incq	%rbx
	callq	_cmdskip
	testq	%rax, %rax
	jne	LBB0_15
## %bb.16:
	leaq	-52(%rbp), %rdx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_msg_print
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_strlen
	movq	%rax, %rbx
	movq	_M_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	$20, %esi
	callq	_MIN
	movq	%rax, %r13
	cmpq	$21, %rbx
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.3(%rip), %rbx
	cmovaeq	%rax, %rbx
	movl	-44(%rbp), %edi
	callq	_WEXITSTATUS
	movq	%rax, %r10
	subq	$8, %rsp
	leaq	L_.str.5(%rip), %rdx
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %ecx
	movq	%r14, %r8
	movq	%rbx, %r9
	xorl	%eax, %eax
	pushq	%r10
	callq	_msgq
	addq	$16, %rsp
	cmpl	$0, -52(%rbp)
	je	LBB0_19
## %bb.17:
	movq	%r12, %rdi
	movq	%r14, %rsi
	jmp	LBB0_18
LBB0_7:
	decq	%rbx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movsbl	1(%rbx), %edi
	incq	%rbx
	callq	_cmdskip
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:
	leaq	-52(%rbp), %rdx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_msg_print
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_strlen
	movq	%rax, %rbx
	movq	_M_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	$20, %esi
	callq	_MIN
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpq	$21, %rbx
	leaq	L_.str.2(%rip), %r15
	leaq	L_.str.3(%rip), %rax
	cmovbq	%rax, %r15
	movl	-44(%rbp), %edi
	callq	_WTERMSIG
	movq	%rax, %rdi
	callq	_sigmsg
	movl	%eax, %r14d
	movl	-44(%rbp), %edi
	callq	_WCOREDUMP
	testq	%rax, %rax
	leaq	L_.str.4(%rip), %rbx
	leaq	L_.str.3(%rip), %rax
	cmoveq	%rax, %rbx
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	%r13, %r8
	movq	%r15, %r9
	xorl	%eax, %eax
	pushq	%rbx
	pushq	%r14
	callq	_msgq
	addq	$16, %rsp
	movl	$1, %r15d
	cmpl	$0, -52(%rbp)
	je	LBB0_19
## %bb.10:
	movq	%r12, %rdi
	movq	%r13, %rsi
LBB0_18:
	xorl	%edx, %edx
	callq	_FREE_SPACE
LBB0_19:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_M_SYSERR,4,2                   ## @M_SYSERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waitpid"

	.comm	_SIGPIPE,8,3                    ## @SIGPIPE
	.comm	_M_ERR,4,2                      ## @M_ERR
L_.str.1:                               ## @.str.1
	.asciz	"%.*s%s: received signal: %s%s"

L_.str.2:                               ## @.str.2
	.asciz	" ..."

L_.str.3:                               ## @.str.3
	.space	1

L_.str.4:                               ## @.str.4
	.asciz	"; core dumped"

L_.str.5:                               ## @.str.5
	.asciz	"%.*s%s: exited with status %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_proc_wait                      ; -- Begin function proc_wait
	.p2align	2
_proc_wait:                             ; @proc_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x4
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x24, _errno@GOTPAGE
Lloh1:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
Lloh2:
	adrp	x25, _EINTR@GOTPAGE
Lloh3:
	ldr	x25, [x25, _EINTR@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [x24]
	add	x1, sp, #40
	mov	x0, x23
	mov	w2, #0
	bl	_waitpid
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x24]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_1
; %bb.3:
Lloh4:
	adrp	x8, _M_SYSERR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _M_SYSERR@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_msgq
	b	LBB0_18
LBB0_4:
	ldr	w0, [sp, #40]
	bl	_WIFSIGNALED
	cbz	x0, LBB0_7
; %bb.5:
	cbz	w22, LBB0_13
; %bb.6:
	ldr	w0, [sp, #40]
	bl	_WTERMSIG
Lloh9:
	adrp	x8, _SIGPIPE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SIGPIPE@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
LBB0_7:
	ldr	w0, [sp, #40]
	bl	_WIFEXITED
	cbz	x0, LBB0_19
; %bb.8:
	ldr	w0, [sp, #40]
	bl	_WEXITSTATUS
	cbz	x0, LBB0_19
; %bb.9:
	cbnz	w21, LBB0_18
; %bb.10:
	sub	x20, x20, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldrsb	w0, [x20, #1]!
	bl	_cmdskip
	cbnz	x0, LBB0_11
; %bb.12:
	add	x2, sp, #44
	mov	x0, x19
	mov	x1, x20
	bl	_msg_print
	mov	x20, x0
	bl	_strlen
	mov	x21, x0
Lloh12:
	adrp	x8, _M_ERR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _M_ERR@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	mov	w1, #20
	bl	_MIN
	mov	x23, x0
Lloh15:
	adrp	x8, l_.str.3@PAGE
Lloh16:
	add	x8, x8, l_.str.3@PAGEOFF
Lloh17:
	adrp	x9, l_.str.2@PAGE
Lloh18:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x21, #20
	csel	x21, x9, x8, hi
	ldr	w0, [sp, #40]
	bl	_WEXITSTATUS
	stp	x21, x0, [sp, #16]
	stp	x23, x20, [sp]
Lloh19:
	adrp	x2, l_.str.5@PAGE
Lloh20:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_16
LBB0_13:
	sub	x20, x20, #1
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldrsb	w0, [x20, #1]!
	bl	_cmdskip
	cbnz	x0, LBB0_14
; %bb.15:
	add	x2, sp, #44
	mov	x0, x19
	mov	x1, x20
	bl	_msg_print
	mov	x20, x0
	bl	_strlen
	mov	x21, x0
Lloh21:
	adrp	x8, _M_ERR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _M_ERR@GOTPAGEOFF]
Lloh23:
	ldr	w22, [x8]
	mov	w1, #20
	bl	_MIN
	mov	x23, x0
Lloh24:
	adrp	x24, l_.str.3@PAGE
Lloh25:
	add	x24, x24, l_.str.3@PAGEOFF
Lloh26:
	adrp	x8, l_.str.2@PAGE
Lloh27:
	add	x8, x8, l_.str.2@PAGEOFF
	cmp	x21, #20
	csel	x25, x8, x24, hi
	ldr	w0, [sp, #40]
	bl	_WTERMSIG
	bl	_sigmsg
	mov	x21, x0
	ldr	w0, [sp, #40]
	bl	_WCOREDUMP
Lloh28:
	adrp	x8, l_.str.4@PAGE
Lloh29:
	add	x8, x8, l_.str.4@PAGEOFF
	cmp	x0, #0
	csel	x8, x24, x8, eq
	stp	x21, x8, [sp, #24]
	stp	x20, x25, [sp, #8]
	str	x23, [sp]
Lloh30:
	adrp	x2, l_.str.1@PAGE
Lloh31:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_16:
	mov	x0, x19
	mov	x1, x22
	bl	_msgq
	ldr	w8, [sp, #44]
	cbz	w8, LBB0_18
; %bb.17:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_FREE_SPACE
LBB0_18:
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_M_SYSERR,4,2                   ; @M_SYSERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waitpid"

	.comm	_SIGPIPE,8,3                    ; @SIGPIPE
	.comm	_M_ERR,4,2                      ; @M_ERR
l_.str.1:                               ; @.str.1
	.asciz	"%.*s%s: received signal: %s%s"

l_.str.2:                               ; @.str.2
	.asciz	" ..."

l_.str.3:                               ; @.str.3
	.space	1

l_.str.4:                               ; @.str.4
	.asciz	"; core dumped"

l_.str.5:                               ; @.str.5
	.asciz	"%.*s%s: exited with status %d"

.subsections_via_symbols
