	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpphy_rx_iq_cal
_lpphy_rx_iq_cal:                       ## @lpphy_rx_iq_cal
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%r8d, %r13d
	movl	%ecx, %r14d
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	24(%rbx), %rax
	cmpl	$21332, (%rax)                  ## imm = 0x5354
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	%r13d, -68(%rbp)                ## 4-byte Spill
	movl	%r14d, -64(%rbp)                ## 4-byte Spill
	jne	LBB0_4
## %bb.1:
	movq	_lpphy_5354_iq_table@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_10
## %bb.2:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	(%rdi,%r13), %rax
	cmpq	(%r12), %rax
	leaq	(%rdi,%r13), %rax
	cmoveq	%rax, %r15
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	addq	$16, %r13
	cmpq	%rax, %rbx
	jl	LBB0_3
	jmp	LBB0_11
LBB0_4:
	cmpl	$1, 8(%rbx)
	jle	LBB0_6
## %bb.5:
	movq	_lpphy_rev2plus_iq_comp@GOTPCREL(%rip), %r15
	jmp	LBB0_11
LBB0_6:
	movq	_lpphy_rev0_1_iq_table@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_10
## %bb.7:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	(%rdi,%rbx), %rax
	cmpq	(%r12), %rax
	leaq	(%rdi,%rbx), %rax
	cmoveq	%rax, %r15
	incq	%r13
	callq	_ARRAY_SIZE
	cltq
	addq	$16, %rbx
	cmpq	%rax, %r13
	jl	LBB0_8
	jmp	LBB0_11
LBB0_10:
	xorl	%r15d, %r15d
LBB0_11:
	xorl	%edi, %edi
	testq	%r15, %r15
	sete	%dil
	callq	_B43_WARN_ON
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_25
## %bb.12:
	movq	_B43_LPPHY_RX_COMP_COEFF_S@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	8(%r15), %ecx
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	$65280, %edx                    ## imm = 0xFF00
	callq	_b43_phy_maskset
	movl	(%rbx), %esi
	movl	12(%r15), %ecx
	shll	$8, %ecx
	movq	%r12, %rdi
	movl	$255, %edx
	callq	_b43_phy_maskset
	xorl	%eax, %eax
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	testl	%r13d, %r13d
	movl	-68(%rbp), %r15d                ## 4-byte Reload
	cmovnel	%eax, %r15d
	movl	-64(%rbp), %edx                 ## 4-byte Reload
	cmovnel	%eax, %edx
	movl	$1, %esi
	cmovel	-60(%rbp), %esi                 ## 4-byte Folded Reload
	movq	%r12, %rdi
	callq	_lpphy_set_trsw_over
	movl	(%r12), %edi
	callq	_b43_current_band
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%bl
	movq	_B43_LPPHY_RF_OVERRIDE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %eax
	movl	$32, %edx
	cmovel	%eax, %edx
	movl	$65527, %eax                    ## imm = 0xFFF7
	movl	$65503, %r14d                   ## imm = 0xFFDF
	cmovel	%eax, %r14d
	movq	%r12, %rdi
	callq	_b43_phy_set
	movq	_B43_LPPHY_RF_OVERRIDE_VAL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addb	%bl, %bl
	addb	$3, %bl
	movl	%ebx, %ecx
	shll	%cl, %r15d
	movq	%r12, %rdi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	callq	_b43_phy_maskset
	movq	_B43_LPPHY_AFE_CTL_OVR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_b43_phy_read
	movl	%eax, %r15d
	testl	%r13d, %r13d
	je	LBB0_14
## %bb.13:
	movq	%r12, %rdi
	movl	$11613, %esi                    ## imm = 0x2D5D
	callq	_lpphy_set_rx_gain
	jmp	LBB0_17
LBB0_14:
	testb	$64, %r15b
	je	LBB0_16
## %bb.15:
	movq	%r12, %rdi
	callq	_lpphy_get_tx_gains
	movl	%eax, -48(%rbp)
LBB0_16:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	leaq	-56(%rbp), %rcx
	cmovneq	%rax, %rcx
	movl	(%rcx), %esi
	movq	%r12, %rdi
	callq	_lpphy_set_tx_gains
LBB0_17:
	movq	_B43_LPPHY_RF_OVERRIDE_0@GOTPCREL(%rip), %rbx
	movl	(%r14), %esi
	movq	%r12, %rdi
	movl	$65534, %edx                    ## imm = 0xFFFE
	callq	_b43_phy_mask
	movq	_B43_LPPHY_AFE_CTL_OVRVAL@GOTPCREL(%rip), %rax
	movq	%rax, %r13
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$65534, %edx                    ## imm = 0xFFFE
	callq	_b43_phy_mask
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_b43_phy_set
	movq	_B43_LPPHY_RF_OVERRIDE_VAL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_b43_phy_set
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_lpphy_set_deaf
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_19
## %bb.18:
	movq	%r12, %rdi
	movl	$65520, %esi                    ## imm = 0xFFF0
	callq	_lpphy_calc_rx_iq_comp
	movl	%eax, %r14d
	jmp	LBB0_20
LBB0_19:
	movq	%r12, %rdi
	movl	$4000, %esi                     ## imm = 0xFA0
	movl	$100, %edx
	callq	_lpphy_start_tx_tone
	movq	%r12, %rdi
	movl	$16384, %esi                    ## imm = 0x4000
	callq	_lpphy_calc_rx_iq_comp
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_lpphy_stop_tx_tone
LBB0_20:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_lpphy_clear_deaf
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$65532, %edx                    ## imm = 0xFFFC
	callq	_b43_phy_mask
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$65527, %edx                    ## imm = 0xFFF7
	callq	_b43_phy_mask
	movl	(%rbx), %esi
	movq	%r12, %rdi
	movl	$65503, %edx                    ## imm = 0xFFDF
	callq	_b43_phy_mask
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_24
## %bb.21:
	testb	$64, %r15b
	jne	LBB0_23
## %bb.22:
	movq	%r12, %rdi
	callq	_lpphy_disable_tx_gain_override
	jmp	LBB0_24
LBB0_23:
	movl	-48(%rbp), %esi
	movq	%r12, %rdi
	callq	_lpphy_set_tx_gains
LBB0_24:
	movq	%r12, %rdi
	callq	_lpphy_disable_rx_gain_override
	movq	_B43_LPPHY_AFE_CTL_OVR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$65534, %edx                    ## imm = 0xFFFE
	callq	_b43_phy_mask
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	$63487, %edx                    ## imm = 0xF7FF
	callq	_b43_phy_mask
LBB0_25:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_lpphy_5354_iq_table,8,3        ## @lpphy_5354_iq_table
	.comm	_lpphy_rev2plus_iq_comp,16,3    ## @lpphy_rev2plus_iq_comp
	.comm	_lpphy_rev0_1_iq_table,8,3      ## @lpphy_rev0_1_iq_table
	.comm	_B43_LPPHY_RX_COMP_COEFF_S,4,2  ## @B43_LPPHY_RX_COMP_COEFF_S
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.comm	_B43_LPPHY_RF_OVERRIDE_0,4,2    ## @B43_LPPHY_RF_OVERRIDE_0
	.comm	_B43_LPPHY_RF_OVERRIDE_VAL_0,4,2 ## @B43_LPPHY_RF_OVERRIDE_VAL_0
	.comm	_B43_LPPHY_AFE_CTL_OVR,4,2      ## @B43_LPPHY_AFE_CTL_OVR
	.comm	_B43_LPPHY_AFE_CTL_OVRVAL,4,2   ## @B43_LPPHY_AFE_CTL_OVRVAL
	.no_dead_strip	_lpphy_rx_iq_cal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpphy_rx_iq_cal
_lpphy_rx_iq_cal:                       ; @lpphy_rx_iq_cal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x5
	mov	x24, x4
	mov	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x25, [x0, #16]
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
	mov	w9, #21332
	cmp	w8, w9
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	b.ne	LBB0_4
; %bb.1:
Lloh0:
	adrp	x27, _lpphy_5354_iq_table@GOTPAGE
Lloh1:
	ldr	x27, [x27, _lpphy_5354_iq_table@GOTPAGEOFF]
	ldr	x0, [x27]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.2:
	mov	x28, #0
	mov	x21, #0
	mov	x26, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x27]
	add	x8, x0, x28
	ldr	x9, [x8]
	ldr	x10, [x25]
	cmp	x9, x10
	csel	x26, x8, x26, eq
	add	x21, x21, #1
	bl	_ARRAY_SIZE
	add	x28, x28, #16
	cmp	x21, w0, sxtw
	b.lt	LBB0_3
	b	LBB0_10
LBB0_4:
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.le	LBB0_6
; %bb.5:
Lloh2:
	adrp	x26, _lpphy_rev2plus_iq_comp@GOTPAGE
Lloh3:
	ldr	x26, [x26, _lpphy_rev2plus_iq_comp@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
Lloh4:
	adrp	x27, _lpphy_rev0_1_iq_table@GOTPAGE
Lloh5:
	ldr	x27, [x27, _lpphy_rev0_1_iq_table@GOTPAGEOFF]
	ldr	x0, [x27]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.7:
	mov	x28, #0
	mov	x21, #0
	mov	x26, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x27]
	add	x8, x0, x28
	ldr	x9, [x8]
	ldr	x10, [x25]
	cmp	x9, x10
	csel	x26, x8, x26, eq
	add	x21, x21, #1
	bl	_ARRAY_SIZE
	add	x28, x28, #16
	cmp	x21, w0, sxtw
	b.lt	LBB0_8
	b	LBB0_10
LBB0_9:
	mov	x26, #0
LBB0_10:
	cmp	x26, #0
	cset	w0, eq
	bl	_B43_WARN_ON
	cbz	x0, LBB0_12
; %bb.11:
	mov	w21, #0
	b	LBB0_25
LBB0_12:
Lloh6:
	adrp	x21, _B43_LPPHY_RX_COMP_COEFF_S@GOTPAGE
Lloh7:
	ldr	x21, [x21, _B43_LPPHY_RX_COMP_COEFF_S@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	w3, [x26, #8]
	mov	x0, x19
	mov	w2, #65280
	bl	_b43_phy_maskset
	ldr	w1, [x21]
	ldr	w8, [x26, #12]
	lsl	w3, w8, #8
	mov	x0, x19
	mov	w2, #255
	bl	_b43_phy_maskset
	cmp	w20, #0
	csel	w21, w24, wzr, eq
	csel	w2, w23, wzr, eq
	csinc	w1, w22, wzr, eq
	mov	x0, x19
	bl	_lpphy_set_trsw_over
	ldr	w0, [x19]
	bl	_b43_current_band
Lloh8:
	adrp	x8, _NL80211_BAND_2GHZ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh10:
	adrp	x24, _B43_LPPHY_RF_OVERRIDE_0@GOTPAGE
Lloh11:
	ldr	x24, [x24, _B43_LPPHY_RF_OVERRIDE_0@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	mov	w8, #32
	ldr	w1, [x24]
	mov	w9, #8
	csel	w2, w9, w8, eq
	mov	w8, #5
	mov	w9, #3
	csel	w23, w9, w8, eq
	mov	w8, #65503
	mov	w9, #65527
	csel	w22, w9, w8, eq
	mov	x0, x19
	bl	_b43_phy_set
Lloh13:
	adrp	x26, _B43_LPPHY_RF_OVERRIDE_VAL_0@GOTPAGE
Lloh14:
	ldr	x26, [x26, _B43_LPPHY_RF_OVERRIDE_VAL_0@GOTPAGEOFF]
	ldr	w1, [x26]
	lsl	w3, w21, w23
	mov	x0, x19
	mov	x2, x22
	bl	_b43_phy_maskset
Lloh15:
	adrp	x23, _B43_LPPHY_AFE_CTL_OVR@GOTPAGE
Lloh16:
	ldr	x23, [x23, _B43_LPPHY_AFE_CTL_OVR@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_b43_phy_read
	mov	x22, x0
	cbz	w20, LBB0_14
; %bb.13:
	mov	x0, x19
	mov	w1, #11613
	bl	_lpphy_set_rx_gain
	b	LBB0_17
LBB0_14:
	tbz	w22, #6, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_lpphy_get_tx_gains
	str	w0, [sp, #16]
LBB0_16:
	add	x8, sp, #24
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	cmp	x9, #0
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	mov	x0, x19
	bl	_lpphy_set_tx_gains
LBB0_17:
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #65534
	bl	_b43_phy_mask
Lloh17:
	adrp	x25, _B43_LPPHY_AFE_CTL_OVRVAL@GOTPAGE
Lloh18:
	ldr	x25, [x25, _B43_LPPHY_AFE_CTL_OVRVAL@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	mov	w2, #65534
	bl	_b43_phy_mask
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #2048
	bl	_b43_phy_set
	ldr	w1, [x26]
	mov	x0, x19
	mov	w2, #2048
	bl	_b43_phy_set
	mov	x0, x19
	mov	w1, #0
	bl	_lpphy_set_deaf
	mov	x0, x19
	cbz	w20, LBB0_19
; %bb.18:
	mov	w1, #65520
	bl	_lpphy_calc_rx_iq_comp
	mov	x21, x0
	b	LBB0_20
LBB0_19:
	mov	w1, #4000
	mov	w2, #100
	bl	_lpphy_start_tx_tone
	mov	x0, x19
	mov	w1, #16384
	bl	_lpphy_calc_rx_iq_comp
	mov	x21, x0
	mov	x0, x19
	bl	_lpphy_stop_tx_tone
LBB0_20:
	mov	x0, x19
	mov	w1, #0
	bl	_lpphy_clear_deaf
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #65532
	bl	_b43_phy_mask
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #65527
	bl	_b43_phy_mask
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #65503
	bl	_b43_phy_mask
	cbnz	w20, LBB0_24
; %bb.21:
	tbnz	w22, #6, LBB0_23
; %bb.22:
	mov	x0, x19
	bl	_lpphy_disable_tx_gain_override
	b	LBB0_24
LBB0_23:
	ldr	w1, [sp, #16]
	mov	x0, x19
	bl	_lpphy_set_tx_gains
LBB0_24:
	mov	x0, x19
	bl	_lpphy_disable_rx_gain_override
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #65534
	bl	_b43_phy_mask
	ldr	w1, [x25]
	mov	x0, x19
	mov	w2, #63487
	bl	_b43_phy_mask
LBB0_25:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_lpphy_5354_iq_table,8,3        ; @lpphy_5354_iq_table
	.comm	_lpphy_rev2plus_iq_comp,16,3    ; @lpphy_rev2plus_iq_comp
	.comm	_lpphy_rev0_1_iq_table,8,3      ; @lpphy_rev0_1_iq_table
	.comm	_B43_LPPHY_RX_COMP_COEFF_S,4,2  ; @B43_LPPHY_RX_COMP_COEFF_S
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.comm	_B43_LPPHY_RF_OVERRIDE_0,4,2    ; @B43_LPPHY_RF_OVERRIDE_0
	.comm	_B43_LPPHY_RF_OVERRIDE_VAL_0,4,2 ; @B43_LPPHY_RF_OVERRIDE_VAL_0
	.comm	_B43_LPPHY_AFE_CTL_OVR,4,2      ; @B43_LPPHY_AFE_CTL_OVR
	.comm	_B43_LPPHY_AFE_CTL_OVRVAL,4,2   ; @B43_LPPHY_AFE_CTL_OVRVAL
	.no_dead_strip	_lpphy_rx_iq_cal
.subsections_via_symbols
