	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_vgpu_mmap
_intel_vgpu_mmap:                       ## @intel_vgpu_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_mdev_get_drvdata
	movl	(%rbx), %r14d
	movq	_VFIO_PCI_OFFSET_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	subl	%edx, %ecx
	movl	%r14d, %esi
	shrl	%cl, %esi
	movq	%rax, %r13
	movq	_VFIO_PCI_ROM_REGION_INDEX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jae	LBB0_6
## %bb.1:
	movq	8(%rbx), %r15
	movq	16(%rbx), %r12
	subq	%r12, %r15
	jl	LBB0_6
## %bb.2:
	movq	_VM_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%rbx)
	je	LBB0_6
## %bb.3:
	movq	_VFIO_PCI_BAR2_REGION_INDEX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_6
## %bb.4:
	movl	28(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$-1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	notl	%eax
	andl	%eax, %r14d
	movq	%r14, %rsi
	movl	%edx, %ecx
	shlq	%cl, %rsi
	movq	%r13, %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	callq	_intel_vgpu_in_aperture
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	addq	%r15, -56(%rbp)                 ## 8-byte Folded Spill
	movq	%r13, %rdi
	callq	_vgpu_aperture_offset
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_vgpu_aperture_sz
	addq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	cmpq	%rax, -56(%rbp)                 ## 8-byte Folded Reload
	jbe	LBB0_7
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%r13), %edi
	callq	_gvt_aperture_pa_base
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %rax
	addq	%rax, %r14
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movq	%r15, %rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_remap_pfn_range                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VFIO_PCI_OFFSET_SHIFT,4,2      ## @VFIO_PCI_OFFSET_SHIFT
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_VFIO_PCI_ROM_REGION_INDEX,4,2  ## @VFIO_PCI_ROM_REGION_INDEX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_SHARED,4,2                  ## @VM_SHARED
	.comm	_VFIO_PCI_BAR2_REGION_INDEX,4,2 ## @VFIO_PCI_BAR2_REGION_INDEX
	.no_dead_strip	_intel_vgpu_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_vgpu_mmap
_intel_vgpu_mmap:                       ; @intel_vgpu_mmap
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	bl	_mdev_get_drvdata
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _VFIO_PCI_OFFSET_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VFIO_PCI_OFFSET_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x9]
Lloh3:
	adrp	x25, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x25, [x25, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	x9, [x25]
	sub	w10, w10, w9
	lsr	w11, w8, w10
Lloh5:
	adrp	x12, _VFIO_PCI_ROM_REGION_INDEX@GOTPAGE
Lloh6:
	ldr	x12, [x12, _VFIO_PCI_ROM_REGION_INDEX@GOTPAGEOFF]
Lloh7:
	ldr	w12, [x12]
	cmp	w11, w12
	b.hs	LBB0_6
; %bb.1:
	ldp	x12, x22, [x19, #8]
	subs	x21, x12, x22
	b.lt	LBB0_6
; %bb.2:
	ldr	w12, [x19, #24]
Lloh8:
	adrp	x13, _VM_SHARED@GOTPAGE
Lloh9:
	ldr	x13, [x13, _VM_SHARED@GOTPAGEOFF]
Lloh10:
	ldr	w13, [x13]
	tst	w13, w12
	b.eq	LBB0_6
; %bb.3:
Lloh11:
	adrp	x12, _VFIO_PCI_BAR2_REGION_INDEX@GOTPAGE
Lloh12:
	ldr	x12, [x12, _VFIO_PCI_BAR2_REGION_INDEX@GOTPAGEOFF]
Lloh13:
	ldr	w12, [x12]
	cmp	w11, w12
	b.ne	LBB0_6
; %bb.4:
	mov	x20, x0
	ldr	w23, [x19, #28]
	mov	w11, #-1
	lsl	w10, w11, w10
	mvn	w10, w10
	and	x26, x8, x10
	lsl	x24, x26, x9
	mov	x1, x24
	bl	_intel_vgpu_in_aperture
	cbz	w0, LBB0_6
; %bb.5:
	add	x27, x21, x24
	mov	x0, x20
	bl	_vgpu_aperture_offset
	mov	x24, x0
	mov	x0, x20
	bl	_vgpu_aperture_sz
	add	x8, x0, x24
	cmp	x27, x8
	b.ls	LBB0_7
LBB0_6:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	w0, [x20]
	bl	_gvt_aperture_pa_base
	ldr	x8, [x25]
	lsr	x8, x0, x8
	add	x2, x8, x26
	mov	x0, x19
	mov	x1, x22
	mov	x3, x21
	mov	x4, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_remap_pfn_range
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_VFIO_PCI_OFFSET_SHIFT,4,2      ; @VFIO_PCI_OFFSET_SHIFT
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_VFIO_PCI_ROM_REGION_INDEX,4,2  ; @VFIO_PCI_ROM_REGION_INDEX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_SHARED,4,2                  ; @VM_SHARED
	.comm	_VFIO_PCI_BAR2_REGION_INDEX,4,2 ; @VFIO_PCI_BAR2_REGION_INDEX
	.no_dead_strip	_intel_vgpu_mmap
.subsections_via_symbols
