	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcms_b_up_prep
_brcms_b_up_prep:                       ## @brcms_b_up_prep
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movl	12(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_brcms_dbg_info
	movq	_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_brcms_b_xtal
	movl	8(%rbx), %edi
	callq	_ai_clkctl_init
	movq	_BCMA_CLKMODE_FAST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_brcms_b_clkctl_clk
	movq	(%rbx), %rsi
	movl	(%rsi), %edi
	movl	$1, %edx
	callq	_bcma_host_pci_irq_ctl
	movq	%rbx, %rdi
	callq	_brcms_b_radio_read_hwdisabled
	movq	(%rbx), %rcx
	movl	(%rcx), %edi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	callq	_bcma_host_pci_down
	movq	_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_brcms_b_xtal
	movq	_ENOMEDIUM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	callq	_bcma_host_pci_up
	movq	_BRCMS_USE_COREFLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_brcms_b_corereset
	xorl	%eax, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wl%d\n"

	.comm	_ON,4,2                         ## @ON
	.comm	_BCMA_CLKMODE_FAST,4,2          ## @BCMA_CLKMODE_FAST
	.comm	_OFF,4,2                        ## @OFF
	.comm	_ENOMEDIUM,4,2                  ## @ENOMEDIUM
	.comm	_BRCMS_USE_COREFLAGS,4,2        ## @BRCMS_USE_COREFLAGS
	.no_dead_strip	_brcms_b_up_prep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcms_b_up_prep
_brcms_b_up_prep:                       ; @brcms_b_up_prep
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x0, [x0]
	ldr	w2, [x19, #12]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_brcms_dbg_info
Lloh2:
	adrp	x8, _ON@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ON@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_brcms_b_xtal
	ldr	w0, [x19, #8]
	bl	_ai_clkctl_init
Lloh5:
	adrp	x8, _BCMA_CLKMODE_FAST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BCMA_CLKMODE_FAST@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_brcms_b_clkctl_clk
	ldr	x1, [x19]
	ldr	w0, [x1]
	mov	w2, #1
	bl	_bcma_host_pci_irq_ctl
	mov	x0, x19
	bl	_brcms_b_radio_read_hwdisabled
	mov	x8, x0
	ldr	x9, [x19]
	ldr	w0, [x9]
	cbz	x8, LBB0_2
; %bb.1:
	bl	_bcma_host_pci_down
Lloh8:
	adrp	x8, _OFF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OFF@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_brcms_b_xtal
Lloh11:
	adrp	x8, _ENOMEDIUM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEDIUM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	bl	_bcma_host_pci_up
Lloh14:
	adrp	x8, _BRCMS_USE_COREFLAGS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BRCMS_USE_COREFLAGS@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_brcms_b_corereset
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wl%d\n"

	.comm	_ON,4,2                         ; @ON
	.comm	_BCMA_CLKMODE_FAST,4,2          ; @BCMA_CLKMODE_FAST
	.comm	_OFF,4,2                        ; @OFF
	.comm	_ENOMEDIUM,4,2                  ; @ENOMEDIUM
	.comm	_BRCMS_USE_COREFLAGS,4,2        ; @BRCMS_USE_COREFLAGS
	.no_dead_strip	_brcms_b_up_prep
.subsections_via_symbols
