	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_for_host_signal
_wait_for_host_signal:                  ## @wait_for_host_signal
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	testl	%esi, %esi
	movq	_BIT_WAKE_ON_WRITE@GOTPCREL(%rip), %rax
	cmoveq	_BIT_WAKE_ON_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_PIPE_CMD_WAKE_ON_WRITE@GOTPCREL(%rip), %rbx
	cmoveq	_PIPE_CMD_WAKE_ON_READ@GOTPCREL(%rip), %rbx
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_set_bit
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_goldfish_pipe_cmd
	movq	_BIT_CLOSED_ON_HOST@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	4(%r15), %ebx
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_test_bit
	xorl	%esi, %esi
	testq	%rax, %rax
	sete	%sil
	movl	%ebx, %edi
	callq	_wait_event_interruptible
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r12), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_1
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_4:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BIT_WAKE_ON_WRITE,4,2          ## @BIT_WAKE_ON_WRITE
	.comm	_BIT_WAKE_ON_READ,4,2           ## @BIT_WAKE_ON_READ
	.comm	_PIPE_CMD_WAKE_ON_WRITE,4,2     ## @PIPE_CMD_WAKE_ON_WRITE
	.comm	_PIPE_CMD_WAKE_ON_READ,4,2      ## @PIPE_CMD_WAKE_ON_READ
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_BIT_CLOSED_ON_HOST,4,2         ## @BIT_CLOSED_ON_HOST
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_wait_for_host_signal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_for_host_signal
_wait_for_host_signal:                  ; @wait_for_host_signal
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _BIT_WAKE_ON_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BIT_WAKE_ON_WRITE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _BIT_WAKE_ON_READ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BIT_WAKE_ON_READ@GOTPAGEOFF]
	cmp	w1, #0
	csel	x8, x9, x8, eq
	ldr	w20, [x8]
Lloh4:
	adrp	x8, _PIPE_CMD_WAKE_ON_WRITE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PIPE_CMD_WAKE_ON_WRITE@GOTPAGEOFF]
Lloh6:
	adrp	x9, _PIPE_CMD_WAKE_ON_READ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PIPE_CMD_WAKE_ON_READ@GOTPAGEOFF]
	csel	x21, x9, x8, eq
	mov	x0, x20
	mov	x1, x19
	bl	_set_bit
	ldr	w1, [x21]
	mov	x0, x19
	bl	_goldfish_pipe_cmd
Lloh8:
	adrp	x22, _BIT_CLOSED_ON_HOST@GOTPAGE
Lloh9:
	ldr	x22, [x22, _BIT_CLOSED_ON_HOST@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_test_bit
	cbz	x0, LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w21, [x19, #4]
	mov	x0, x20
	mov	x1, x19
	bl	_test_bit
	cmp	x0, #0
	cset	w1, eq
	mov	x0, x21
	bl	_wait_event_interruptible
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x22]
	mov	x1, x19
	bl	_test_bit
	cbz	x0, LBB0_1
; %bb.4:
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_BIT_WAKE_ON_WRITE,4,2          ; @BIT_WAKE_ON_WRITE
	.comm	_BIT_WAKE_ON_READ,4,2           ; @BIT_WAKE_ON_READ
	.comm	_PIPE_CMD_WAKE_ON_WRITE,4,2     ; @PIPE_CMD_WAKE_ON_WRITE
	.comm	_PIPE_CMD_WAKE_ON_READ,4,2      ; @PIPE_CMD_WAKE_ON_READ
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_BIT_CLOSED_ON_HOST,4,2         ; @BIT_CLOSED_ON_HOST
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_wait_for_host_signal
.subsections_via_symbols
