	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function agp_mmap
_agp_mmap:                              ## @agp_mmap
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r12
	movq	_agp_fe@GOTPCREL(%rip), %rbx
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	cmpl	$1, (%rbx)
	jne	LBB0_16
## %bb.1:
	movq	_AGP_FF_IS_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_16
## %bb.2:
	movq	%r15, %rbx
	movq	_agp_bridge@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-80(%rbp), %rsi
	callq	_agp_copy_info
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	subl	4(%rax), %edx
	movl	-80(%rbp), %r14d
	shll	$20, %r14d
	movq	8(%rax), %r13
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %r13
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rdx,%r13), %r15
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_DBG
	movq	_AGP_FF_IS_CLIENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movl	%r14d, %eax
	cmpq	%rax, %r15
	movq	%rbx, %r15
	ja	LBB0_17
## %bb.4:
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_agp_find_client_by_pid
	testq	%rax, %rax
	je	LBB0_16
## %bb.5:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	24(%rcx), %ecx
	movq	%rax, %rdi
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_agp_find_seg_in_client
	testl	%eax, %eax
	je	LBB0_17
## %bb.6:
	movq	-72(%rbp), %rsi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DBG
	movq	-72(%rbp), %rax
	testq	%rax, %rax
	jne	LBB0_7
## %bb.8:
	addq	-64(%rbp), %r13
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %r13
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %esi
	movl	24(%rdi), %r8d
	movq	%r13, %rdx
	jmp	LBB0_9
LBB0_11:
	movq	_AGP_FF_IS_CONTROLLER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	movq	%rbx, %r15
	je	LBB0_16
## %bb.12:
	cmpl	%r14d, -56(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_17
## %bb.13:
	movq	-72(%rbp), %rsi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DBG
	movq	-72(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_14
LBB0_7:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, 16(%rcx)
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_16:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_EPERM@GOTPCREL(%rip), %rcx
LBB0_18:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_18
LBB0_14:
	movq	-64(%rbp), %rdx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %esi
	movl	24(%rdi), %r8d
LBB0_9:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_io_remap_pfn_range
	testq	%rax, %rax
	je	LBB0_10
## %bb.15:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_agp_fe,8,2                     ## @agp_fe
	.comm	_AGP_FF_IS_VALID,4,2            ## @AGP_FF_IS_VALID
	.comm	_agp_bridge,4,2                 ## @agp_bridge
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%lx:%lx"

	.comm	_AGP_FF_IS_CLIENT,4,2           ## @AGP_FF_IS_CLIENT
	.comm	_current,8,3                    ## @current
L_.str.1:                               ## @.str.1
	.asciz	"client vm_ops=%p"

	.comm	_AGP_FF_IS_CONTROLLER,4,2       ## @AGP_FF_IS_CONTROLLER
L_.str.2:                               ## @.str.2
	.asciz	"controller vm_ops=%p"

	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_agp_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function agp_mmap
_agp_mmap:                              ; @agp_mmap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	ldr	x22, [x0]
Lloh0:
	adrp	x24, _agp_fe@GOTPAGE
Lloh1:
	ldr	x24, [x24, _agp_fe@GOTPAGEOFF]
	add	x21, x24, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w8, [x24]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.1:
Lloh2:
	adrp	x8, _AGP_FF_IS_VALID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AGP_FF_IS_VALID@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_test_bit
	cbz	x0, LBB0_13
; %bb.2:
Lloh5:
	adrp	x8, _agp_bridge@GOTPAGE
Lloh6:
	ldr	x8, [x8, _agp_bridge@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, sp, #8
	bl	_agp_copy_info
	ldp	w8, w9, [x19]
	ldr	w10, [sp, #8]
	lsl	w26, w10, #20
	ldr	x10, [x19, #8]
Lloh8:
	adrp	x25, _PAGE_SHIFT@GOTPAGE
Lloh9:
	ldr	x25, [x25, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x11, [x25]
	lsl	x23, x10, x11
	sub	w20, w8, w9
	add	x27, x23, x20
	str	x27, [sp]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_DBG
Lloh12:
	adrp	x8, _AGP_FF_IS_CLIENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AGP_FF_IS_CLIENT@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_test_bit
	cbz	x0, LBB0_8
; %bb.3:
	cmp	x27, w26, uxtw
	b.hi	LBB0_16
; %bb.4:
Lloh15:
	adrp	x8, _current@GOTPAGE
Lloh16:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_agp_find_client_by_pid
	cbz	x0, LBB0_13
; %bb.5:
	ldr	w3, [x19, #24]
	mov	x1, x23
	mov	x2, x20
	bl	_agp_find_seg_in_client
	cbz	w0, LBB0_16
; %bb.6:
	ldr	x1, [sp, #16]
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DBG
	ldr	x8, [sp, #16]
	cbnz	x8, LBB0_11
; %bb.7:
	ldr	w1, [x19, #4]
	ldr	x8, [sp, #24]
	add	x8, x8, x23
	b	LBB0_18
LBB0_8:
Lloh20:
	adrp	x8, _AGP_FF_IS_CONTROLLER@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AGP_FF_IS_CONTROLLER@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_test_bit
	cbz	x0, LBB0_13
; %bb.9:
	cmp	w20, w26
	b.ne	LBB0_16
; %bb.10:
	ldr	x1, [sp, #16]
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DBG
	ldr	x8, [sp, #16]
	cbz	x8, LBB0_17
LBB0_11:
	str	x8, [x19, #16]
LBB0_12:
	add	x0, x24, #4
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_15
LBB0_13:
	mov	x0, x21
	bl	_mutex_unlock
Lloh25:
	adrp	x8, _EPERM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_16:
	add	x0, x24, #4
	bl	_mutex_unlock
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_17:
	ldr	w1, [x19, #4]
	ldr	x8, [sp, #24]
LBB0_18:
	ldr	x9, [x25]
	lsr	x2, x8, x9
	ldr	w4, [x19, #24]
	mov	x0, x19
	mov	x3, x20
	bl	_io_remap_pfn_range
	cbz	x0, LBB0_12
; %bb.19:
	add	x0, x24, #4
	bl	_mutex_unlock
Lloh29:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_agp_fe,8,2                     ; @agp_fe
	.comm	_AGP_FF_IS_VALID,4,2            ; @AGP_FF_IS_VALID
	.comm	_agp_bridge,4,2                 ; @agp_bridge
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%lx:%lx"

	.comm	_AGP_FF_IS_CLIENT,4,2           ; @AGP_FF_IS_CLIENT
	.comm	_current,8,3                    ; @current
l_.str.1:                               ; @.str.1
	.asciz	"client vm_ops=%p"

	.comm	_AGP_FF_IS_CONTROLLER,4,2       ; @AGP_FF_IS_CONTROLLER
l_.str.2:                               ; @.str.2
	.asciz	"controller vm_ops=%p"

	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_agp_mmap
.subsections_via_symbols
