	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_alloc_mchbar_resource
_intel_alloc_mchbar_resource:           ## @intel_alloc_mchbar_resource
	.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, %rbx
	callq	_INTEL_GEN
	cmpl	$4, %eax
	jl	LBB0_1
## %bb.2:
	movq	_MCHBAR_I965@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_MCHBAR_I915@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r14d
	movl	$0, -44(%rbp)
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	cmpl	$4, %eax
	jl	LBB0_5
## %bb.4:
	movq	24(%rbx), %rdi
	leal	4(%r14), %esi
	leaq	-44(%rbp), %rdx
	callq	_pci_read_config_dword
LBB0_5:
	movq	24(%rbx), %rdi
	leaq	-48(%rbp), %rdx
	movl	%r14d, %esi
	callq	_pci_read_config_dword
	leaq	L_.str(%rip), %rax
	movq	%rax, (%rbx)
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	24(%rbx), %rax
	movl	(%rax), %edi
	movq	_MCHBAR_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_PCIBIOS_MIN_MEM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	_pcibios_align_resource@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r10d
	movq	%rbx, %rsi
	movq	%rcx, %rdx
	xorl	%r9d, %r9d
	pushq	%rax
	pushq	%r10
	callq	_pci_bus_alloc_resource
	addq	$16, %rsp
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	callq	_DRM_DEBUG_DRIVER
	movq	$0, 8(%rbx)
	jmp	LBB0_10
LBB0_7:
	movq	%rbx, %rdi
	callq	_INTEL_GEN
	cmpl	$4, %eax
	jl	LBB0_9
## %bb.8:
	movq	8(%rbx), %rdi
	movq	24(%rbx), %r12
	leal	4(%r14), %r13d
	callq	_upper_32_bits
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_pci_write_config_dword
LBB0_9:
	movq	8(%rbx), %rdi
	movq	24(%rbx), %rbx
	callq	_lower_32_bits
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_pci_write_config_dword
LBB0_10:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MCHBAR_I965,4,2                ## @MCHBAR_I965
	.comm	_MCHBAR_I915,4,2                ## @MCHBAR_I915
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i915 MCHBAR"

	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_MCHBAR_SIZE,8,3                ## @MCHBAR_SIZE
	.comm	_PCIBIOS_MIN_MEM,4,2            ## @PCIBIOS_MIN_MEM
	.comm	_pcibios_align_resource,4,2     ## @pcibios_align_resource
L_.str.1:                               ## @.str.1
	.asciz	"failed bus alloc: %d\n"

	.no_dead_strip	_intel_alloc_mchbar_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_alloc_mchbar_resource
_intel_alloc_mchbar_resource:           ; @intel_alloc_mchbar_resource
	.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	x19, x0
	bl	_INTEL_GEN
Lloh0:
	adrp	x8, _MCHBAR_I965@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MCHBAR_I965@GOTPAGEOFF]
Lloh2:
	adrp	x9, _MCHBAR_I915@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MCHBAR_I915@GOTPAGEOFF]
	cmp	w0, #3
	csel	x8, x8, x9, gt
	ldr	w20, [x8]
	str	wzr, [sp, #8]
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #4
	b.lt	LBB0_2
; %bb.1:
	ldr	x0, [x19, #24]
	add	w1, w20, #4
	add	x2, sp, #8
	bl	_pci_read_config_dword
LBB0_2:
	ldr	x0, [x19, #24]
	add	x2, sp, #12
	mov	x1, x20
	bl	_pci_read_config_dword
Lloh4:
	adrp	x8, l_.str@PAGE
Lloh5:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19]
Lloh6:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	x7, [x19, #24]
	ldr	w0, [x7]
Lloh9:
	adrp	x8, _MCHBAR_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCHBAR_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	x2, [x8]
Lloh12:
	adrp	x8, _PCIBIOS_MIN_MEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCIBIOS_MIN_MEM@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
Lloh15:
	adrp	x8, _pcibios_align_resource@GOTPAGE
Lloh16:
	ldr	x8, [x8, _pcibios_align_resource@GOTPAGEOFF]
Lloh17:
	ldr	w6, [x8]
	mov	x1, x19
	mov	x3, x2
	mov	w5, #0
	bl	_pci_bus_alloc_resource
	mov	x21, x0
	cbz	w0, LBB0_4
; %bb.3:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_DRM_DEBUG_DRIVER
	str	xzr, [x19, #8]
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #4
	b.lt	LBB0_6
; %bb.5:
	ldr	x22, [x19, #24]
	add	w23, w20, #4
	ldr	x0, [x19, #8]
	bl	_upper_32_bits
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_pci_write_config_dword
LBB0_6:
	ldr	x22, [x19, #24]
	ldr	x0, [x19, #8]
	bl	_lower_32_bits
	mov	x2, x0
	mov	x0, x22
	mov	x1, x20
	bl	_pci_write_config_dword
LBB0_7:
	mov	x0, x21
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MCHBAR_I965,4,2                ; @MCHBAR_I965
	.comm	_MCHBAR_I915,4,2                ; @MCHBAR_I915
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i915 MCHBAR"

	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_MCHBAR_SIZE,8,3                ; @MCHBAR_SIZE
	.comm	_PCIBIOS_MIN_MEM,4,2            ; @PCIBIOS_MIN_MEM
	.comm	_pcibios_align_resource,4,2     ; @pcibios_align_resource
l_.str.1:                               ; @.str.1
	.asciz	"failed bus alloc: %d\n"

	.no_dead_strip	_intel_alloc_mchbar_resource
.subsections_via_symbols
