	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vga_arbiter_del_pci_device
_vga_arbiter_del_pci_device:            ## @vga_arbiter_del_pci_device
	.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
	movq	%rdi, %r14
	movq	_vga_lock@GOTPCREL(%rip), %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	callq	_vgadev_find
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_vga_default@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	callq	_vga_set_default_device
LBB0_4:
	movq	_VGA_RSRC_LEGACY_IO@GOTPCREL(%rip), %rax
	movq	_VGA_RSRC_LEGACY_MEM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_6
## %bb.5:
	movq	_vga_decode_count@GOTPCREL(%rip), %rax
	decl	(%rax)
LBB0_6:
	movq	%rbx, %rdi
	addq	$4, %rdi
	callq	_list_del
	movq	_vga_count@GOTPCREL(%rip), %rax
	decl	(%rax)
	movq	%r14, %rdi
	callq	_vga_arb_device_card_gone
	movq	_vga_wait_queue@GOTPCREL(%rip), %rdi
	callq	_wake_up_all
	movl	$1, %r14d
	jmp	LBB0_7
LBB0_1:
	xorl	%r14d, %r14d
LBB0_7:
	movq	_vga_lock@GOTPCREL(%rip), %rdi
	callq	_spin_unlock_irqrestore
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vga_lock,4,2                   ## @vga_lock
	.comm	_vga_default,8,3                ## @vga_default
	.comm	_VGA_RSRC_LEGACY_IO,4,2         ## @VGA_RSRC_LEGACY_IO
	.comm	_VGA_RSRC_LEGACY_MEM,4,2        ## @VGA_RSRC_LEGACY_MEM
	.comm	_vga_decode_count,4,2           ## @vga_decode_count
	.comm	_vga_count,4,2                  ## @vga_count
	.comm	_vga_wait_queue,4,2             ## @vga_wait_queue
	.no_dead_strip	_vga_arbiter_del_pci_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vga_arbiter_del_pci_device
_vga_arbiter_del_pci_device:            ; @vga_arbiter_del_pci_device
	.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, x0
Lloh0:
	adrp	x0, _vga_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _vga_lock@GOTPAGEOFF]
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_vgadev_find
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.1:
Lloh2:
	adrp	x8, _vga_default@GOTPAGE
Lloh3:
	ldr	x8, [x8, _vga_default@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ne	LBB0_3
; %bb.2:
	mov	x0, #0
	bl	_vga_set_default_device
LBB0_3:
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _VGA_RSRC_LEGACY_IO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VGA_RSRC_LEGACY_IO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _VGA_RSRC_LEGACY_MEM@GOTPAGE
Lloh9:
	ldr	x10, [x10, _VGA_RSRC_LEGACY_MEM@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh11:
	adrp	x8, _vga_decode_count@GOTPAGE
Lloh12:
	ldr	x8, [x8, _vga_decode_count@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
LBB0_5:
	add	x0, x19, #4
	bl	_list_del
Lloh13:
	adrp	x8, _vga_count@GOTPAGE
Lloh14:
	ldr	x8, [x8, _vga_count@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
	mov	x0, x20
	bl	_vga_arb_device_card_gone
Lloh15:
	adrp	x0, _vga_wait_queue@GOTPAGE
Lloh16:
	ldr	x0, [x0, _vga_wait_queue@GOTPAGEOFF]
	bl	_wake_up_all
	mov	w20, #1
	b	LBB0_7
LBB0_6:
	mov	w20, #0
LBB0_7:
Lloh17:
	adrp	x0, _vga_lock@GOTPAGE
Lloh18:
	ldr	x0, [x0, _vga_lock@GOTPAGEOFF]
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_vga_lock,4,2                   ; @vga_lock
	.comm	_vga_default,8,3                ; @vga_default
	.comm	_VGA_RSRC_LEGACY_IO,4,2         ; @VGA_RSRC_LEGACY_IO
	.comm	_VGA_RSRC_LEGACY_MEM,4,2        ; @VGA_RSRC_LEGACY_MEM
	.comm	_vga_decode_count,4,2           ; @vga_decode_count
	.comm	_vga_count,4,2                  ; @vga_count
	.comm	_vga_wait_queue,4,2             ; @vga_wait_queue
	.no_dead_strip	_vga_arbiter_del_pci_device
.subsections_via_symbols
