	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_setup_bridge_mmio
_pci_setup_bridge_mmio:                 ## @pci_setup_bridge_mmio
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	_PCI_BRIDGE_RESOURCES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
	leaq	4(%r12,%rbx,4), %r14
	movl	(%rdi), %edi
	leaq	-40(%rbp), %rsi
	movq	%r14, %rdx
	callq	_pcibios_resource_to_bus
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12,%rbx,4)
	je	LBB0_1
## %bb.2:
	movzwl	-38(%rbp), %eax
	andl	$-16, %eax
	movl	$-1048576, %ebx                 ## imm = 0xFFF00000
	andl	-36(%rbp), %ebx
	orl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_pci_info
	jmp	LBB0_3
LBB0_1:
	movl	$65520, %ebx                    ## imm = 0xFFF0
LBB0_3:
	movq	_PCI_MEMORY_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_pci_write_config_dword
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_BRIDGE_RESOURCES,4,2       ## @PCI_BRIDGE_RESOURCES
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"  bridge window %pR\n"

	.comm	_PCI_MEMORY_BASE,4,2            ## @PCI_MEMORY_BASE
	.no_dead_strip	_pci_setup_bridge_mmio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_setup_bridge_mmio
_pci_setup_bridge_mmio:                 ; @pci_setup_bridge_mmio
	.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
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _PCI_BRIDGE_RESOURCES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_BRIDGE_RESOURCES@GOTPAGEOFF]
Lloh2:
	ldrsw	x9, [x9]
	add	x21, x8, x9, lsl #2
	add	x20, x21, #4
	ldr	w0, [x0]
	add	x1, sp, #8
	mov	x2, x20
	bl	_pcibios_resource_to_bus
	ldr	w8, [x21, #4]
Lloh3:
	adrp	x9, _IORESOURCE_MEM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldrh	w8, [sp, #10]
	and	w8, w8, #0xfff0
	ldr	w9, [sp, #12]
	and	w9, w9, #0xfff00000
	orr	w21, w8, w9
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_pci_info
	b	LBB0_3
LBB0_2:
	mov	w21, #65520
LBB0_3:
Lloh8:
	adrp	x8, _PCI_MEMORY_BASE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PCI_MEMORY_BASE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_pci_write_config_dword
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_BRIDGE_RESOURCES,4,2       ; @PCI_BRIDGE_RESOURCES
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"  bridge window %pR\n"

	.comm	_PCI_MEMORY_BASE,4,2            ; @PCI_MEMORY_BASE
	.no_dead_strip	_pci_setup_bridge_mmio
.subsections_via_symbols
