	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i810_setup
_i810_setup:                            ## @i810_setup
	.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	_I810_GTT_ORDER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_gatt_pages
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	_intel_private@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	movq	16(%r15), %rdi
	movq	_I810_MMADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_pci_read_config_dword
	movl	$-524288, %ebx                  ## imm = 0xFFF80000
	andl	-28(%rbp), %ebx
	movl	%ebx, -28(%rbp)
	movl	$64, %edi
	callq	_KB
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ioremap
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%r14, %rdi
	callq	_virt_to_phys
	movq	_I810_PGETBL_ENABLED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_I810_PGETBL_CTL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	24(%r15), %rsi
	movl	%eax, %edi
	callq	_writel
	movslq	-28(%rbp), %rax
	movq	_I810_PTE_BASE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%rax, 32(%r15)
	movq	_I810_DRAM_CTL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%r15), %rdi
	callq	_readl
	movq	_I810_DRAM_ROW_0@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_I810_DRAM_ROW_0_SDRAM@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.4:
	movq	16(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movl	$1024, 8(%r15)                  ## imm = 0x400
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I810_GTT_ORDER,4,2             ## @I810_GTT_ORDER
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_intel_private,40,3             ## @intel_private
	.comm	_I810_MMADDR,4,2                ## @I810_MMADDR
	.comm	_I810_PGETBL_ENABLED,4,2        ## @I810_PGETBL_ENABLED
	.comm	_I810_PGETBL_CTL,8,3            ## @I810_PGETBL_CTL
	.comm	_I810_PTE_BASE,8,3              ## @I810_PTE_BASE
	.comm	_I810_DRAM_CTL,8,3              ## @I810_DRAM_CTL
	.comm	_I810_DRAM_ROW_0,4,2            ## @I810_DRAM_ROW_0
	.comm	_I810_DRAM_ROW_0_SDRAM,4,2      ## @I810_DRAM_ROW_0_SDRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"detected 4MB dedicated video ram\n"

	.no_dead_strip	_i810_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i810_setup
_i810_setup:                            ; @i810_setup
	.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	x8, _I810_GTT_ORDER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I810_GTT_ORDER@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_alloc_gatt_pages
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x21, _intel_private@GOTPAGE
Lloh4:
	ldr	x21, [x21, _intel_private@GOTPAGEOFF]
	str	x0, [x21]
	ldr	x0, [x21, #16]
Lloh5:
	adrp	x8, _I810_MMADDR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I810_MMADDR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	and	w20, w8, #0xfff80000
	str	w20, [sp, #12]
	mov	w0, #64
	bl	_KB
	mov	x1, x0
	mov	x0, x20
	bl	_ioremap
	str	x0, [x21, #24]
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_virt_to_phys
Lloh8:
	adrp	x8, _I810_PGETBL_ENABLED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I810_PGETBL_ENABLED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x21, #24]
Lloh11:
	adrp	x9, _I810_PGETBL_CTL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _I810_PGETBL_CTL@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldrsw	x8, [sp, #12]
Lloh14:
	adrp	x9, _I810_PTE_BASE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _I810_PTE_BASE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x8, x9, x8
	str	x8, [x21, #32]
	ldr	x8, [x21, #24]
Lloh17:
	adrp	x9, _I810_DRAM_CTL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _I810_DRAM_CTL@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh20:
	adrp	x8, _I810_DRAM_ROW_0@GOTPAGE
Lloh21:
	ldr	x8, [x8, _I810_DRAM_ROW_0@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh23:
	adrp	x9, _I810_DRAM_ROW_0_SDRAM@GOTPAGE
Lloh24:
	ldr	x9, [x9, _I810_DRAM_ROW_0_SDRAM@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.3:
	ldr	x0, [x21, #16]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	mov	w0, #0
	mov	w8, #1024
	str	w8, [x21, #8]
	b	LBB0_6
LBB0_4:
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_I810_GTT_ORDER,4,2             ; @I810_GTT_ORDER
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_intel_private,40,3             ; @intel_private
	.comm	_I810_MMADDR,4,2                ; @I810_MMADDR
	.comm	_I810_PGETBL_ENABLED,4,2        ; @I810_PGETBL_ENABLED
	.comm	_I810_PGETBL_CTL,8,3            ; @I810_PGETBL_CTL
	.comm	_I810_PTE_BASE,8,3              ; @I810_PTE_BASE
	.comm	_I810_DRAM_CTL,8,3              ; @I810_DRAM_CTL
	.comm	_I810_DRAM_ROW_0,4,2            ; @I810_DRAM_ROW_0
	.comm	_I810_DRAM_ROW_0_SDRAM,4,2      ; @I810_DRAM_ROW_0_SDRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"detected 4MB dedicated video ram\n"

	.no_dead_strip	_i810_setup
.subsections_via_symbols
