	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function b43_phy_init_pctl
_b43_phy_init_pctl:                     ## @b43_phy_init_pctl
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	48(%rdi), %r12
	movq	16(%rdi), %rax
	movq	_B43_PHYTYPE_G@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_B43_WARN_ON
	movq	8(%r15), %rax
	movq	(%rax), %rcx
	movq	_SSB_BOARDVENDOR_BCM@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_2
## %bb.1:
	movq	8(%rax), %rax
	movq	_SSB_BOARD_BU4306@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_16
LBB0_2:
	movq	%r15, %rdi
	movl	$40, %esi
	movl	$32792, %edx                    ## imm = 0x8018
	callq	_b43_phy_write
	movq	_B43_MMIO_PHY0@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_b43_read16
	andl	$65503, %eax                    ## imm = 0xFFDF
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_b43_write16
	cmpl	$0, 44(%r15)
	je	LBB0_16
## %bb.3:
	movq	%r15, %rdi
	callq	_b43_hardware_pctl_early_init
	cmpq	$0, (%r12)
	jne	LBB0_15
## %bb.4:
	cmpl	$8272, 24(%r15)                 ## imm = 0x2050
	jne	LBB0_7
## %bb.5:
	cmpq	$0, 32(%r15)
	je	LBB0_6
LBB0_7:
	leaq	28(%r12), %rsi
	leaq	-64(%rbp), %rdi
	movl	$8, %edx
	callq	_memcpy
	leaq	24(%r12), %rsi
	leaq	-56(%rbp), %rdi
	movl	$8, %edx
	callq	_memcpy
	movq	16(%r12), %r14
	movl	$11, -48(%rbp)
	xorl	%eax, %eax
	cmpl	$8, 40(%r15)
	sete	%al
	movl	$15, %ecx
	movl	$9, %edx
	cmovel	%ecx, %edx
	movl	%edx, -40(%rbp)
	movl	%eax, -36(%rbp)
	leaq	-48(%rbp), %rsi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	_b43_set_txpower_g
	jmp	LBB0_8
LBB0_6:
	movq	%r15, %rdi
	movl	$118, %esi
	movl	$247, %edx
	movl	$132, %ecx
	callq	_b43_radio_maskset
	xorl	%r14d, %r14d
LBB0_8:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	callq	_b43_dummy_transmission
	movq	_B43_PHY_ITSSI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_b43_phy_read
	movq	%rax, (%r12)
	movq	_B43_DEBUG@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_11
## %bb.9:
	subq	8(%r12), %rax
	movq	%rax, %rdi
	callq	_abs
	cmpl	$20, %eax
	jl	LBB0_11
## %bb.10:
	movl	(%r15), %edi
	movq	(%r12), %rdx
	movq	8(%r12), %rcx
	leaq	L_.str(%rip), %rsi
	callq	_b43dbg
	movq	$0, (%r12)
LBB0_11:
	cmpl	$8272, 24(%r15)                 ## imm = 0x2050
	jne	LBB0_14
## %bb.12:
	cmpq	$0, 32(%r15)
	je	LBB0_13
LBB0_14:
	leaq	-56(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rcx
	callq	_b43_set_txpower_g
	jmp	LBB0_15
LBB0_13:
	movq	%r15, %rdi
	movl	$118, %esi
	movl	$65403, %edx                    ## imm = 0xFF7B
	callq	_b43_radio_mask
LBB0_15:
	movq	%r15, %rdi
	callq	_b43_hardware_pctl_init_gphy
	movq	%r15, %rdi
	callq	_b43_shm_clear_tssi
LBB0_16:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_B43_PHYTYPE_G,8,3              ## @B43_PHYTYPE_G
	.comm	_SSB_BOARDVENDOR_BCM,8,3        ## @SSB_BOARDVENDOR_BCM
	.comm	_SSB_BOARD_BU4306,8,3           ## @SSB_BOARD_BU4306
	.comm	_B43_MMIO_PHY0,4,2              ## @B43_MMIO_PHY0
	.comm	_B43_PHY_ITSSI,4,2              ## @B43_PHY_ITSSI
	.comm	_B43_DEBUG,8,3                  ## @B43_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"!WARNING! Idle-TSSI phy->cur_idle_tssi measuring failed. (cur=%d, tgt=%d). Disabling TX power adjustment.\n"

	.no_dead_strip	_b43_phy_init_pctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function b43_phy_init_pctl
_b43_phy_init_pctl:                     ; @b43_phy_init_pctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	ldr	x21, [x0, #48]
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x9, _B43_PHYTYPE_G@GOTPAGE
Lloh1:
	ldr	x9, [x9, _B43_PHYTYPE_G@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_B43_WARN_ON
	ldr	x8, [x19, #8]
	ldr	x9, [x8]
Lloh3:
	adrp	x10, _SSB_BOARDVENDOR_BCM@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SSB_BOARDVENDOR_BCM@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x8, #8]
Lloh6:
	adrp	x9, _SSB_BOARD_BU4306@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SSB_BOARD_BU4306@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_16
LBB0_2:
	mov	x0, x19
	mov	w1, #40
	mov	w2, #32792
	bl	_b43_phy_write
Lloh9:
	adrp	x8, _B43_MMIO_PHY0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _B43_MMIO_PHY0@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_b43_read16
	mov	w8, #65503
	and	w2, w0, w8
	mov	x0, x19
	mov	x1, x20
	bl	_b43_write16
	ldr	w8, [x19, #44]
	cbz	w8, LBB0_16
; %bb.3:
	mov	x0, x19
	bl	_b43_hardware_pctl_early_init
	ldr	x8, [x21]
	cbnz	x8, LBB0_15
; %bb.4:
	ldr	w8, [x19, #24]
	mov	w9, #8272
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_7
LBB0_6:
	add	x1, x21, #28
	add	x0, sp, #24
	mov	w2, #8
	bl	_memcpy
	add	x1, x21, #24
	add	x0, sp, #16
	mov	w2, #8
	bl	_memcpy
	ldr	x20, [x21, #16]
	mov	w8, #11
	str	w8, [sp]
	ldr	w8, [x19, #40]
	mov	w9, #9
	mov	w10, #15
	cmp	w8, #8
	csel	w8, w10, w9, eq
	cset	w9, eq
	stp	w8, w9, [sp, #8]
	mov	x1, sp
	add	x2, sp, #8
	mov	x0, x19
	mov	x3, #0
	bl	_b43_set_txpower_g
	b	LBB0_8
LBB0_7:
	mov	x0, x19
	mov	w1, #118
	mov	w2, #247
	mov	w3, #132
	bl	_b43_radio_maskset
	mov	x20, #0
LBB0_8:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #1
	bl	_b43_dummy_transmission
Lloh12:
	adrp	x8, _B43_PHY_ITSSI@GOTPAGE
Lloh13:
	ldr	x8, [x8, _B43_PHY_ITSSI@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_b43_phy_read
	str	x0, [x21]
Lloh15:
	adrp	x8, _B43_DEBUG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _B43_DEBUG@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.9:
	ldr	x8, [x21, #8]
	sub	x0, x0, x8
	bl	_abs
	cmp	w0, #20
	b.lt	LBB0_11
; %bb.10:
	ldr	w0, [x19]
	ldp	x2, x3, [x21]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_b43dbg
	str	xzr, [x21]
LBB0_11:
	ldr	w8, [x19, #24]
	mov	w9, #8272
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.12:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_14
LBB0_13:
	add	x1, sp, #16
	add	x2, sp, #24
	mov	x0, x19
	mov	x3, x20
	bl	_b43_set_txpower_g
	b	LBB0_15
LBB0_14:
	mov	x0, x19
	mov	w1, #118
	mov	w2, #65403
	bl	_b43_radio_mask
LBB0_15:
	mov	x0, x19
	bl	_b43_hardware_pctl_init_gphy
	mov	x0, x19
	bl	_b43_shm_clear_tssi
LBB0_16:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_B43_PHYTYPE_G,8,3              ; @B43_PHYTYPE_G
	.comm	_SSB_BOARDVENDOR_BCM,8,3        ; @SSB_BOARDVENDOR_BCM
	.comm	_SSB_BOARD_BU4306,8,3           ; @SSB_BOARD_BU4306
	.comm	_B43_MMIO_PHY0,4,2              ; @B43_MMIO_PHY0
	.comm	_B43_PHY_ITSSI,4,2              ; @B43_PHY_ITSSI
	.comm	_B43_DEBUG,8,3                  ; @B43_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"!WARNING! Idle-TSSI phy->cur_idle_tssi measuring failed. (cur=%d, tgt=%d). Disabling TX power adjustment.\n"

	.no_dead_strip	_b43_phy_init_pctl
.subsections_via_symbols
