	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vga_switcheroo_unregister_client ## -- Begin function vga_switcheroo_unregister_client
	.p2align	4, 0x90
_vga_switcheroo_unregister_client:      ## @vga_switcheroo_unregister_client
	.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, %rbx
	movq	_vgasr_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_vgasr_priv@GOTPCREL(%rip), %r14
	leaq	8(%r14), %rdi
	movq	%rbx, %rsi
	callq	_find_client_from_pci
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_client_is_vga
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	decl	(%r14)
LBB0_3:
	movq	%rbx, %rdi
	callq	_list_del
	movq	%rbx, %rdi
	callq	_kfree
LBB0_4:
	cmpl	$0, 4(%r14)
	je	LBB0_7
## %bb.5:
	cmpl	$1, (%r14)
	jg	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	movq	%r14, %rdi
	callq	_vga_switcheroo_debugfs_fini
	movl	$0, 4(%r14)
LBB0_7:
	movq	_vgasr_mutex@GOTPCREL(%rip), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_vgasr_mutex,4,2                ## @vgasr_mutex
	.comm	_vgasr_priv,12,2                ## @vgasr_priv
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"disabled\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vga_switcheroo_unregister_client ; -- Begin function vga_switcheroo_unregister_client
	.p2align	2
_vga_switcheroo_unregister_client:      ; @vga_switcheroo_unregister_client
	.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, _vgasr_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _vgasr_mutex@GOTPAGEOFF]
	bl	_mutex_lock
Lloh2:
	adrp	x19, _vgasr_priv@GOTPAGE
Lloh3:
	ldr	x19, [x19, _vgasr_priv@GOTPAGEOFF]
	add	x0, x19, #8
	mov	x1, x20
	bl	_find_client_from_pci
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	bl	_client_is_vga
	cbz	x0, LBB0_3
; %bb.2:
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
LBB0_3:
	mov	x0, x20
	bl	_list_del
	mov	x0, x20
	bl	_kfree
LBB0_4:
	ldp	w9, w8, [x19]
	cmp	w8, #0
	ccmp	w9, #1, #0, ne
	b.gt	LBB0_6
; %bb.5:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	mov	x0, x19
	bl	_vga_switcheroo_debugfs_fini
	str	wzr, [x19, #4]
LBB0_6:
Lloh6:
	adrp	x0, _vgasr_mutex@GOTPAGE
Lloh7:
	ldr	x0, [x0, _vgasr_mutex@GOTPAGEOFF]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_vgasr_mutex,4,2                ; @vgasr_mutex
	.comm	_vgasr_priv,12,2                ; @vgasr_priv
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"disabled\n"

.subsections_via_symbols
