	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function waitcmdloop
_waitcmdloop:                           ## @waitcmdloop
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_njobs@GOTPCREL(%rip), %r15
	movq	_JOBDONE@GOTPCREL(%rip), %r13
	movq	_iflag@GOTPCREL(%rip), %r12
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
                                        ##     Child Loop BB0_20 Depth 2
	testq	%r14, %r14
	je	LBB0_11
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r14), %rax
	cmpq	(%r13), %rax
	je	LBB0_3
LBB0_27:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_DOWAIT_SIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DOWAIT_BLOCK@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	xorl	%esi, %esi
	callq	_dowait
	cmpl	$-1, %eax
	jne	LBB0_1
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_jobtab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%r15), %rcx
	testq	%rcx, %rcx
	jle	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %rbx
	jmp	LBB0_13
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=2
	movq	%rbx, %rdi
	callq	_freejob
	movq	_jobtab@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%r15), %ecx
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_13 Depth=2
	addq	$32, %rbx
	movslq	%ecx, %rdx
	shlq	$5, %rdx
	addq	%rax, %rdx
	cmpq	%rdx, %rbx
	jae	LBB0_19
LBB0_13:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	$0, 8(%rbx)
	je	LBB0_26
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	(%rbx), %rdx
	cmpq	(%r13), %rdx
	jne	LBB0_26
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=2
	cmpl	$0, (%r12)
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=2
	cmpl	$0, 24(%rbx)
	je	LBB0_17
## %bb.24:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	$0, 16(%rbx)
	movq	_bgjob@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rbx
	jne	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_13 Depth=2
	movq	$0, (%rdx)
	jmp	LBB0_26
LBB0_18:                                ##   in Loop: Header=BB0_1 Depth=1
	shlq	$5, %rcx
	addq	%rax, %rcx
	movq	%rcx, %rdx
LBB0_19:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_20 Depth=2
	addq	$32, %rax
LBB0_20:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rdx, %rax
	jae	LBB0_29
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=2
	cmpq	$0, 8(%rax)
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=2
	cmpq	$0, (%rax)
	jne	LBB0_23
	jmp	LBB0_27
LBB0_28:
	movq	_pendingsig_waitcmd@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	$0, (%rax)
	subl	$-128, %ebx
	jmp	LBB0_29
LBB0_3:
	movq	%r14, %rdi
	callq	_getjobstatus
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_WIFEXITED
	movl	%ebx, %edi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	callq	_WEXITSTATUS
	movl	%eax, %ebx
	cmpl	$0, (%r12)
	jne	LBB0_7
	jmp	LBB0_8
LBB0_5:
	callq	_WTERMSIG
	movl	%eax, %ebx
	subl	$-128, %ebx
	cmpl	$0, (%r12)
	je	LBB0_8
LBB0_7:
	cmpl	$0, 24(%r14)
	je	LBB0_8
## %bb.9:
	movq	$0, 16(%r14)
	movq	_bgjob@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_29
## %bb.10:
	movq	$0, (%rax)
	jmp	LBB0_29
LBB0_8:
	movq	%r14, %rdi
	callq	_freejob
LBB0_29:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JOBDONE,8,3                    ## @JOBDONE
	.comm	_iflag,4,2                      ## @iflag
	.comm	_bgjob,8,3                      ## @bgjob
	.comm	_jobtab,8,3                     ## @jobtab
	.comm	_njobs,4,2                      ## @njobs
	.comm	_DOWAIT_BLOCK,4,2               ## @DOWAIT_BLOCK
	.comm	_DOWAIT_SIG,4,2                 ## @DOWAIT_SIG
	.comm	_pendingsig_waitcmd,4,2         ## @pendingsig_waitcmd
	.no_dead_strip	_waitcmdloop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function waitcmdloop
_waitcmdloop:                           ; @waitcmdloop
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x23, _jobtab@GOTPAGE
Lloh1:
	ldr	x23, [x23, _jobtab@GOTPAGEOFF]
Lloh2:
	adrp	x24, _njobs@GOTPAGE
Lloh3:
	ldr	x24, [x24, _njobs@GOTPAGEOFF]
Lloh4:
	adrp	x25, _JOBDONE@GOTPAGE
Lloh5:
	ldr	x25, [x25, _JOBDONE@GOTPAGEOFF]
Lloh6:
	adrp	x22, _iflag@GOTPAGE
Lloh7:
	ldr	x22, [x22, _iflag@GOTPAGEOFF]
Lloh8:
	adrp	x21, _bgjob@GOTPAGE
Lloh9:
	ldr	x21, [x21, _bgjob@GOTPAGEOFF]
Lloh10:
	adrp	x26, _DOWAIT_BLOCK@GOTPAGE
Lloh11:
	ldr	x26, [x26, _DOWAIT_BLOCK@GOTPAGEOFF]
Lloh12:
	adrp	x27, _DOWAIT_SIG@GOTPAGE
Lloh13:
	ldr	x27, [x27, _DOWAIT_SIG@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_17 Depth 2
	cbz	x19, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	b.eq	LBB0_22
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w0, w9, w8
	mov	x1, #0
	bl	_dowait
	cmn	w0, #1
	b.ne	LBB0_1
	b	LBB0_21
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x23]
	ldrsw	x9, [x24]
	cmp	w9, #1
	b.lt	LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	mov	x20, x8
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=2
	mov	x0, x20
	bl	_freejob
	ldr	x8, [x23]
	ldr	w9, [x24]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x20, x20, #32
	sxtw	x10, w9
	add	x10, x8, x10, lsl #5
	cmp	x20, x10
	b.hs	LBB0_15
LBB0_8:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x10, [x20, #8]
	cbz	x10, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x10, [x20]
	ldr	x11, [x25]
	cmp	x10, x11
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	w10, [x22]
	cbz	w10, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=2
	ldr	w10, [x20, #24]
	cbz	w10, LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=2
	str	xzr, [x20, #16]
	ldr	x10, [x21]
	cmp	x20, x10
	b.ne	LBB0_7
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=2
	str	xzr, [x21]
	b	LBB0_7
LBB0_14:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x10, x8, x9, lsl #5
LBB0_15:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	x8, x10
	b.lo	LBB0_17
	b	LBB0_19
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=2
	add	x8, x8, #32
	cmp	x8, x10
	b.hs	LBB0_19
LBB0_17:                                ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=2
	ldr	x9, [x8]
	cbnz	x9, LBB0_16
	b	LBB0_3
LBB0_19:
	mov	w20, #0
LBB0_20:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_21:
Lloh14:
	adrp	x8, _pendingsig_waitcmd@GOTPAGE
Lloh15:
	ldr	x8, [x8, _pendingsig_waitcmd@GOTPAGEOFF]
	ldr	w9, [x8]
	str	wzr, [x8]
	add	w20, w9, #128
	b	LBB0_20
LBB0_22:
	mov	x0, x19
	bl	_getjobstatus
	mov	x20, x0
	bl	_WIFEXITED
	cbz	x0, LBB0_24
; %bb.23:
	mov	x0, x20
	bl	_WEXITSTATUS
	mov	x20, x0
	ldr	w8, [x22]
	cbnz	w8, LBB0_25
	b	LBB0_28
LBB0_24:
	mov	x0, x20
	bl	_WTERMSIG
	add	w20, w0, #128
	ldr	w8, [x22]
	cbz	w8, LBB0_28
LBB0_25:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_28
; %bb.26:
	str	xzr, [x19, #16]
	ldr	x8, [x21]
	cmp	x8, x19
	b.ne	LBB0_20
; %bb.27:
	str	xzr, [x21]
	b	LBB0_20
LBB0_28:
	mov	x0, x19
	bl	_freejob
	b	LBB0_20
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_JOBDONE,8,3                    ; @JOBDONE
	.comm	_iflag,4,2                      ; @iflag
	.comm	_bgjob,8,3                      ; @bgjob
	.comm	_jobtab,8,3                     ; @jobtab
	.comm	_njobs,4,2                      ; @njobs
	.comm	_DOWAIT_BLOCK,4,2               ; @DOWAIT_BLOCK
	.comm	_DOWAIT_SIG,4,2                 ; @DOWAIT_SIG
	.comm	_pendingsig_waitcmd,4,2         ; @pendingsig_waitcmd
	.no_dead_strip	_waitcmdloop
.subsections_via_symbols
