	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9002_hw_iqcalibrate
_ar9002_hw_iqcalibrate:                 ## @ar9002_hw_iqcalibrate
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_ath9k_hw_common
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.1:
	movl	%ebx, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	cmpq	%r13, -72(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movl	(%rax,%r13,4), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	(%rcx,%r13,4), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	16(%rbx), %rax
	movl	(%rax,%r13,4), %r12d
	movq	_CALIBRATE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	leaq	L_.str(%rip), %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	(%r15), %esi
	movq	16(%rbx), %rax
	movl	(%rax,%r13,4), %r8d
	movq	%r14, %rdi
	leaq	L_.str.1(%rip), %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	xorl	%ebx, %ebx
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	cmpl	$-2147483647, %r12d             ## imm = 0x80000001
	setae	%bl
	movl	(%r15), %esi
	movq	%r14, %rdi
	leaq	L_.str.2(%rip), %rdx
	movl	%r13d, %ecx
	movl	-64(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	(%r15), %esi
	movq	%r14, %rdi
	leaq	L_.str.3(%rip), %rdx
	movl	%r13d, %ecx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	leaq	L_.str.4(%rip), %rdx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	leal	-64(%r15), %eax
	cmpl	$-128, %eax
	ja	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	testl	%edi, %edi
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %eax
	shrl	$31, %eax
	addl	%r12d, %eax
	sarl	%eax
	movl	%edi, %ecx
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	leal	(%rcx,%rax), %edx
	addl	$-128, %edx
	cmpl	$-256, %edx
	ja	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%eax, %ecx
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %eax
	negl	%eax
	cmpl	$-2147483647, %ebx              ## imm = 0x80000001
	cmovbl	%ebx, %eax
	leal	127(%rcx), %esi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %esi
	sarl	$7, %esi
	cltd
	idivl	%esi
	movl	%eax, %r8d
	movl	%eax, %r15d
	andl	$63, %r15d
	movl	$64, %r14d
	subl	%r15d, %r14d
	cmpl	$-2147483647, %ebx              ## imm = 0x80000001
	cmovael	%r15d, %r14d
	leal	63(%rdi), %ecx
	testl	%edi, %edi
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmovnsl	%edi, %ecx
	sarl	$6, %ecx
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r12d
	leal	-64(%r12), %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.5(%rip), %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.6(%rip), %rdx
	movl	%r13d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.7(%rip), %rdx
	movl	%r13d, %ecx
	movl	%r15d, %r8d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_ath_dbg
	cmpl	$49, %r12d
	movl	$-16, %eax
	cmovll	%eax, %ebx
	cmpl	$80, %r12d
	movl	$15, %eax
	cmovgel	%eax, %ebx
	movq	_CALIBRATE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.8(%rip), %rdx
	movl	%r13d, %ecx
	movl	%r14d, %r8d
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	%r13d, %edi
	callq	_AR_PHY_TIMING_CTRL4
	movq	_AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%r14d, %ecx
	callq	_REG_RMW_FIELD
	movl	%r13d, %edi
	callq	_AR_PHY_TIMING_CTRL4
	movq	_AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%ebx, %ecx
	callq	_REG_RMW_FIELD
	movl	(%r12), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.9(%rip), %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_ath_dbg
	jmp	LBB0_6
LBB0_7:
	xorl	%edi, %edi
	callq	_AR_PHY_TIMING_CTRL4
	movq	_AR_PHY_TIMING_CTRL4_IQCORR_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_SET_BIT                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CALIBRATE,4,2                  ## @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Starting IQ Cal and Correction for Chain %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Original: Chn %d iq_corr_meas = 0x%08x\n"

L_.str.2:                               ## @.str.2
	.asciz	"Chn %d pwr_meas_i = 0x%08x\n"

L_.str.3:                               ## @.str.3
	.asciz	"Chn %d pwr_meas_q = 0x%08x\n"

L_.str.4:                               ## @.str.4
	.asciz	"iqCorrNeg is 0x%08x\n"

L_.str.5:                               ## @.str.5
	.asciz	"Chn %d iCoff = 0x%08x\n"

L_.str.6:                               ## @.str.6
	.asciz	"Chn %d qCoff = 0x%08x\n"

L_.str.7:                               ## @.str.7
	.asciz	"New: Chn %d iCoff = 0x%08x\n"

L_.str.8:                               ## @.str.8
	.asciz	"Chn %d : iCoff = 0x%x  qCoff = 0x%x\n"

	.comm	_AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF,4,2 ## @AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF
	.comm	_AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF,4,2 ## @AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF
L_.str.9:                               ## @.str.9
	.asciz	"IQ Cal and Correction done for Chain %d\n"

	.comm	_AR_PHY_TIMING_CTRL4_IQCORR_ENABLE,4,2 ## @AR_PHY_TIMING_CTRL4_IQCORR_ENABLE
	.no_dead_strip	_ar9002_hw_iqcalibrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9002_hw_iqcalibrate
_ar9002_hw_iqcalibrate:                 ; @ar9002_hw_iqcalibrate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x1
	mov	x19, x0
	bl	_ath9k_hw_common
	cmp	w22, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x20, x0
	mov	x21, #0
	mov	w22, w22
Lloh0:
	adrp	x23, _CALIBRATE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _CALIBRATE@GOTPAGEOFF]
Lloh2:
	adrp	x24, l_.str@PAGE
Lloh3:
	add	x24, x24, l_.str@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	cmp	x22, x21
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x28, x21, #2
	ldp	x8, x9, [x19]
	ldr	w27, [x8, x28]
	ldr	w25, [x9, x28]
	ldr	x8, [x19, #16]
	ldr	w26, [x8, x28]
	ldr	w1, [x23]
	mov	x0, x20
	mov	x2, x24
	mov	x3, x21
	bl	_ath_dbg
	ldr	w1, [x23]
	ldr	x8, [x19, #16]
	ldr	w8, [x8, x28]
	str	x8, [sp]
	mov	x0, x20
Lloh4:
	adrp	x2, l_.str.1@PAGE
Lloh5:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	mov	w8, #-2147483648
	cmp	w26, w8
	cset	w28, hi
	ldr	w1, [x23]
	str	x27, [sp]
	mov	x0, x20
Lloh6:
	adrp	x2, l_.str.2@PAGE
Lloh7:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	ldr	w1, [x23]
	str	x25, [sp]
	mov	x0, x20
Lloh8:
	adrp	x2, l_.str.3@PAGE
Lloh9:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	ldr	w1, [x23]
	mov	x0, x20
Lloh10:
	adrp	x2, l_.str.4@PAGE
Lloh11:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x3, x28
	bl	_ath_dbg
	cmp	w27, #0
	cinc	w8, w27, lt
	cmp	w25, #0
	cinc	w9, w25, lt
	sub	w10, w25, #64
	cmn	w10, #128
	ccmp	w25, #0, #4, ls
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	asr	w9, w9, #1
	add	w8, w9, w8, asr #1
	sub	w9, w8, #128
	cmn	w9, #256
	b.hi	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w11, #-2147483648
	cmp	w26, w11
	cneg	w9, w26, hi
	add	w10, w8, #127
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #7
	sdiv	w8, w9, w8
	mov	x24, x22
	and	w22, w8, #0x3f
	mov	w9, #64
	sub	w9, w9, w22
	add	w10, w25, #63
	cmp	w26, w11
	csel	w28, w22, w9, hi
	cmp	w25, #0
	csel	w9, w10, w25, lt
	asr	w9, w9, #6
	ldr	w1, [x23]
	sdiv	w25, w27, w9
	str	x8, [sp]
	sub	w26, w25, #64
	mov	x0, x20
Lloh12:
	adrp	x2, l_.str.5@PAGE
Lloh13:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	ldr	w1, [x23]
	str	x26, [sp]
	mov	x0, x20
Lloh14:
	adrp	x2, l_.str.6@PAGE
Lloh15:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	ldr	w1, [x23]
	str	x22, [sp]
	mov	x22, x24
Lloh16:
	adrp	x24, l_.str@PAGE
Lloh17:
	add	x24, x24, l_.str@PAGEOFF
	mov	x0, x20
Lloh18:
	adrp	x2, l_.str.7@PAGE
Lloh19:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	cmp	w25, #49
	mov	w8, #-16
	csel	w8, w8, w26, lt
	cmp	w25, #79
	mov	w9, #15
	csel	w27, w9, w8, gt
	ldr	w1, [x23]
	stp	x28, x27, [sp]
	mov	x0, x20
Lloh20:
	adrp	x2, l_.str.8@PAGE
Lloh21:
	add	x2, x2, l_.str.8@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	mov	x0, x21
	bl	_AR_PHY_TIMING_CTRL4
	mov	x1, x0
Lloh22:
	adrp	x8, _AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x28
	bl	_REG_RMW_FIELD
	mov	x0, x21
	bl	_AR_PHY_TIMING_CTRL4
	mov	x1, x0
Lloh25:
	adrp	x8, _AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x27
	bl	_REG_RMW_FIELD
	ldr	w1, [x23]
	mov	x0, x20
Lloh28:
	adrp	x2, l_.str.9@PAGE
Lloh29:
	add	x2, x2, l_.str.9@PAGEOFF
	mov	x3, x21
	bl	_ath_dbg
	b	LBB0_2
LBB0_6:
	mov	w0, #0
	bl	_AR_PHY_TIMING_CTRL4
	mov	x1, x0
Lloh30:
	adrp	x8, _AR_PHY_TIMING_CTRL4_IQCORR_ENABLE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AR_PHY_TIMING_CTRL4_IQCORR_ENABLE@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_REG_SET_BIT
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_CALIBRATE,4,2                  ; @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Starting IQ Cal and Correction for Chain %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Original: Chn %d iq_corr_meas = 0x%08x\n"

l_.str.2:                               ; @.str.2
	.asciz	"Chn %d pwr_meas_i = 0x%08x\n"

l_.str.3:                               ; @.str.3
	.asciz	"Chn %d pwr_meas_q = 0x%08x\n"

l_.str.4:                               ; @.str.4
	.asciz	"iqCorrNeg is 0x%08x\n"

l_.str.5:                               ; @.str.5
	.asciz	"Chn %d iCoff = 0x%08x\n"

l_.str.6:                               ; @.str.6
	.asciz	"Chn %d qCoff = 0x%08x\n"

l_.str.7:                               ; @.str.7
	.asciz	"New: Chn %d iCoff = 0x%08x\n"

l_.str.8:                               ; @.str.8
	.asciz	"Chn %d : iCoff = 0x%x  qCoff = 0x%x\n"

	.comm	_AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF,4,2 ; @AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF
	.comm	_AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF,4,2 ; @AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF
l_.str.9:                               ; @.str.9
	.asciz	"IQ Cal and Correction done for Chain %d\n"

	.comm	_AR_PHY_TIMING_CTRL4_IQCORR_ENABLE,4,2 ; @AR_PHY_TIMING_CTRL4_IQCORR_ENABLE
	.no_dead_strip	_ar9002_hw_iqcalibrate
.subsections_via_symbols
