	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function free_pdev
_free_pdev:                             ## @free_pdev
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %rdi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_dev_dbg
	movq	%rbx, %rdi
	callq	_pcifront_free_roots
	leaq	40(%rbx), %rdi
	callq	_cancel_work_sync
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	js	LBB0_2
## %bb.1:
	movq	%rbx, %rsi
	callq	_unbind_from_irqhandler
LBB0_2:
	movq	8(%rbx), %rsi
	movq	_INVALID_EVTCHN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_4
## %bb.3:
	movq	24(%rbx), %rdi
	callq	_xenbus_free_evtchn
LBB0_4:
	movq	16(%rbx), %rdi
	movq	32(%rbx), %rdx
	movq	_INVALID_GRANT_REF@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jne	LBB0_5
## %bb.6:
	movq	%rdx, %rdi
	callq	_free_page
	jmp	LBB0_7
LBB0_5:
	xorl	%esi, %esi
	callq	_gnttab_end_foreign_access
LBB0_7:
	movq	24(%rbx), %rdi
	xorl	%esi, %esi
	callq	_dev_set_drvdata
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"freeing pdev @ 0x%p\n"

	.comm	_INVALID_EVTCHN,8,3             ## @INVALID_EVTCHN
	.comm	_INVALID_GRANT_REF,8,3          ## @INVALID_GRANT_REF
	.no_dead_strip	_free_pdev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function free_pdev
_free_pdev:                             ; @free_pdev
	.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	x19, x0
	ldr	x0, [x0, #24]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
	mov	x0, x19
	bl	_pcifront_free_roots
	add	x0, x19, #40
	bl	_cancel_work_sync
	ldr	x0, [x19]
	tbnz	x0, #63, LBB0_2
; %bb.1:
	mov	x1, x19
	bl	_unbind_from_irqhandler
LBB0_2:
	ldr	x1, [x19, #8]
Lloh2:
	adrp	x8, _INVALID_EVTCHN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INVALID_EVTCHN@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_4
; %bb.3:
	ldr	x0, [x19, #24]
	bl	_xenbus_free_evtchn
LBB0_4:
	ldr	x0, [x19, #16]
Lloh5:
	adrp	x8, _INVALID_GRANT_REF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INVALID_GRANT_REF@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	x2, [x19, #32]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x2
	bl	_free_page
	b	LBB0_7
LBB0_6:
	mov	w1, #0
	bl	_gnttab_end_foreign_access
LBB0_7:
	ldr	x0, [x19, #24]
	mov	x1, #0
	bl	_dev_set_drvdata
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"freeing pdev @ 0x%p\n"

	.comm	_INVALID_EVTCHN,8,3             ; @INVALID_EVTCHN
	.comm	_INVALID_GRANT_REF,8,3          ; @INVALID_GRANT_REF
	.no_dead_strip	_free_pdev
.subsections_via_symbols
