	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcma_get_cfgspace_addr
_bcma_get_cfgspace_addr:                ## @bcma_get_cfgspace_addr
	.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
	xorl	%r13d, %r13d
	cmpl	$1, %esi
	ja	LBB0_3
## %bb.1:
	movl	%ecx, %ebx
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_BCMA_CORE_PCI_DLLP_LSREG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bcma_pcie_read
	movq	_BCMA_CORE_PCI_DLLP_LSREG_LINKUP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.2:
	movq	_BCMA_CORE_PCI_SBTOPCI1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCMA_CORE_PCI_SBTOPCI_CFG0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_pcicore_write32
	movq	_BCMA_CORE_PCI_CFG_SLOT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r15d
	movq	(%r12), %rax
	movq	_BCMA_CORE_PCI_CFG_FUN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r14d
	andl	$-4, %ebx
	orl	(%rax), %ebx
	orl	%r15d, %ebx
	orl	%r14d, %ebx
	movl	%ebx, %r13d
LBB0_3:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_CORE_PCI_DLLP_LSREG,4,2   ## @BCMA_CORE_PCI_DLLP_LSREG
	.comm	_BCMA_CORE_PCI_DLLP_LSREG_LINKUP,4,2 ## @BCMA_CORE_PCI_DLLP_LSREG_LINKUP
	.comm	_BCMA_CORE_PCI_SBTOPCI1,4,2     ## @BCMA_CORE_PCI_SBTOPCI1
	.comm	_BCMA_CORE_PCI_SBTOPCI_CFG0,4,2 ## @BCMA_CORE_PCI_SBTOPCI_CFG0
	.comm	_BCMA_CORE_PCI_CFG_SLOT_SHIFT,4,2 ## @BCMA_CORE_PCI_CFG_SLOT_SHIFT
	.comm	_BCMA_CORE_PCI_CFG_FUN_SHIFT,4,2 ## @BCMA_CORE_PCI_CFG_FUN_SHIFT
	.no_dead_strip	_bcma_get_cfgspace_addr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcma_get_cfgspace_addr
_bcma_get_cfgspace_addr:                ; @bcma_get_cfgspace_addr
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cmp	w1, #1
	b.hi	LBB0_3
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _BCMA_CORE_PCI_DLLP_LSREG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BCMA_CORE_PCI_DLLP_LSREG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_bcma_pcie_read
Lloh3:
	adrp	x8, _BCMA_CORE_PCI_DLLP_LSREG_LINKUP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BCMA_CORE_PCI_DLLP_LSREG_LINKUP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _BCMA_CORE_PCI_SBTOPCI1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BCMA_CORE_PCI_SBTOPCI1@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _BCMA_CORE_PCI_SBTOPCI_CFG0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BCMA_CORE_PCI_SBTOPCI_CFG0@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_pcicore_write32
	ldr	x8, [x22]
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _BCMA_CORE_PCI_CFG_SLOT_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _BCMA_CORE_PCI_CFG_SLOT_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsl	w9, w21, w9
Lloh15:
	adrp	x10, _BCMA_CORE_PCI_CFG_FUN_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _BCMA_CORE_PCI_CFG_FUN_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	lsl	w10, w20, w10
	and	w11, w19, #0xfffffffc
	orr	w8, w8, w11
	orr	w8, w8, w9
	orr	w0, w8, w10
	b	LBB0_4
LBB0_3:
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_CORE_PCI_DLLP_LSREG,4,2   ; @BCMA_CORE_PCI_DLLP_LSREG
	.comm	_BCMA_CORE_PCI_DLLP_LSREG_LINKUP,4,2 ; @BCMA_CORE_PCI_DLLP_LSREG_LINKUP
	.comm	_BCMA_CORE_PCI_SBTOPCI1,4,2     ; @BCMA_CORE_PCI_SBTOPCI1
	.comm	_BCMA_CORE_PCI_SBTOPCI_CFG0,4,2 ; @BCMA_CORE_PCI_SBTOPCI_CFG0
	.comm	_BCMA_CORE_PCI_CFG_SLOT_SHIFT,4,2 ; @BCMA_CORE_PCI_CFG_SLOT_SHIFT
	.comm	_BCMA_CORE_PCI_CFG_FUN_SHIFT,4,2 ; @BCMA_CORE_PCI_CFG_FUN_SHIFT
	.no_dead_strip	_bcma_get_cfgspace_addr
.subsections_via_symbols
