	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function agp_open
_agp_open:                              ## @agp_open
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_iminor
	movl	%eax, %r15d
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_lock_kernel
	movq	_agp_fe@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_AGPGART_MINOR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_8
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rax, %rbx
	movq	_AGP_FF_ALLOW_CLIENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	_current@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_CAP_SYS_RAWIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_AGP_FF_ALLOW_CONTROLLER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
LBB0_4:
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_agp_find_client_by_pid
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_AGP_FF_IS_CLIENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	_AGP_FF_IS_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
LBB0_6:
	movq	%rbx, (%r14)
	movq	%rbx, %rdi
	callq	_agp_insert_file_private
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_DBG
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_8:
	negl	%ebx
LBB0_9:
	movq	_agp_fe@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	callq	_unlock_kernel
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_agp_fe,4,2                     ## @agp_fe
	.comm	_AGPGART_MINOR,4,2              ## @AGPGART_MINOR
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_AGP_FF_ALLOW_CLIENT,4,2        ## @AGP_FF_ALLOW_CLIENT
	.comm	_current,8,3                    ## @current
	.comm	_CAP_SYS_RAWIO,4,2              ## @CAP_SYS_RAWIO
	.comm	_AGP_FF_ALLOW_CONTROLLER,4,2    ## @AGP_FF_ALLOW_CONTROLLER
	.comm	_AGP_FF_IS_CLIENT,4,2           ## @AGP_FF_IS_CLIENT
	.comm	_AGP_FF_IS_VALID,4,2            ## @AGP_FF_IS_VALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"private=%p, client=%p"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_agp_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function agp_open
_agp_open:                              ; @agp_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	bl	_iminor
	mov	x20, x0
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_lock_kernel
Lloh3:
	adrp	x0, _agp_fe@GOTPAGE
Lloh4:
	ldr	x0, [x0, _agp_fe@GOTPAGEOFF]
	bl	_mutex_lock
Lloh5:
	adrp	x8, _AGPGART_MINOR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AGPGART_MINOR@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_8
; %bb.1:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x20, x0
Lloh11:
	adrp	x8, _AGP_FF_ALLOW_CLIENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AGP_FF_ALLOW_CLIENT@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
Lloh14:
	adrp	x21, _current@GOTPAGE
Lloh15:
	ldr	x21, [x21, _current@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w8, [x8]
	str	w8, [x20, #4]
Lloh16:
	adrp	x8, _CAP_SYS_RAWIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CAP_SYS_RAWIO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_capable
	cbz	x0, LBB0_4
; %bb.3:
Lloh19:
	adrp	x8, _AGP_FF_ALLOW_CONTROLLER@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AGP_FF_ALLOW_CONTROLLER@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
LBB0_4:
	ldr	x8, [x21]
	ldr	w0, [x8]
	bl	_agp_find_client_by_pid
	mov	x21, x0
	cbz	x0, LBB0_6
; %bb.5:
Lloh22:
	adrp	x8, _AGP_FF_IS_CLIENT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AGP_FF_IS_CLIENT@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
Lloh25:
	adrp	x8, _AGP_FF_IS_VALID@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AGP_FF_IS_VALID@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
LBB0_6:
	str	x20, [x19]
	mov	x0, x20
	bl	_agp_insert_file_private
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	bl	_DBG
	mov	w19, #0
	b	LBB0_9
LBB0_7:
Lloh30:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh32:
	ldr	w21, [x8]
LBB0_8:
	neg	w19, w21
LBB0_9:
Lloh33:
	adrp	x0, _agp_fe@GOTPAGE
Lloh34:
	ldr	x0, [x0, _agp_fe@GOTPAGEOFF]
	bl	_mutex_unlock
	bl	_unlock_kernel
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_agp_fe,4,2                     ; @agp_fe
	.comm	_AGPGART_MINOR,4,2              ; @AGPGART_MINOR
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_AGP_FF_ALLOW_CLIENT,4,2        ; @AGP_FF_ALLOW_CLIENT
	.comm	_current,8,3                    ; @current
	.comm	_CAP_SYS_RAWIO,4,2              ; @CAP_SYS_RAWIO
	.comm	_AGP_FF_ALLOW_CONTROLLER,4,2    ; @AGP_FF_ALLOW_CONTROLLER
	.comm	_AGP_FF_IS_CLIENT,4,2           ; @AGP_FF_IS_CLIENT
	.comm	_AGP_FF_IS_VALID,4,2            ; @AGP_FF_IS_VALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"private=%p, client=%p"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_agp_open
.subsections_via_symbols
