	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcma_sprom_get                 ## -- Begin function bcma_sprom_get
	.p2align	4, 0x90
_bcma_sprom_get:                        ## @bcma_sprom_get
	.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
	cmpl	$0, 4(%rdi)
	je	LBB0_1
## %bb.3:
	movq	%rdi, %rbx
	movq	_BCMA_CC_SPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	callq	_bcma_sprom_ext_available
	testl	%eax, %eax
	je	LBB0_4
LBB0_6:
	movq	_SSB_SPROMSIZE_WORDS_R4@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r14
	leaq	4(%rbx), %r12
	movq	8(%rbx), %rax
	movq	_BCMA_CHIP_ID_BCM4331@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	je	LBB0_10
## %bb.9:
	movq	_BCMA_CHIP_ID_BCM43431@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
LBB0_10:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_bcma_chipco_bcm4331_ext_pa_lines_ctl
LBB0_11:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_bcma_debug
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	_bcma_sprom_read
	movq	8(%rbx), %rax
	cmpq	(%r13), %rax
	je	LBB0_13
## %bb.12:
	movq	_BCMA_CHIP_ID_BCM43431@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
LBB0_13:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_bcma_chipco_bcm4331_ext_pa_lines_ctl
LBB0_14:
	movq	%r14, %rdi
	callq	_bcma_sprom_valid
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_bcma_warn
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	callq	_bcma_fill_sprom_with_fallback
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	%rbx, %rdi
	callq	_bcma_sprom_onchip_available
	testl	%eax, %eax
	je	LBB0_19
## %bb.5:
	movq	%rbx, %rdi
	callq	_bcma_sprom_onchip_offset
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
LBB0_19:
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bcma_fill_sprom_with_fallback  ## TAILCALL
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_18
LBB0_16:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_bcma_sprom_extract_r8
	xorl	%ebx, %ebx
LBB0_17:
	movq	%r14, %rdi
	callq	_kfree
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_CC_SPROM,4,2              ## @BCMA_CC_SPROM
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_SSB_SPROMSIZE_WORDS_R4,4,2     ## @SSB_SPROMSIZE_WORDS_R4
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BCMA_CHIP_ID_BCM4331,8,3       ## @BCMA_CHIP_ID_BCM4331
	.comm	_BCMA_CHIP_ID_BCM43431,8,3      ## @BCMA_CHIP_ID_BCM43431
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SPROM offset 0x%x\n"

L_.str.1:                               ## @.str.1
	.asciz	"invalid sprom read from the PCIe card, try to use fallback sprom\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcma_sprom_get                 ; -- Begin function bcma_sprom_get
	.p2align	2
_bcma_sprom_get:                        ; @bcma_sprom_get
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldr	w8, [x20, #4]!
	cbz	w8, LBB0_9
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _BCMA_CC_SPROM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BCMA_CC_SPROM@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	bl	_bcma_sprom_ext_available
	cbz	w0, LBB0_10
LBB0_2:
Lloh3:
	adrp	x8, _SSB_SPROMSIZE_WORDS_R4@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SSB_SPROMSIZE_WORDS_R4@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kcalloc
	cbz	x0, LBB0_13
; %bb.3:
	mov	x21, x0
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x23, _BCMA_CHIP_ID_BCM4331@GOTPAGE
Lloh10:
	ldr	x23, [x23, _BCMA_CHIP_ID_BCM4331@GOTPAGEOFF]
	ldr	x9, [x23]
Lloh11:
	adrp	x24, _BCMA_CHIP_ID_BCM43431@GOTPAGE
Lloh12:
	ldr	x24, [x24, _BCMA_CHIP_ID_BCM43431@GOTPAGEOFF]
	ldr	x10, [x24]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x20
	mov	w1, #0
	bl	_bcma_chipco_bcm4331_ext_pa_lines_ctl
LBB0_5:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	bl	_bcma_debug
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_bcma_sprom_read
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	ldr	x10, [x24]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	mov	w1, #1
	bl	_bcma_chipco_bcm4331_ext_pa_lines_ctl
LBB0_7:
	mov	x0, x21
	bl	_bcma_sprom_valid
	cbz	w0, LBB0_15
; %bb.8:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_bcma_warn
	mov	x0, x19
	mov	x1, x19
	bl	_bcma_fill_sprom_with_fallback
	mov	x19, x0
	b	LBB0_16
LBB0_9:
Lloh17:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_14
LBB0_10:
	mov	x0, x19
	bl	_bcma_sprom_onchip_available
	cbz	w0, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_bcma_sprom_onchip_offset
	mov	x22, x0
	cbnz	w0, LBB0_2
LBB0_12:
	mov	x0, x19
	mov	x1, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_bcma_fill_sprom_with_fallback
LBB0_13:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_17
LBB0_15:
	mov	x0, x19
	mov	x1, x21
	bl	_bcma_sprom_extract_r8
	mov	w19, #0
LBB0_16:
	mov	x0, x21
	bl	_kfree
LBB0_17:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_CC_SPROM,4,2              ; @BCMA_CC_SPROM
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_SSB_SPROMSIZE_WORDS_R4,4,2     ; @SSB_SPROMSIZE_WORDS_R4
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BCMA_CHIP_ID_BCM4331,8,3       ; @BCMA_CHIP_ID_BCM4331
	.comm	_BCMA_CHIP_ID_BCM43431,8,3      ; @BCMA_CHIP_ID_BCM43431
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SPROM offset 0x%x\n"

l_.str.1:                               ; @.str.1
	.asciz	"invalid sprom read from the PCIe card, try to use fallback sprom\n"

.subsections_via_symbols
