	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function agp_release
_agp_release:                           ## @agp_release
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rsi), %rbx
	movq	_agp_fe@GOTPCREL(%rip), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_DBG
	movq	_AGP_FF_IS_CONTROLLER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%rbx), %r15
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movl	(%rbx), %edi
	callq	_agp_find_controller_by_pid
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%rax, %r13
	cmpq	8(%r12), %rax
	jne	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_agp_controller_release_current
LBB0_4:
	movq	%r13, %rdi
	callq	_agp_remove_controller
LBB0_5:
	movq	_AGP_FF_IS_CLIENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	(%rbx), %edi
	callq	_agp_remove_client
LBB0_7:
	movq	%rbx, %rdi
	callq	_agp_remove_file_private
	movq	%rbx, %rdi
	callq	_kfree
	movq	$0, (%r14)
	movq	_agp_fe@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_agp_fe,16,3                    ## @agp_fe
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"priv=%p"

	.comm	_AGP_FF_IS_CONTROLLER,4,2       ## @AGP_FF_IS_CONTROLLER
	.comm	_AGP_FF_IS_CLIENT,4,2           ## @AGP_FF_IS_CLIENT
	.no_dead_strip	_agp_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function agp_release
_agp_release:                           ; @agp_release
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	ldr	x20, [x1]
Lloh0:
	adrp	x22, _agp_fe@GOTPAGE
Lloh1:
	ldr	x22, [x22, _agp_fe@GOTPAGEOFF]
	mov	x0, x22
	bl	_mutex_lock
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_DBG
Lloh4:
	adrp	x8, _AGP_FF_IS_CONTROLLER@GOTPAGE
Lloh5:
	ldr	x8, [x8, _AGP_FF_IS_CONTROLLER@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	add	x21, x20, #4
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w0, [x20]
	bl	_agp_find_controller_by_pid
	cbz	x0, LBB0_5
; %bb.2:
	mov	x23, x0
	ldr	x8, [x22, #8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
	mov	x0, x23
	mov	x1, x20
	bl	_agp_controller_release_current
LBB0_4:
	mov	x0, x23
	bl	_agp_remove_controller
LBB0_5:
Lloh7:
	adrp	x8, _AGP_FF_IS_CLIENT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AGP_FF_IS_CLIENT@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w0, [x20]
	bl	_agp_remove_client
LBB0_7:
	mov	x0, x20
	bl	_agp_remove_file_private
	mov	x0, x20
	bl	_kfree
	str	xzr, [x19]
Lloh10:
	adrp	x0, _agp_fe@GOTPAGE
Lloh11:
	ldr	x0, [x0, _agp_fe@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_agp_fe,16,3                    ; @agp_fe
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"priv=%p"

	.comm	_AGP_FF_IS_CONTROLLER,4,2       ; @AGP_FF_IS_CONTROLLER
	.comm	_AGP_FF_IS_CLIENT,4,2           ; @AGP_FF_IS_CLIENT
	.no_dead_strip	_agp_release
.subsections_via_symbols
