	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function evtchnl_free
_evtchnl_free:                          ## @evtchnl_free
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	(%rsi), %rax
	movq	_EVTCHNL_TYPE_REQ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.12:
	movq	40(%rbx), %r14
	testq	%r14, %r14
	je	LBB0_13
## %bb.4:
	movq	_EVTCHNL_STATE_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	leaq	32(%rbx), %rdi
	movl	%ecx, 36(%rbx)
	callq	_complete_all
	jmp	LBB0_5
LBB0_1:
	movq	_EVTCHNL_TYPE_EVT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.2:
	movq	48(%rbx), %r14
	testq	%r14, %r14
	je	LBB0_13
## %bb.3:
	movq	_EVTCHNL_STATE_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
LBB0_5:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rsi
	callq	_unbind_from_irqhandler
LBB0_7:
	movq	16(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.8:
	movl	(%r15), %edi
	callq	_xenbus_free_evtchn
LBB0_9:
	movq	8(%rbx), %rdi
	movq	_GRANT_INVALID_REF@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_11
## %bb.10:
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_gnttab_end_foreign_access
LBB0_11:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$64, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EVTCHNL_TYPE_REQ,8,3           ## @EVTCHNL_TYPE_REQ
	.comm	_EVTCHNL_TYPE_EVT,8,3           ## @EVTCHNL_TYPE_EVT
	.comm	_EVTCHNL_STATE_DISCONNECTED,4,2 ## @EVTCHNL_STATE_DISCONNECTED
	.comm	_EIO,4,2                        ## @EIO
	.comm	_GRANT_INVALID_REF,8,3          ## @GRANT_INVALID_REF
	.no_dead_strip	_evtchnl_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function evtchnl_free
_evtchnl_free:                          ; @evtchnl_free
	.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, x1
	mov	x21, x0
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _EVTCHNL_TYPE_REQ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EVTCHNL_TYPE_REQ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	ldr	x20, [x19, #40]
	cbz	x20, LBB0_12
; %bb.2:
Lloh3:
	adrp	x8, _EVTCHNL_STATE_DISCONNECTED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EVTCHNL_STATE_DISCONNECTED@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #56]
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w8, w8
	add	x0, x19, #32
	str	w8, [x19, #36]
	bl	_complete_all
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_4
LBB0_3:
	mov	x1, x19
	bl	_unbind_from_irqhandler
LBB0_4:
	ldr	x1, [x19, #16]
	cbz	x1, LBB0_6
; %bb.5:
	ldr	w0, [x21]
	bl	_xenbus_free_evtchn
LBB0_6:
	ldr	x0, [x19, #8]
Lloh9:
	adrp	x8, _GRANT_INVALID_REF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GRANT_INVALID_REF@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_8
; %bb.7:
	mov	w1, #0
	mov	x2, x20
	bl	_gnttab_end_foreign_access
LBB0_8:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #64
	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
	b	_memset
LBB0_9:
Lloh12:
	adrp	x9, _EVTCHNL_TYPE_EVT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EVTCHNL_TYPE_EVT@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.10:
	ldr	x20, [x19, #48]
	cbz	x20, LBB0_12
; %bb.11:
Lloh15:
	adrp	x8, _EVTCHNL_STATE_DISCONNECTED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EVTCHNL_STATE_DISCONNECTED@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x19, #56]
	ldr	x0, [x19, #24]
	cbnz	x0, LBB0_3
	b	LBB0_4
LBB0_12:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EVTCHNL_TYPE_REQ,8,3           ; @EVTCHNL_TYPE_REQ
	.comm	_EVTCHNL_TYPE_EVT,8,3           ; @EVTCHNL_TYPE_EVT
	.comm	_EVTCHNL_STATE_DISCONNECTED,4,2 ; @EVTCHNL_STATE_DISCONNECTED
	.comm	_EIO,4,2                        ; @EIO
	.comm	_GRANT_INVALID_REF,8,3          ; @GRANT_INVALID_REF
	.no_dead_strip	_evtchnl_free
.subsections_via_symbols
