	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ppgtt_alloc_spt
_ppgtt_alloc_spt:                       ## @ppgtt_alloc_spt
	.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
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movq	___GFP_ZERO@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	orl	(%r13), %edi
	callq	_alloc_spt
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %rdi
	callq	_reclaim_one_ppgtt_mm
	testq	%rax, %rax
	jne	LBB0_1
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_gvt_vgpu_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_9
LBB0_4:
	movq	%rax, %rbx
	movq	%r15, 24(%rax)
	leaq	20(%rax), %rdi
	movl	$1, %esi
	callq	_atomic_set
	movq	%rbx, %rdi
	addq	$16, %rdi
	callq	_INIT_LIST_HEAD
	movl	%r12d, (%rbx)
	movl	8(%rbx), %esi
	movq	_PCI_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%r12d, %r12d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%edx, %edx
	movl	$4096, %ecx                     ## imm = 0x1000
	callq	_dma_map_page
	movl	%eax, %r13d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_gvt_vgpu_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_8
LBB0_6:
	movl	8(%rbx), %edi
	callq	_page_address
	movl	%eax, 12(%rbx)
	movq	_I915_GTT_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r13d, %esi
	sarl	%cl, %esi
	movl	%esi, 4(%rbx)
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_radix_tree_insert
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	movl	%eax, %r12d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PCI_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_dma_unmap_page
LBB0_8:
	movq	%rbx, %rdi
	callq	_free_spt
LBB0_9:
	movl	%r12d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_10:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail to allocate ppgtt shadow page\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ## @PCI_DMA_BIDIRECTIONAL
L_.str.1:                               ## @.str.1
	.asciz	"fail to map dma addr\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_I915_GTT_PAGE_SHIFT,4,2        ## @I915_GTT_PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_ppgtt_alloc_spt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ppgtt_alloc_spt
_ppgtt_alloc_spt:                       ; @ppgtt_alloc_spt
	.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	x22, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	x20, [x8]
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	adrp	x24, ___GFP_ZERO@GOTPAGE
Lloh3:
	ldr	x24, [x24, ___GFP_ZERO@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w0, w9, w8
	bl	_alloc_spt
	cbnz	x0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x21, #8]
	bl	_reclaim_one_ppgtt_mm
	cbnz	x0, LBB0_1
; %bb.3:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_vgpu_err
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_4:
	mov	x19, x0
	str	x21, [x0, #24]
	add	x0, x0, #20
	mov	w1, #1
	bl	_atomic_set
	add	x0, x19, #16
	bl	_INIT_LIST_HEAD
	str	w22, [x19]
	ldr	w1, [x19, #8]
Lloh9:
	adrp	x23, _PCI_DMA_BIDIRECTIONAL@GOTPAGE
Lloh10:
	ldr	x23, [x23, _PCI_DMA_BIDIRECTIONAL@GOTPAGEOFF]
	ldr	w4, [x23]
	mov	x0, x20
	mov	w2, #0
	mov	w3, #4096
	bl	_dma_map_page
	mov	x22, x0
	mov	x0, x20
	mov	x1, x22
	bl	_dma_mapping_error
	cbz	x0, LBB0_6
; %bb.5:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gvt_vgpu_err
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_6:
	ldr	w0, [x19, #8]
	bl	_page_address
	str	w0, [x19, #12]
Lloh16:
	adrp	x8, _I915_GTT_PAGE_SHIFT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _I915_GTT_PAGE_SHIFT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	asr	w1, w22, w8
	str	w1, [x19, #4]
	mov	x0, x21
	mov	x2, x19
	bl	_radix_tree_insert
	cbz	w0, LBB0_10
; %bb.7:
	mov	x21, x0
Lloh19:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x22
	bl	_dma_unmap_page
LBB0_8:
	mov	x0, x19
	bl	_free_spt
LBB0_9:
	mov	x0, x21
	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
	b	_ERR_PTR
LBB0_10:
	mov	x0, x19
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail to allocate ppgtt shadow page\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ; @PCI_DMA_BIDIRECTIONAL
l_.str.1:                               ; @.str.1
	.asciz	"fail to map dma addr\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_I915_GTT_PAGE_SHIFT,4,2        ; @I915_GTT_PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_ppgtt_alloc_spt
.subsections_via_symbols
