	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gen6_gmch_probe
_gen6_gmch_probe:                       ## @gen6_gmch_probe
	.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	%r8, %r13
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	8(%rdi), %r14
	movl	(%rdi), %edi
	movl	$2, %esi
	callq	_pci_resource_start
	movq	%rax, (%rbx)
	movl	(%r12), %edi
	movl	$2, %esi
	callq	_pci_resource_len
	movq	%rax, (%r13)
	addq	$-536870913, %rax               ## imm = 0xDFFFFFFF
	cmpq	$-469762050, %rax               ## imm = 0xE3FFFFFE
	ja	LBB0_2
## %bb.1:
	movl	12(%r14), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_2:
	movl	(%r12), %ebx
	movl	$40, %edi
	callq	_DMA_BIT_MASK
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_pci_set_dma_mask
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movl	(%r12), %ebx
	movl	$40, %edi
	callq	_DMA_BIT_MASK
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_pci_set_consistent_dma_mask
LBB0_4:
	movl	(%r12), %edi
	movq	_SNB_GMCH_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_pci_read_config_word
	movl	-44(%rbp), %edi
	callq	_gen6_get_total_gtt_size
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_IS_GEN7
	movl	-44(%rbp), %edi
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	callq	_gen7_get_stolen_size
	jmp	LBB0_7
LBB0_6:
	callq	_gen6_get_stolen_size
LBB0_7:
	movq	%rax, (%r15)
	movl	%r13d, %eax
	shrl	$2, %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shlq	%cl, %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movl	(%r12), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_pci_resource_start
	leaq	2097152(%rax), %rdi
	movl	%r13d, %esi
	callq	_ioremap_wc
	movl	%eax, 8(%r14)
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:
	movq	%r12, %rdi
	callq	_setup_scratch_page
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_10:
	movq	_gen6_ggtt_clear_range@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	movq	_gen6_ggtt_insert_entries@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_13
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_12:
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %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	"Unknown GMADR size (%lx)\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_SNB_GMCH_CTRL,4,2              ## @SNB_GMCH_CTRL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"Failed to map the gtt page table\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Scratch setup failed\n"

	.comm	_gen6_ggtt_clear_range,4,2      ## @gen6_ggtt_clear_range
	.comm	_gen6_ggtt_insert_entries,4,2   ## @gen6_ggtt_insert_entries
	.no_dead_strip	_gen6_gmch_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gen6_gmch_probe
_gen6_gmch_probe:                       ; @gen6_gmch_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x4
	mov	x23, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x24, [x0, #8]
	ldr	w0, [x0]
	mov	w1, #2
	bl	_pci_resource_start
	str	x0, [x23]
	ldr	w0, [x19]
	mov	w1, #2
	bl	_pci_resource_len
	str	x0, [x22]
	mov	x8, #-536870913
	mov	x9, #-2
	movk	x9, #58367, lsl #16
	add	x8, x0, x8
	cmp	x8, x9
	b.hi	LBB0_2
; %bb.1:
	ldr	w8, [x24, #12]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh2:
	adrp	x8, _ENXIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_12
LBB0_2:
	ldr	w22, [x19]
	mov	w0, #40
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x22
	bl	_pci_set_dma_mask
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	w22, [x19]
	mov	w0, #40
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x22
	bl	_pci_set_consistent_dma_mask
LBB0_4:
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _SNB_GMCH_CTRL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SNB_GMCH_CTRL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_pci_read_config_word
	ldr	w0, [sp, #12]
	bl	_gen6_get_total_gtt_size
	mov	x22, x0
	mov	x0, x19
	bl	_IS_GEN7
	mov	x8, x0
	ldr	w0, [sp, #12]
	cbz	x8, LBB0_6
; %bb.5:
	bl	_gen7_get_stolen_size
	b	LBB0_7
LBB0_6:
	bl	_gen6_get_stolen_size
LBB0_7:
	str	x0, [x21]
	lsr	w8, w22, #2
Lloh7:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	lsl	x8, x8, x9
	str	x8, [x20]
	ldr	w0, [x19]
	mov	w1, #0
	bl	_pci_resource_start
	add	x0, x0, #512, lsl #12           ; =2097152
	mov	x1, x22
	bl	_ioremap_wc
	str	w0, [x24, #8]
	cbz	w0, LBB0_11
; %bb.8:
	mov	x0, x19
	bl	_setup_scratch_page
	mov	x19, x0
	cbz	w0, LBB0_10
; %bb.9:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
LBB0_10:
Lloh12:
	adrp	x8, _gen6_ggtt_clear_range@GOTPAGE
Lloh13:
	ldr	x8, [x8, _gen6_ggtt_clear_range@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _gen6_ggtt_insert_entries@GOTPAGE
Lloh16:
	ldr	x9, [x9, _gen6_ggtt_insert_entries@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x24]
	b	LBB0_13
LBB0_11:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown GMADR size (%lx)\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_SNB_GMCH_CTRL,4,2              ; @SNB_GMCH_CTRL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"Failed to map the gtt page table\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Scratch setup failed\n"

	.comm	_gen6_ggtt_clear_range,4,2      ; @gen6_ggtt_clear_range
	.comm	_gen6_ggtt_insert_entries,4,2   ; @gen6_ggtt_insert_entries
	.no_dead_strip	_gen6_gmch_probe
.subsections_via_symbols
