	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_til_done
_wait_til_done:                         ## @wait_til_done
	.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
	movl	%esi, %ebx
	callq	_schedule_bh
	movq	_command_status@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jg	LBB0_13
## %bb.1:
	movq	_NO_SIGNAL@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_13
## %bb.2:
	movq	_wait@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DECLARE_WAITQUEUE
	movq	_command_done@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	callq	_add_wait_queue
	testl	%ebx, %ebx
	jne	LBB0_3
## %bb.4:
	movq	_TASK_UNINTERRUPTIBLE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %edi
	callq	_set_current_state
	movq	_command_status@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jg	LBB0_12
## %bb.6:
	cmpq	$0, (%r12)
	je	LBB0_12
## %bb.7:
	leaq	L_.str(%rip), %r14
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %r13
	movq	_TASK_UNINTERRUPTIBLE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_is_alive
	xorl	%eax, %eax
	callq	_schedule
	movq	%r13, %rax
	testl	%ebx, %ebx
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rax
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	(%rax), %edi
	callq	_set_current_state
	movq	_command_status@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jg	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpq	$0, (%r12)
	jne	LBB0_8
LBB0_12:
	movq	_TASK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movq	_command_done@GOTPCREL(%rip), %rdi
	movq	_wait@GOTPCREL(%rip), %rsi
	callq	_remove_wait_queue
	movq	_command_status@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_13:
	cmpl	$1, %eax
	jg	LBB0_15
## %bb.14:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_cancel_activity
	movq	_intr_cont@GOTPCREL(%rip), %rax
	movq	_cont@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	xorl	%eax, %eax
	callq	_reset_fdc
	movq	_EINTR@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_15:
	movq	_FDCS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_17
## %bb.16:
	movq	_FD_COMMAND_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_17:
	movq	_FD_COMMAND_OKAY@GOTPCREL(%rip), %rcx
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	xorl	%ebx, %ebx
	subl	(%rdx), %ebx
	cmpl	(%rcx), %eax
	cmovel	%esi, %ebx
	movq	_FD_COMMAND_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_command_status@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_command_status,4,2             ## @command_status
	.comm	_NO_SIGNAL,8,3                  ## @NO_SIGNAL
	.comm	_wait,4,2                       ## @wait
	.comm	_current,4,2                    ## @current
	.comm	_command_done,4,2               ## @command_done
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ## @TASK_UNINTERRUPTIBLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait_til_done"

	.comm	_TASK_RUNNING,4,2               ## @TASK_RUNNING
	.comm	_intr_cont,4,2                  ## @intr_cont
	.comm	_cont,8,3                       ## @cont
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_FDCS,8,3                       ## @FDCS
	.comm	_FD_COMMAND_ERROR,4,2           ## @FD_COMMAND_ERROR
	.comm	_FD_COMMAND_OKAY,4,2            ## @FD_COMMAND_OKAY
	.comm	_EIO,4,2                        ## @EIO
	.comm	_FD_COMMAND_NONE,4,2            ## @FD_COMMAND_NONE
	.no_dead_strip	_wait_til_done
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_til_done
_wait_til_done:                         ; @wait_til_done
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	bl	_schedule_bh
Lloh0:
	adrp	x21, _command_status@GOTPAGE
Lloh1:
	ldr	x21, [x21, _command_status@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh2:
	adrp	x22, _NO_SIGNAL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _NO_SIGNAL@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	w8, #1
	ccmp	x9, #0, #4, le
	b.eq	LBB0_5
; %bb.1:
Lloh4:
	adrp	x20, _wait@GOTPAGE
Lloh5:
	ldr	x20, [x20, _wait@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh6:
	adrp	x8, _current@GOTPAGE
Lloh7:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_DECLARE_WAITQUEUE
Lloh9:
	adrp	x0, _command_done@GOTPAGE
Lloh10:
	ldr	x0, [x0, _command_done@GOTPAGEOFF]
	mov	x1, x20
	bl	_add_wait_queue
Lloh11:
	adrp	x23, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh12:
	ldr	x23, [x23, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh13:
	adrp	x24, _TASK_UNINTERRUPTIBLE@GOTPAGE
Lloh14:
	ldr	x24, [x24, _TASK_UNINTERRUPTIBLE@GOTPAGEOFF]
	cmp	w19, #0
	csel	x8, x24, x23, eq
	ldr	w0, [x8]
	bl	_set_current_state
	ldr	w8, [x21]
	ldr	x9, [x22]
	cmp	w8, #1
	ccmp	x9, #0, #4, le
	b.eq	LBB0_4
; %bb.2:
Lloh15:
	adrp	x20, l_.str@PAGE
Lloh16:
	add	x20, x20, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_is_alive
	bl	_schedule
	cmp	w19, #0
	csel	x8, x24, x23, eq
	ldr	w0, [x8]
	bl	_set_current_state
	ldr	w8, [x21]
	ldr	x9, [x22]
	cmp	w8, #1
	ccmp	x9, #0, #4, le
	b.ne	LBB0_3
LBB0_4:
Lloh17:
	adrp	x8, _TASK_RUNNING@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TASK_RUNNING@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_set_current_state
Lloh20:
	adrp	x0, _command_done@GOTPAGE
Lloh21:
	ldr	x0, [x0, _command_done@GOTPAGEOFF]
Lloh22:
	adrp	x1, _wait@GOTPAGE
Lloh23:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	bl	_remove_wait_queue
	ldr	w8, [x21]
LBB0_5:
	cmp	w8, #1
	b.gt	LBB0_7
; %bb.6:
	bl	_cancel_activity
Lloh24:
	adrp	x8, _cont@GOTPAGE
Lloh25:
	ldr	x8, [x8, _cont@GOTPAGEOFF]
Lloh26:
	adrp	x9, _intr_cont@GOTPAGE
Lloh27:
	ldr	x9, [x9, _intr_cont@GOTPAGEOFF]
Lloh28:
	str	x9, [x8]
	bl	_reset_fdc
Lloh29:
	adrp	x8, _EINTR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
Lloh32:
	adrp	x9, _FDCS@GOTPAGE
Lloh33:
	ldr	x9, [x9, _FDCS@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	ldr	x9, [x9]
Lloh35:
	adrp	x10, _FD_COMMAND_ERROR@GOTPAGE
Lloh36:
	ldr	x10, [x10, _FD_COMMAND_ERROR@GOTPAGEOFF]
Lloh37:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w8, w8, w10, eq
Lloh38:
	adrp	x9, _FD_COMMAND_OKAY@GOTPAGE
Lloh39:
	ldr	x9, [x9, _FD_COMMAND_OKAY@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
Lloh41:
	adrp	x10, _EIO@GOTPAGE
Lloh42:
	ldr	x10, [x10, _EIO@GOTPAGEOFF]
Lloh43:
	ldr	w10, [x10]
	cmp	w8, w9
	csneg	w0, wzr, w10, eq
Lloh44:
	adrp	x8, _FD_COMMAND_NONE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _FD_COMMAND_NONE@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	str	w8, [x21]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh28
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_command_status,4,2             ; @command_status
	.comm	_NO_SIGNAL,8,3                  ; @NO_SIGNAL
	.comm	_wait,4,2                       ; @wait
	.comm	_current,4,2                    ; @current
	.comm	_command_done,4,2               ; @command_done
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_TASK_UNINTERRUPTIBLE,4,2       ; @TASK_UNINTERRUPTIBLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait_til_done"

	.comm	_TASK_RUNNING,4,2               ; @TASK_RUNNING
	.comm	_intr_cont,4,2                  ; @intr_cont
	.comm	_cont,8,3                       ; @cont
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_FDCS,8,3                       ; @FDCS
	.comm	_FD_COMMAND_ERROR,4,2           ; @FD_COMMAND_ERROR
	.comm	_FD_COMMAND_OKAY,4,2            ; @FD_COMMAND_OKAY
	.comm	_EIO,4,2                        ; @EIO
	.comm	_FD_COMMAND_NONE,4,2            ; @FD_COMMAND_NONE
	.no_dead_strip	_wait_til_done
.subsections_via_symbols
