	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9002_hw_adc_dccal_calibrate
_ar9002_hw_adc_dccal_calibrate:         ## @ar9002_hw_adc_dccal_calibrate
	.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	%rsi, %r14
	movq	%rdi, %rbx
	callq	_ath9k_hw_common
	movq	%rax, %r13
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	movb	(%rax), %cl
	movl	4(%rax), %eax
	addb	$5, %cl
	shll	%cl, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	je	LBB0_9
## %bb.1:
	movslq	-44(%rbp), %rax                 ## 4-byte Folded Reload
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_CALIBRATE@GOTPCREL(%rip), %r15
	xorl	%r12d, %r12d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %rbx
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	andl	$511, %ebx                      ## imm = 0x1FF
	movq	_CALIBRATE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	leaq	L_.str.5(%rip), %rdx
	movq	%r12, %rcx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	(%r15), %esi
	movq	%r13, %rdi
	leaq	L_.str.6(%rip), %rdx
	movq	%r12, %rcx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	movq	%r12, %rdi
	callq	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_REG_READ
	andl	$-1073737729, %eax              ## imm = 0xC0000FFF
	shll	$12, %ebx
	shll	$21, %r14d
	orl	%ebx, %r14d
	orq	%rax, %r14
	movq	%r12, %rdi
	callq	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%eax, %esi
	movq	%r14, %rdx
	callq	_REG_WRITE
	movl	(%r15), %esi
	movq	%r13, %rdi
	leaq	L_.str.7(%rip), %rdx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_ath_dbg
	incq	%r12
	cmpq	%r12, -88(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movq	(%rax,%r12,8), %r14
	movq	%rbx, %rdx
	movq	(%rcx,%r12,8), %rbx
	movq	16(%rdx), %rax
	movl	(%rax,%r12,4), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	24(%rdx), %rax
	movl	(%rax,%r12,4), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%r15), %esi
	movq	%r13, %rdi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	(%r15), %esi
	movq	%r13, %rdi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rcx
	movq	%r14, %r8
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	(%r15), %esi
	movq	%r13, %rdi
	leaq	L_.str.2(%rip), %rdx
	movq	%r12, %rcx
	movq	%rbx, %r8
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	(%r15), %esi
	movq	%r13, %rdi
	leaq	L_.str.3(%rip), %rdx
	movq	%r12, %rcx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_ath_dbg
	movl	(%r15), %esi
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movq	%r13, %rdi
	leaq	L_.str.4(%rip), %rdx
	movq	%r12, %rcx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_ath_dbg
	subq	%r14, %rbx
	addq	%rbx, %rbx
	movq	%rbx, %rax
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r14
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	-44(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %r14d
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	andl	$511, %r14d                     ## imm = 0x1FF
	subl	%r15d, %edx
	addl	%edx, %edx
	movslq	%edx, %rax
	movq	%rax, %rcx
	orq	%rsi, %rcx
	shrq	$32, %rcx
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	-44(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %ebx
	jmp	LBB0_8
LBB0_9:
	xorl	%edi, %edi
	callq	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	movl	%eax, %r14d
	xorl	%edi, %edi
	callq	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_REG_READ
	movq	_AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%rax, %rdx
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_WRITE                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CALIBRATE,4,2                  ## @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Starting ADC DC Offset Cal for Chain %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Chn %d pwr_meas_odd_i = %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Chn %d pwr_meas_even_i = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Chn %d pwr_meas_odd_q = %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"Chn %d pwr_meas_even_q = %d\n"

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

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

L_.str.7:                               ## @.str.7
	.asciz	"ADC DC Offset Cal done for Chain %d\n"

	.comm	_AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE,8,3 ## @AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE
	.no_dead_strip	_ar9002_hw_adc_dccal_calibrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9002_hw_adc_dccal_calibrate
_ar9002_hw_adc_dccal_calibrate:         ; @ar9002_hw_adc_dccal_calibrate
	.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	x20, x1
	mov	x19, x0
	bl	_ath9k_hw_common
	cbz	x20, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	x22, #0
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
	ldp	w9, w8, [x8]
	add	w9, w9, #5
	lsl	w8, w8, w9
Lloh0:
	adrp	x26, _CALIBRATE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _CALIBRATE@GOTPAGEOFF]
	sxtw	x27, w8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x8, x22, #3
	ldp	x9, x10, [x19]
	ldr	x25, [x9, x8]
	ldr	x28, [x10, x8]
	lsl	x8, x22, #2
	ldp	x9, x10, [x19, #16]
	ldr	w23, [x9, x8]
	ldr	w24, [x10, x8]
	ldr	w1, [x26]
	mov	x0, x21
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	ldr	w1, [x26]
	str	x25, [sp]
	mov	x0, x21
Lloh4:
	adrp	x2, l_.str.1@PAGE
Lloh5:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	ldr	w1, [x26]
	str	x28, [sp]
	mov	x0, x21
Lloh6:
	adrp	x2, l_.str.2@PAGE
Lloh7:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	ldr	w1, [x26]
	str	x23, [sp]
	mov	x0, x21
Lloh8:
	adrp	x2, l_.str.3@PAGE
Lloh9:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	ldr	w1, [x26]
	str	x24, [sp]
	mov	x0, x21
Lloh10:
	adrp	x2, l_.str.4@PAGE
Lloh11:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	sub	x8, x28, x25
	lsl	x8, x8, #1
	udiv	x8, x8, x27
	and	w25, w8, #0x1ff
	sub	w8, w23, w24
	lsl	w8, w8, #1
	sxtw	x8, w8
	udiv	x8, x8, x27
	and	w23, w8, #0x1ff
	ldr	w1, [x26]
	str	x25, [sp]
	mov	x0, x21
Lloh12:
	adrp	x2, l_.str.5@PAGE
Lloh13:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	ldr	w1, [x26]
	str	x23, [sp]
	mov	x0, x21
Lloh14:
	adrp	x2, l_.str.6@PAGE
Lloh15:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	mov	x0, x22
	bl	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	mov	x1, x0
	mov	x0, x19
	bl	_REG_READ
	mov	w8, #-1073737729
	and	x8, x0, x8
	lsl	w9, w25, #21
	bfi	w9, w23, #12, #9
	orr	x25, x8, x9
	mov	x0, x22
	bl	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	mov	x1, x0
	mov	x0, x19
	mov	x2, x25
	bl	_REG_WRITE
	ldr	w1, [x26]
	mov	x0, x21
Lloh16:
	adrp	x2, l_.str.7@PAGE
Lloh17:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x3, x22
	bl	_ath_dbg
	add	x22, x22, #1
	cmp	x20, x22
	b.ne	LBB0_2
LBB0_3:
	mov	x0, #0
	bl	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	mov	x20, x0
	mov	x0, #0
	bl	_AR_PHY_NEW_ADC_DC_GAIN_CORR
	mov	x1, x0
	mov	x0, x19
	bl	_REG_READ
Lloh18:
	adrp	x8, _AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	orr	x2, x8, x0
	mov	x0, x19
	mov	x1, x20
	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_WRITE
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CALIBRATE,4,2                  ; @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Starting ADC DC Offset Cal for Chain %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Chn %d pwr_meas_odd_i = %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Chn %d pwr_meas_even_i = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Chn %d pwr_meas_odd_q = %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"Chn %d pwr_meas_even_q = %d\n"

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

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

l_.str.7:                               ; @.str.7
	.asciz	"ADC DC Offset Cal done for Chain %d\n"

	.comm	_AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE,8,3 ; @AR_PHY_NEW_ADC_DC_OFFSET_CORR_ENABLE
	.no_dead_strip	_ar9002_hw_adc_dccal_calibrate
.subsections_via_symbols
