	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcma_core_pci_enable_crs
_bcma_core_pci_enable_crs:              ## @bcma_core_pci_enable_crs
	.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	%rdi, %r15
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_PCI_CAP_ID_EXP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_bcma_find_pci_capability
	movl	%eax, %ebx
	movq	_PCI_EXP_RTCAP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	%ebx, %ecx
	leaq	-44(%rbp), %r8
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$4, %r9d
	callq	_bcma_extpci_read_config
	movq	_BCMA_CORE_PCI_RC_CRS_VISIBILITY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_9
## %bb.1:
	movq	_PCI_EXP_RTCTL@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movq	_PCI_EXP_RTCTL_CRSSVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	leaq	-44(%rbp), %r8
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	movl	$4, %r9d
	callq	_bcma_extpci_read_config
	movq	_BCMA_PCI_SLOT_MAX@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jl	LBB0_9
## %bb.2:
	movl	$1, %ebx
	movq	_PCI_VENDOR_ID@GOTPCREL(%rip), %r14
	leaq	-44(%rbp), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	movq	_BCMA_PCI_SLOT_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_9
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	$100000, %r13d                  ## imm = 0x186A0
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r14), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	movq	%r12, %r8
	movl	$4, %r9d
	callq	_bcma_extpci_read_config
	cmpl	$1, -44(%rbp)
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$10, %edi
	callq	_udelay
	decl	%r13d
	jne	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$1, -44(%rbp)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_bcma_err
	jmp	LBB0_8
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CAP_ID_EXP,4,2             ## @PCI_CAP_ID_EXP
	.comm	_PCI_EXP_RTCAP,4,2              ## @PCI_EXP_RTCAP
	.comm	_BCMA_CORE_PCI_RC_CRS_VISIBILITY,4,2 ## @BCMA_CORE_PCI_RC_CRS_VISIBILITY
	.comm	_PCI_EXP_RTCTL,4,2              ## @PCI_EXP_RTCTL
	.comm	_PCI_EXP_RTCTL_CRSSVE,4,2       ## @PCI_EXP_RTCTL_CRSSVE
	.comm	_BCMA_PCI_SLOT_MAX,4,2          ## @BCMA_PCI_SLOT_MAX
	.comm	_PCI_VENDOR_ID,4,2              ## @PCI_VENDOR_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PCI: Broken device in slot %d\n"

	.no_dead_strip	_bcma_core_pci_enable_crs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcma_core_pci_enable_crs
_bcma_core_pci_enable_crs:              ; @bcma_core_pci_enable_crs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x20, [x8]
Lloh0:
	adrp	x8, _PCI_CAP_ID_EXP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_CAP_ID_EXP@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	w1, #0
	mov	w2, #0
	mov	x4, #0
	mov	x5, #0
	bl	_bcma_find_pci_capability
	mov	x21, x0
Lloh3:
	adrp	x8, _PCI_EXP_RTCAP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_EXP_RTCAP@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w3, w8, w0
	add	x4, sp, #12
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w5, #4
	bl	_bcma_extpci_read_config
	ldr	w8, [sp, #12]
Lloh6:
	adrp	x9, _BCMA_CORE_PCI_RC_CRS_VISIBILITY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BCMA_CORE_PCI_RC_CRS_VISIBILITY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.1:
Lloh9:
	adrp	x8, _PCI_EXP_RTCTL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_EXP_RTCTL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	add	w3, w8, w21
Lloh12:
	adrp	x8, _PCI_EXP_RTCTL_CRSSVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PCI_EXP_RTCTL_CRSSVE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	add	x4, sp, #12
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w5, #4
	bl	_bcma_extpci_read_config
Lloh15:
	adrp	x23, _BCMA_PCI_SLOT_MAX@GOTPAGE
Lloh16:
	ldr	x23, [x23, _BCMA_PCI_SLOT_MAX@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #2
	b.lt	LBB0_9
; %bb.2:
	mov	w21, #1
Lloh17:
	adrp	x24, _PCI_VENDOR_ID@GOTPAGE
Lloh18:
	ldr	x24, [x24, _PCI_VENDOR_ID@GOTPAGEOFF]
Lloh19:
	adrp	x22, l_.str@PAGE
Lloh20:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
	ldr	w8, [x23]
	cmp	w21, w8
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	mov	w25, #34464
	movk	w25, #1, lsl #16
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w3, [x24]
	add	x4, sp, #12
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	mov	w5, #4
	bl	_bcma_extpci_read_config
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w0, #10
	bl	_udelay
	subs	w25, w25, #1
	b.ne	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.ne	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_bcma_err
	b	LBB0_3
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CAP_ID_EXP,4,2             ; @PCI_CAP_ID_EXP
	.comm	_PCI_EXP_RTCAP,4,2              ; @PCI_EXP_RTCAP
	.comm	_BCMA_CORE_PCI_RC_CRS_VISIBILITY,4,2 ; @BCMA_CORE_PCI_RC_CRS_VISIBILITY
	.comm	_PCI_EXP_RTCTL,4,2              ; @PCI_EXP_RTCTL
	.comm	_PCI_EXP_RTCTL_CRSSVE,4,2       ; @PCI_EXP_RTCTL_CRSSVE
	.comm	_BCMA_PCI_SLOT_MAX,4,2          ; @BCMA_PCI_SLOT_MAX
	.comm	_PCI_VENDOR_ID,4,2              ; @PCI_VENDOR_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PCI: Broken device in slot %d\n"

	.no_dead_strip	_bcma_core_pci_enable_crs
.subsections_via_symbols
