	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_setup_bridge_io
_pci_setup_bridge_io:                   ## @pci_setup_bridge_io
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	16(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_PCI_IO_RANGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_PCI_IO_1K_RANGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	8(%rdi), %r14
	movq	_PCI_BRIDGE_RESOURCES@GOTPCREL(%rip), %rax
	movslq	(%rax), %r13
	leaq	(%r14,%r13,4), %r15
	movl	(%rdi), %edi
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdx
	callq	_pcibios_resource_to_bus
	movq	_IORESOURCE_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14,%r13,4)
	je	LBB0_2
## %bb.1:
	movq	_PCI_IO_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_pci_read_config_word
	movl	-56(%rbp), %r14d
	movl	-52(%rbp), %eax
	movl	%r14d, %ecx
	sarl	$8, %ecx
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	cmovel	-72(%rbp), %ebx                 ## 4-byte Folded Reload
	andl	%ebx, %ecx
	shll	$8, %ebx
	andl	%eax, %ebx
	orl	%ecx, %ebx
	movl	%ebx, -44(%rbp)
	andl	$-65536, %eax                   ## imm = 0xFFFF0000
	sarl	$16, %r14d
	orl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_pci_info
	jmp	LBB0_3
LBB0_2:
	movl	$240, -44(%rbp)
	xorl	%r14d, %r14d
LBB0_3:
	movq	_PCI_IO_BASE_UPPER16@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_pci_write_config_dword
	movq	_PCI_IO_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	callq	_pci_write_config_word
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_pci_write_config_dword
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_IO_RANGE_MASK,8,3          ## @PCI_IO_RANGE_MASK
	.comm	_PCI_IO_1K_RANGE_MASK,8,3       ## @PCI_IO_1K_RANGE_MASK
	.comm	_PCI_BRIDGE_RESOURCES,4,2       ## @PCI_BRIDGE_RESOURCES
	.comm	_IORESOURCE_IO,4,2              ## @IORESOURCE_IO
	.comm	_PCI_IO_BASE,4,2                ## @PCI_IO_BASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"  bridge window %pR\n"

	.comm	_PCI_IO_BASE_UPPER16,4,2        ## @PCI_IO_BASE_UPPER16
	.no_dead_strip	_pci_setup_bridge_io
.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_io
_pci_setup_bridge_io:                   ; @pci_setup_bridge_io
	.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
Lloh0:
	adrp	x8, _PCI_IO_RANGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_IO_RANGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
Lloh3:
	adrp	x8, _PCI_IO_1K_RANGE_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_IO_1K_RANGE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	ldp	x8, x24, [x0, #8]
Lloh6:
	adrp	x9, _PCI_BRIDGE_RESOURCES@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PCI_BRIDGE_RESOURCES@GOTPAGEOFF]
Lloh8:
	ldrsw	x9, [x9]
	add	x20, x8, x9, lsl #2
	ldr	w0, [x0]
	add	x1, sp, #8
	mov	x2, x20
	bl	_pcibios_resource_to_bus
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _IORESOURCE_IO@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IORESOURCE_IO@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x22, _PCI_IO_BASE@GOTPAGE
Lloh13:
	ldr	x22, [x22, _PCI_IO_BASE@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w1, [x22]
	add	x2, sp, #4
	mov	x0, x19
	bl	_pci_read_config_word
	cmp	x24, #0
	csel	w8, w21, w23, eq
	ldp	w9, w10, [sp, #8]
	and	w11, w8, w9, asr #8
	and	w8, w10, w8, lsl #8
	orr	w8, w8, w11
	str	w8, [sp, #4]
	and	w8, w10, #0xffff0000
	orr	w21, w8, w9, asr #16
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_pci_info
	b	LBB0_3
LBB0_2:
	mov	w21, #0
	mov	w8, #240
	str	w8, [sp, #4]
LBB0_3:
Lloh16:
	adrp	x20, _PCI_IO_BASE_UPPER16@GOTPAGE
Lloh17:
	ldr	x20, [x20, _PCI_IO_BASE_UPPER16@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #65535
	bl	_pci_write_config_dword
	ldr	w1, [x22]
	ldr	w2, [sp, #4]
	mov	x0, x19
	bl	_pci_write_config_word
	ldr	w1, [x20]
	mov	x0, x19
	mov	x2, x21
	bl	_pci_write_config_dword
	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	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_IO_RANGE_MASK,8,3          ; @PCI_IO_RANGE_MASK
	.comm	_PCI_IO_1K_RANGE_MASK,8,3       ; @PCI_IO_1K_RANGE_MASK
	.comm	_PCI_BRIDGE_RESOURCES,4,2       ; @PCI_BRIDGE_RESOURCES
	.comm	_IORESOURCE_IO,4,2              ; @IORESOURCE_IO
	.comm	_PCI_IO_BASE,4,2                ; @PCI_IO_BASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"  bridge window %pR\n"

	.comm	_PCI_IO_BASE_UPPER16,4,2        ; @PCI_IO_BASE_UPPER16
	.no_dead_strip	_pci_setup_bridge_io
.subsections_via_symbols
