	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_gtt_init
_intel_gtt_init:                        ## @intel_gtt_init
	.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	_intel_private@GOTPCREL(%rip), %r14
	movq	40(%r14), %rcx
	xorl	%eax, %eax
	callq	*(%rcx)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	xorl	%eax, %eax
	callq	_intel_gtt_mappable_entries
	movl	%eax, (%r14)
	xorl	%eax, %eax
	callq	_intel_gtt_total_entries
	movl	%eax, 4(%r14)
	movq	_I810_PGETBL_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%r14), %rdi
	callq	_readl
	movq	_I810_PGETBL_ENABLED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	movl	%edx, 8(%r14)
	movq	_HAS_PGTBL_EN@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	je	LBB0_3
## %bb.2:
	orl	%eax, %ecx
	movl	%ecx, 8(%r14)
LBB0_3:
	movq	64(%r14), %rdi
	movl	(%r14), %ecx
	movl	4(%r14), %edx
	shll	$2, %edx
	shll	$2, %ecx
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movl	4(%r14), %ebx
	shll	$2, %ebx
	movq	$0, 48(%r14)
	xorl	%eax, %eax
	callq	_intel_gtt_can_wc
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	56(%r14), %edi
	movl	%ebx, %esi
	callq	_ioremap_wc
	movq	%rax, 48(%r14)
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_7
LBB0_5:
	movq	48(%r14), %rax
	testq	%rax, %rax
	jne	LBB0_9
LBB0_7:
	movl	56(%r14), %edi
	movl	%ebx, %esi
	callq	_ioremap
	movq	%rax, 48(%r14)
	testq	%rax, %rax
	je	LBB0_8
LBB0_9:
	xorl	%eax, %eax
	callq	_global_cache_flush
	xorl	%eax, %eax
	callq	_intel_gtt_stolen_size
	movl	%eax, 24(%r14)
	movq	_USE_PCI_DMA_API@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	setne	%al
	movq	_INTEL_GTT_GEN@GOTPCREL(%rip), %r15
	cmpl	$3, (%r15)
	setge	%cl
	andb	%al, %cl
	movzbl	%cl, %eax
	movl	%eax, 12(%r14)
	xorl	%eax, %eax
	callq	_intel_gtt_setup_scratch_page
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_intel_gtt_cleanup
	jmp	LBB0_15
LBB0_11:
	cmpl	$3, (%r15)
	movl	20(%r14), %edi
	jge	LBB0_12
## %bb.13:
	movq	_I810_GMADDR@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_12:
	movq	_I915_GMADDR@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_pci_read_config_dword
	movq	_PCI_BASE_ADDRESS_MEM_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-28(%rbp), %eax
	movl	%eax, 16(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_8:
	movq	40(%r14), %rcx
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	*8(%rcx)
	movq	32(%r14), %rdi
	callq	_iounmap
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_intel_private,72,3             ## @intel_private
	.comm	_I810_PGETBL_CTL,8,3            ## @I810_PGETBL_CTL
	.comm	_I810_PGETBL_ENABLED,4,2        ## @I810_PGETBL_ENABLED
	.comm	_HAS_PGTBL_EN,8,3               ## @HAS_PGTBL_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"detected gtt size: %dK total, %dK mappable\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_USE_PCI_DMA_API,8,3            ## @USE_PCI_DMA_API
	.comm	_INTEL_GTT_GEN,4,2              ## @INTEL_GTT_GEN
	.comm	_I810_GMADDR,4,2                ## @I810_GMADDR
	.comm	_I915_GMADDR,4,2                ## @I915_GMADDR
	.comm	_PCI_BASE_ADDRESS_MEM_MASK,4,2  ## @PCI_BASE_ADDRESS_MEM_MASK
	.no_dead_strip	_intel_gtt_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_gtt_init
_intel_gtt_init:                        ; @intel_gtt_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
Lloh0:
	adrp	x20, _intel_private@GOTPAGE
Lloh1:
	ldr	x20, [x20, _intel_private@GOTPAGEOFF]
	ldr	x8, [x20, #40]
	ldr	x8, [x8]
	blr	x8
	mov	x19, x0
	cbnz	w0, LBB0_11
; %bb.1:
	bl	_intel_gtt_mappable_entries
	str	w0, [x20]
	bl	_intel_gtt_total_entries
	str	w0, [x20, #4]
	ldr	x8, [x20, #32]
Lloh2:
	adrp	x9, _I810_PGETBL_CTL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _I810_PGETBL_CTL@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh5:
	adrp	x8, _I810_PGETBL_ENABLED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I810_PGETBL_ENABLED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	bic	w9, w0, w8
	str	w9, [x20, #8]
Lloh8:
	adrp	x9, _HAS_PGTBL_EN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _HAS_PGTBL_EN@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cbz	x9, LBB0_3
; %bb.2:
	orr	w8, w8, w0
	str	w8, [x20, #8]
LBB0_3:
	ldr	x0, [x20, #64]
	ldp	w9, w8, [x20]
	lsl	w2, w8, #2
	lsl	w3, w9, #2
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w8, [x20, #4]
	lsl	w19, w8, #2
	str	xzr, [x20, #48]
	bl	_intel_gtt_can_wc
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w0, [x20, #56]
	mov	x1, x19
	bl	_ioremap_wc
	str	x0, [x20, #48]
	cbnz	x0, LBB0_7
	b	LBB0_6
LBB0_5:
	ldr	x0, [x20, #48]
	cbnz	x0, LBB0_7
LBB0_6:
	ldr	w0, [x20, #56]
	mov	x1, x19
	bl	_ioremap
	str	x0, [x20, #48]
	cbz	x0, LBB0_10
LBB0_7:
	bl	_global_cache_flush
	bl	_intel_gtt_stolen_size
	str	w0, [x20, #24]
Lloh13:
	adrp	x8, _USE_PCI_DMA_API@GOTPAGE
Lloh14:
	ldr	x8, [x8, _USE_PCI_DMA_API@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x8, #0
Lloh16:
	adrp	x21, _INTEL_GTT_GEN@GOTPAGE
Lloh17:
	ldr	x21, [x21, _INTEL_GTT_GEN@GOTPAGEOFF]
	ldr	w8, [x21]
	ccmp	w8, #2, #4, ne
	cset	w8, gt
	str	w8, [x20, #12]
	bl	_intel_gtt_setup_scratch_page
	mov	x19, x0
	cbz	w0, LBB0_9
; %bb.8:
	bl	_intel_gtt_cleanup
	b	LBB0_11
LBB0_9:
	ldr	w8, [x21]
Lloh18:
	adrp	x9, _I810_GMADDR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _I810_GMADDR@GOTPAGEOFF]
	ldr	w0, [x20, #20]
Lloh20:
	adrp	x10, _I915_GMADDR@GOTPAGE
Lloh21:
	ldr	x10, [x10, _I915_GMADDR@GOTPAGEOFF]
	cmp	w8, #3
	csel	x8, x9, x10, lt
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh22:
	adrp	x9, _PCI_BASE_ADDRESS_MEM_MASK@GOTPAGE
Lloh23:
	ldr	x9, [x9, _PCI_BASE_ADDRESS_MEM_MASK@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	and	w8, w9, w8
	str	w8, [x20, #16]
	b	LBB0_11
LBB0_10:
	ldr	x8, [x20, #40]
	ldr	x8, [x8, #8]
	blr	x8
	ldr	x0, [x20, #32]
	bl	_iounmap
Lloh25:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_11:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_intel_private,72,3             ; @intel_private
	.comm	_I810_PGETBL_CTL,8,3            ; @I810_PGETBL_CTL
	.comm	_I810_PGETBL_ENABLED,4,2        ; @I810_PGETBL_ENABLED
	.comm	_HAS_PGTBL_EN,8,3               ; @HAS_PGTBL_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"detected gtt size: %dK total, %dK mappable\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_USE_PCI_DMA_API,8,3            ; @USE_PCI_DMA_API
	.comm	_INTEL_GTT_GEN,4,2              ; @INTEL_GTT_GEN
	.comm	_I810_GMADDR,4,2                ; @I810_GMADDR
	.comm	_I915_GMADDR,4,2                ; @I915_GMADDR
	.comm	_PCI_BASE_ADDRESS_MEM_MASK,4,2  ; @PCI_BASE_ADDRESS_MEM_MASK
	.no_dead_strip	_intel_gtt_init
.subsections_via_symbols
