	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function b43_calc_nrssi_threshold
_b43_calc_nrssi_threshold:              ## @b43_calc_nrssi_threshold
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	24(%rdi), %r15
	movq	_B43_PHYTYPE_G@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_B43_WARN_ON
	cmpl	$0, 16(%r14)
	je	LBB0_2
## %bb.1:
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	_B43_BFL_RSSI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.6:
	movq	(%r15), %rcx
	movq	_B43_INTERFMODE_NONWLAN@GOTPCREL(%rip), %rdx
	movl	$14, %eax
	movl	$10, %r12d
	cmpq	(%rdx), %rcx
	je	LBB0_11
## %bb.7:
	cmpl	$0, 24(%r15)
	je	LBB0_8
LBB0_10:
	movl	$17, %r12d
	jmp	LBB0_11
LBB0_2:
	movq	%r14, %rdi
	movl	$32, %esi
	callq	_b43_nrssi_hw_read
                                        ## kill: def $eax killed $eax def $rax
	leal	-64(%rax), %ecx
	cmpl	$32, %eax
	cmovll	%eax, %ecx
	movq	%r14, %rdi
	movl	$1162, %esi                     ## imm = 0x48A
	movl	$61440, %edx                    ## imm = 0xF000
	cmpl	$2, %ecx
	jg	LBB0_5
## %bb.3:
	movl	$2539, %ecx                     ## imm = 0x9EB
	jmp	LBB0_4
LBB0_5:
	movl	$2797, %ecx                     ## imm = 0xAED
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_b43_phy_maskset                ## TAILCALL
LBB0_8:
	cmpq	$0, 16(%r15)
	je	LBB0_10
## %bb.9:
	movl	$19, %eax
	movl	$18, %r12d
LBB0_11:
	movq	8(%r15), %rcx
	movl	(%rcx), %edi
	movl	4(%rcx), %ecx
	subl	%edi, %ecx
	imull	%eax, %ecx
	shll	$6, %edi
	addl	%ecx, %edi
	xorl	%eax, %eax
	cmpl	$32, %edi
	setl	%al
	subl	%eax, %edi
	addl	$32, %edi
	sarl	$6, %edi
	movl	$-31, %esi
	movl	$31, %edx
	callq	_clamp_val
	movl	%eax, %ebx
	movq	8(%r15), %rax
	movl	(%rax), %edi
	movl	4(%rax), %eax
	subl	%edi, %eax
	imull	%r12d, %eax
	shll	$6, %edi
	addl	%eax, %edi
	xorl	%eax, %eax
	cmpl	$32, %edi
	setl	%al
	subl	%eax, %edi
	addl	$32, %edi
	sarl	$6, %edi
	movl	$-31, %esi
	movl	$31, %edx
	callq	_clamp_val
	movl	%eax, %r15d
	movq	%r14, %rdi
	movl	$1162, %esi                     ## imm = 0x48A
	callq	_b43_phy_read
	andl	$61440, %eax                    ## imm = 0xF000
	andl	$63, %r15d
	andl	$63, %ebx
	shll	$6, %ebx
	orl	%r15d, %ebx
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	$1162, %esi                     ## imm = 0x48A
	movl	%ebx, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_b43_phy_write                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_B43_PHYTYPE_G,8,3              ## @B43_PHYTYPE_G
	.comm	_B43_BFL_RSSI,4,2               ## @B43_BFL_RSSI
	.comm	_B43_INTERFMODE_NONWLAN,8,3     ## @B43_INTERFMODE_NONWLAN
	.no_dead_strip	_b43_calc_nrssi_threshold
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function b43_calc_nrssi_threshold
_b43_calc_nrssi_threshold:              ; @b43_calc_nrssi_threshold
	.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	x19, x0
	ldr	x21, [x0, #24]
	ldr	x8, [x0, #8]
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	w8, [x19, #16]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _B43_BFL_RSSI@GOTPAGE
Lloh4:
	ldr	x9, [x9, _B43_BFL_RSSI@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	ldr	x8, [x21]
Lloh6:
	adrp	x9, _B43_INTERFMODE_NONWLAN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _B43_INTERFMODE_NONWLAN@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	mov	w8, #14
	mov	w22, #10
	b	LBB0_12
LBB0_4:
	mov	x0, x19
	mov	w1, #32
	bl	_b43_nrssi_hw_read
	sub	w8, w0, #64
	cmp	w0, #31
	csel	w8, w8, w0, gt
	mov	x0, x19
	mov	w1, #1162
	mov	w2, #61440
	cmp	w8, #2
	b.gt	LBB0_6
; %bb.5:
	mov	w3, #2539
	b	LBB0_7
LBB0_6:
	mov	w3, #2797
LBB0_7:
	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	_b43_phy_maskset
LBB0_8:
	ldr	w8, [x21, #24]
	cbz	w8, LBB0_10
LBB0_9:
	mov	w8, #14
	mov	w22, #17
	b	LBB0_12
LBB0_10:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_9
; %bb.11:
	mov	w8, #19
	mov	w22, #18
LBB0_12:
	ldr	x9, [x21, #8]
	ldp	w9, w10, [x9]
	sub	w10, w10, w9
	mul	w8, w10, w8
	add	w8, w8, w9, lsl #6
	cmp	w8, #32
	mov	w23, #31
	cinc	w9, w23, ge
	add	w8, w9, w8
	asr	w0, w8, #6
	mov	w1, #-31
	mov	w2, #31
	bl	_clamp_val
	mov	x20, x0
	ldr	x8, [x21, #8]
	ldp	w8, w9, [x8]
	sub	w9, w9, w8
	mul	w9, w9, w22
	add	w8, w9, w8, lsl #6
	cmp	w8, #32
	cinc	w9, w23, ge
	add	w8, w9, w8
	asr	w0, w8, #6
	mov	w1, #-31
	mov	w2, #31
	bl	_clamp_val
	mov	x21, x0
	mov	x0, x19
	mov	w1, #1162
	bl	_b43_phy_read
	and	w8, w0, #0xf000
	and	w9, w21, #0x3f
	bfi	w9, w20, #6, #6
	orr	w2, w9, w8
	mov	x0, x19
	mov	w1, #1162
	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	_b43_phy_write
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_B43_PHYTYPE_G,8,3              ; @B43_PHYTYPE_G
	.comm	_B43_BFL_RSSI,4,2               ; @B43_BFL_RSSI
	.comm	_B43_INTERFMODE_NONWLAN,8,3     ; @B43_INTERFMODE_NONWLAN
	.no_dead_strip	_b43_calc_nrssi_threshold
.subsections_via_symbols
