	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function blkif_free
_blkif_free:                            ## @blkif_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_blkif_io_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irq
	testl	%r14d, %r14d
	jne	LBB0_1
## %bb.2:
	movq	_BLKIF_STATE_DISCONNECTED@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_BLKIF_STATE_SUSPENDED@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	40(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_blk_stop_queue
LBB0_5:
	leaq	32(%rbx), %rdi
	callq	_gnttab_cancel_free_callback
	movq	_blkif_io_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irq
	xorl	%eax, %eax
	callq	_flush_scheduled_work
	movq	(%rbx), %rdi
	movq	_GRANT_INVALID_REF@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rdi
	je	LBB0_7
## %bb.6:
	movq	24(%rbx), %rdx
	xorl	%esi, %esi
	callq	_gnttab_end_foreign_access
	movq	(%r14), %rax
	movq	%rax, (%rbx)
	movq	$0, 24(%rbx)
LBB0_7:
	leaq	8(%rbx), %r14
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rsi
	callq	_unbind_from_irqhandler
LBB0_9:
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_blkif_io_lock,4,2              ## @blkif_io_lock
	.comm	_BLKIF_STATE_SUSPENDED,4,2      ## @BLKIF_STATE_SUSPENDED
	.comm	_BLKIF_STATE_DISCONNECTED,4,2   ## @BLKIF_STATE_DISCONNECTED
	.comm	_GRANT_INVALID_REF,8,3          ## @GRANT_INVALID_REF
	.no_dead_strip	_blkif_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function blkif_free
_blkif_free:                            ; @blkif_free
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, _blkif_io_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _blkif_io_lock@GOTPAGEOFF]
	bl	_spin_lock_irq
Lloh2:
	adrp	x8, _BLKIF_STATE_SUSPENDED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BLKIF_STATE_SUSPENDED@GOTPAGEOFF]
Lloh4:
	adrp	x9, _BLKIF_STATE_DISCONNECTED@GOTPAGE
Lloh5:
	ldr	x9, [x9, _BLKIF_STATE_DISCONNECTED@GOTPAGEOFF]
	cmp	w20, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [x19, #48]
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_blk_stop_queue
LBB0_2:
	add	x0, x19, #32
	bl	_gnttab_cancel_free_callback
Lloh6:
	adrp	x0, _blkif_io_lock@GOTPAGE
Lloh7:
	ldr	x0, [x0, _blkif_io_lock@GOTPAGEOFF]
	bl	_spin_unlock_irq
	bl	_flush_scheduled_work
	ldr	x0, [x19]
Lloh8:
	adrp	x20, _GRANT_INVALID_REF@GOTPAGE
Lloh9:
	ldr	x20, [x20, _GRANT_INVALID_REF@GOTPAGEOFF]
	ldr	x8, [x20]
	cmp	x0, x8
	b.eq	LBB0_4
; %bb.3:
	ldr	x2, [x19, #24]
	mov	w1, #0
	bl	_gnttab_end_foreign_access
	ldr	x8, [x20]
	str	x8, [x19]
	str	xzr, [x19, #24]
LBB0_4:
	mov	x20, x19
	ldr	x0, [x20, #8]!
	cbz	x0, LBB0_6
; %bb.5:
	mov	x1, x19
	bl	_unbind_from_irqhandler
LBB0_6:
	stp	xzr, xzr, [x20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_blkif_io_lock,4,2              ; @blkif_io_lock
	.comm	_BLKIF_STATE_SUSPENDED,4,2      ; @BLKIF_STATE_SUSPENDED
	.comm	_BLKIF_STATE_DISCONNECTED,4,2   ; @BLKIF_STATE_DISCONNECTED
	.comm	_GRANT_INVALID_REF,8,3          ; @GRANT_INVALID_REF
	.no_dead_strip	_blkif_free
.subsections_via_symbols
