	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_init_gtt             ## -- Begin function intel_gvt_init_gtt
	.p2align	4, 0x90
_intel_gvt_init_gtt:                    ## @intel_gvt_init_gtt
	.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	%rdi, %r13
	movq	40(%rdi), %rax
	movq	(%rax), %r14
	leaq	L_.str(%rip), %rdi
	callq	_gvt_dbg_core
	movq	_gen8_gtt_pte_ops@GOTPCREL(%rip), %rax
	movq	%rax, 32(%r13)
	movq	_gen8_gtt_gma_ops@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_zeroed_page
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_virt_to_page
	movq	_PCI_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	$4096, %ecx                     ## imm = 0x1000
	callq	_dma_map_page
	movl	%eax, %r12d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	callq	_gvt_err
	movq	%rbx, %rdi
	callq	_virt_to_page
	movl	%eax, %edi
	callq	___free_page
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	callq	_gvt_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_8
LBB0_4:
	movq	%rbx, %rdi
	callq	_virt_to_page
	movl	%eax, 16(%r13)
	movq	_I915_GTT_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r12d, %eax
	sarl	%cl, %eax
	cltq
	movq	%rax, (%r13)
	movq	_enable_out_of_sync@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.5:
	movq	%r13, %rdi
	callq	_setup_spt_oos
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rdi
	callq	_gvt_err
	movq	_PCI_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_dma_unmap_page
	movl	16(%r13), %edi
	callq	___free_page
	jmp	LBB0_8
LBB0_7:
	leaq	12(%r13), %rdi
	callq	_INIT_LIST_HEAD
	addq	$8, %r13
	movq	%r13, %rdi
	callq	_mutex_init
	xorl	%r15d, %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"init gtt\n"

	.comm	_gen8_gtt_pte_ops,4,2           ## @gen8_gtt_pte_ops
	.comm	_gen8_gtt_gma_ops,4,2           ## @gen8_gtt_gma_ops
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"fail to allocate scratch ggtt page\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ## @PCI_DMA_BIDIRECTIONAL
L_.str.2:                               ## @.str.2
	.asciz	"fail to dmamap scratch ggtt page\n"

	.comm	_I915_GTT_PAGE_SHIFT,4,2        ## @I915_GTT_PAGE_SHIFT
	.comm	_enable_out_of_sync,8,3         ## @enable_out_of_sync
L_.str.3:                               ## @.str.3
	.asciz	"fail to initialize SPT oos\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_init_gtt             ; -- Begin function intel_gvt_init_gtt
	.p2align	2
_intel_gvt_init_gtt:                    ; @intel_gvt_init_gtt
	.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, x0
	ldr	x8, [x0, #40]
	ldr	x20, [x8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_gvt_dbg_core
Lloh2:
	adrp	x8, _gen8_gtt_pte_ops@GOTPAGE
Lloh3:
	ldr	x8, [x8, _gen8_gtt_pte_ops@GOTPAGEOFF]
Lloh4:
	adrp	x9, _gen8_gtt_gma_ops@GOTPAGE
Lloh5:
	ldr	x9, [x9, _gen8_gtt_gma_ops@GOTPAGEOFF]
	stp	x9, x8, [x19, #24]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_get_zeroed_page
	cbz	x0, LBB0_3
; %bb.1:
	mov	x22, x0
	bl	_virt_to_page
	mov	x1, x0
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	x21, x0
	mov	x0, x20
	mov	x1, x21
	bl	_dma_mapping_error
	cbz	x0, LBB0_6
; %bb.2:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_gvt_err
	mov	x0, x22
	bl	_virt_to_page
	bl	___free_page
	b	LBB0_4
LBB0_3:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gvt_err
LBB0_4:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_5:
	mov	x0, x22
	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
LBB0_6:
	mov	x0, x22
	bl	_virt_to_page
	str	w0, [x19, #16]
Lloh18:
	adrp	x8, _I915_GTT_PAGE_SHIFT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _I915_GTT_PAGE_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	asr	w8, w21, w8
	sxtw	x8, w8
	str	x8, [x19]
Lloh21:
	adrp	x8, _enable_out_of_sync@GOTPAGE
Lloh22:
	ldr	x8, [x8, _enable_out_of_sync@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.7:
	mov	x0, x19
	bl	_setup_spt_oos
	cbz	w0, LBB0_9
; %bb.8:
	mov	x22, x0
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gvt_err
	ldr	w3, [x23]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #4096
	bl	_dma_unmap_page
	ldr	w0, [x19, #16]
	bl	___free_page
	b	LBB0_5
LBB0_9:
	add	x0, x19, #12
	bl	_INIT_LIST_HEAD
	add	x0, x19, #8
	bl	_mutex_init
	mov	w22, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"init gtt\n"

	.comm	_gen8_gtt_pte_ops,4,2           ; @gen8_gtt_pte_ops
	.comm	_gen8_gtt_gma_ops,4,2           ; @gen8_gtt_gma_ops
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"fail to allocate scratch ggtt page\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PCI_DMA_BIDIRECTIONAL,4,2      ; @PCI_DMA_BIDIRECTIONAL
l_.str.2:                               ; @.str.2
	.asciz	"fail to dmamap scratch ggtt page\n"

	.comm	_I915_GTT_PAGE_SHIFT,4,2        ; @I915_GTT_PAGE_SHIFT
	.comm	_enable_out_of_sync,8,3         ; @enable_out_of_sync
l_.str.3:                               ; @.str.3
	.asciz	"fail to initialize SPT oos\n"

.subsections_via_symbols
