	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9285_hw_clc
_ar9285_hw_clc:                         ## @ar9285_hw_clc
	.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
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_ar9285_hw_cl_cal
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_AR_PHY_TX_PWRCTRL7@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	_REG_READ
	movq	_AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_MS
	testl	%eax, %eax
	js	LBB0_3
## %bb.6:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r15
	movl	%eax, %eax
	leaq	4(,%rax,4), %r14
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	orl	%edx, %r12d
	addq	$4, %rbx
	cmpq	%rbx, %r14
	je	LBB0_4
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%ebx, %rsi
	movq	_AR_PHY_TX_GAIN_TBL1@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_REG_READ
	movq	_AR_PHY_TX_GAIN_CLC@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_AR_PHY_TX_GAIN_CLC_S@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	sarl	%cl, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	btl	%eax, %r12d
	sbbl	$-1, %r13d
	btl	%eax, %r12d
	jae	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_9
LBB0_4:
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.10:
	movl	%r13d, %eax
	shlq	$2, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	xorl	%r12d, %r12d
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movslq	%r14d, %r15
	movq	_AR_PHY_CLC_TBL1@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	callq	_REG_READ
	movl	%eax, %ebx
	movq	_AR_PHY_CLC_I0@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_AR_PHY_CLC_I0_S@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	sarl	%cl, %ebx
	movq	_AR_PHY_CLC_TBL1@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_REG_READ
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	_AR_PHY_CLC_Q0@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_AR_PHY_CLC_Q0_S@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	sarl	%cl, %eax
	cmpl	$1, %ebx
	adcl	$0, %r12d
	cmpl	$1, %eax
	adcl	$0, %edx
	addq	$4, %r14
	cmpq	%r14, -72(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_11
## %bb.12:
	addl	%r12d, %edx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_3:
	xorl	%edx, %edx
	jmp	LBB0_14
LBB0_5:
	xorl	%edx, %edx
	movq	%r15, %rbx
LBB0_13:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
LBB0_14:
	movq	_AR9285_CLCAL_REDO_THRESH@GOTPCREL(%rip), %rcx
	movl	$1, %eax
	cmpl	(%rcx), %edx
	jle	LBB0_19
## %bb.15:
	movq	_AR9285_RF2G5@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	callq	_REG_READ
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_AR_SREV_9285E_20
	movq	_AR9285_RF2G5_IC50TX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%r15d, %edx
	movq	(%r14), %rsi
	testq	%rax, %rax
	jne	LBB0_16
## %bb.17:
	movq	_AR9285_RF2G5_IC50TX_SET@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_16:
	movq	_AR9285_RF2G5_IC50TX_XE_SET@GOTPCREL(%rip), %rax
LBB0_18:
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_REG_WRITE
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ar9285_hw_cl_cal
	movl	%eax, %r12d
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_REG_WRITE
	movl	%r12d, %eax
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_PHY_TX_PWRCTRL7,8,3         ## @AR_PHY_TX_PWRCTRL7
	.comm	_AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX,4,2 ## @AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX
	.comm	_AR_PHY_TX_GAIN_TBL1,8,3        ## @AR_PHY_TX_GAIN_TBL1
	.comm	_AR_PHY_TX_GAIN_CLC,4,2         ## @AR_PHY_TX_GAIN_CLC
	.comm	_AR_PHY_TX_GAIN_CLC_S,4,2       ## @AR_PHY_TX_GAIN_CLC_S
	.comm	_AR_PHY_CLC_TBL1,8,3            ## @AR_PHY_CLC_TBL1
	.comm	_AR_PHY_CLC_I0,4,2              ## @AR_PHY_CLC_I0
	.comm	_AR_PHY_CLC_I0_S,4,2            ## @AR_PHY_CLC_I0_S
	.comm	_AR_PHY_CLC_Q0,4,2              ## @AR_PHY_CLC_Q0
	.comm	_AR_PHY_CLC_Q0_S,4,2            ## @AR_PHY_CLC_Q0_S
	.comm	_AR9285_CLCAL_REDO_THRESH,4,2   ## @AR9285_CLCAL_REDO_THRESH
	.comm	_AR9285_RF2G5,8,3               ## @AR9285_RF2G5
	.comm	_AR9285_RF2G5_IC50TX,4,2        ## @AR9285_RF2G5_IC50TX
	.comm	_AR9285_RF2G5_IC50TX_XE_SET,4,2 ## @AR9285_RF2G5_IC50TX_XE_SET
	.comm	_AR9285_RF2G5_IC50TX_SET,4,2    ## @AR9285_RF2G5_IC50TX_SET
	.no_dead_strip	_ar9285_hw_clc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9285_hw_clc
_ar9285_hw_clc:                         ; @ar9285_hw_clc
	.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	x28, x1
	mov	x19, x0
	bl	_ar9285_hw_cl_cal
	cbz	w0, LBB0_12
; %bb.1:
Lloh0:
	adrp	x8, _AR_PHY_TX_PWRCTRL7@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR_PHY_TX_PWRCTRL7@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
	mov	x0, x19
	bl	_REG_READ
Lloh3:
	adrp	x8, _AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_MS
	tbnz	w0, #31, LBB0_8
; %bb.2:
	mov	x20, #0
	mov	w21, #0
	mov	w24, #0
	add	w8, w0, #1
Lloh6:
	adrp	x22, _AR_PHY_TX_GAIN_TBL1@GOTPAGE
Lloh7:
	ldr	x22, [x22, _AR_PHY_TX_GAIN_TBL1@GOTPAGEOFF]
	lsl	x23, x8, #2
Lloh8:
	adrp	x25, _AR_PHY_TX_GAIN_CLC@GOTPAGE
Lloh9:
	ldr	x25, [x25, _AR_PHY_TX_GAIN_CLC@GOTPAGEOFF]
Lloh10:
	adrp	x26, _AR_PHY_TX_GAIN_CLC_S@GOTPAGE
Lloh11:
	ldr	x26, [x26, _AR_PHY_TX_GAIN_CLC_S@GOTPAGEOFF]
	mov	w27, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	add	x1, x8, w20, sxtw
	mov	x0, x19
	bl	_REG_READ
	ldr	w8, [x25]
	and	w8, w8, w0
	ldr	w9, [x26]
	asr	w8, w8, w9
	lsl	w8, w27, w8
	tst	w8, w21
	cinc	w24, w24, eq
	csel	w8, w8, wzr, eq
	orr	w21, w8, w21
	add	x20, x20, #4
	cmp	x23, x20
	b.ne	LBB0_3
; %bb.4:
	cbz	w24, LBB0_8
; %bb.5:
	str	x28, [sp, #8]                   ; 8-byte Folded Spill
	mov	x23, #0
	mov	w21, #0
	mov	w22, #0
	lsl	x24, x24, #2
Lloh12:
	adrp	x25, _AR_PHY_CLC_TBL1@GOTPAGE
Lloh13:
	ldr	x25, [x25, _AR_PHY_CLC_TBL1@GOTPAGEOFF]
Lloh14:
	adrp	x28, _AR_PHY_CLC_Q0@GOTPAGE
Lloh15:
	ldr	x28, [x28, _AR_PHY_CLC_Q0@GOTPAGEOFF]
Lloh16:
	adrp	x20, _AR_PHY_CLC_Q0_S@GOTPAGE
Lloh17:
	ldr	x20, [x20, _AR_PHY_CLC_Q0_S@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	sxtw	x26, w23
	add	x1, x8, x26
	mov	x0, x19
	bl	_REG_READ
Lloh18:
	adrp	x8, _AR_PHY_CLC_I0@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AR_PHY_CLC_I0@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh21:
	adrp	x9, _AR_PHY_CLC_I0_S@GOTPAGE
Lloh22:
	ldr	x9, [x9, _AR_PHY_CLC_I0_S@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	asr	w27, w8, w9
	ldr	x8, [x25]
	add	x1, x8, x26
	mov	x0, x19
	bl	_REG_READ
	ldr	w8, [x28]
	and	w8, w8, w0
	ldr	w9, [x20]
	asr	w8, w8, w9
	cmp	w27, #0
	cinc	w22, w22, eq
	cmp	w8, #0
	cinc	w21, w21, eq
	add	x23, x23, #4
	cmp	x24, x23
	b.ne	LBB0_6
; %bb.7:
	add	w8, w21, w22
	ldr	x28, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_9
LBB0_8:
	mov	w8, #0
LBB0_9:
Lloh24:
	adrp	x9, _AR9285_CLCAL_REDO_THRESH@GOTPAGE
Lloh25:
	ldr	x9, [x9, _AR9285_CLCAL_REDO_THRESH@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_11
; %bb.10:
Lloh27:
	adrp	x22, _AR9285_RF2G5@GOTPAGE
Lloh28:
	ldr	x22, [x22, _AR9285_RF2G5@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x19
	bl	_REG_READ
	mov	x21, x0
	mov	x0, x19
	bl	_AR_SREV_9285E_20
	ldr	x1, [x22]
Lloh29:
	adrp	x8, _AR9285_RF2G5_IC50TX@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AR9285_RF2G5_IC50TX@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh32:
	adrp	x9, _AR9285_RF2G5_IC50TX_SET@GOTPAGE
Lloh33:
	ldr	x9, [x9, _AR9285_RF2G5_IC50TX_SET@GOTPAGEOFF]
Lloh34:
	adrp	x10, _AR9285_RF2G5_IC50TX_XE_SET@GOTPAGE
Lloh35:
	ldr	x10, [x10, _AR9285_RF2G5_IC50TX_XE_SET@GOTPAGEOFF]
	cmp	x0, #0
	csel	x9, x9, x10, eq
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_REG_WRITE
	mov	x0, x19
	mov	x1, x28
	bl	_ar9285_hw_cl_cal
	mov	x20, x0
	ldr	x1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_REG_WRITE
	mov	x0, x20
	b	LBB0_12
LBB0_11:
	mov	w0, #1
LBB0_12:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_PHY_TX_PWRCTRL7,8,3         ; @AR_PHY_TX_PWRCTRL7
	.comm	_AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX,4,2 ; @AR_PHY_TX_PWRCTRL_TX_GAIN_TAB_MAX
	.comm	_AR_PHY_TX_GAIN_TBL1,8,3        ; @AR_PHY_TX_GAIN_TBL1
	.comm	_AR_PHY_TX_GAIN_CLC,4,2         ; @AR_PHY_TX_GAIN_CLC
	.comm	_AR_PHY_TX_GAIN_CLC_S,4,2       ; @AR_PHY_TX_GAIN_CLC_S
	.comm	_AR_PHY_CLC_TBL1,8,3            ; @AR_PHY_CLC_TBL1
	.comm	_AR_PHY_CLC_I0,4,2              ; @AR_PHY_CLC_I0
	.comm	_AR_PHY_CLC_I0_S,4,2            ; @AR_PHY_CLC_I0_S
	.comm	_AR_PHY_CLC_Q0,4,2              ; @AR_PHY_CLC_Q0
	.comm	_AR_PHY_CLC_Q0_S,4,2            ; @AR_PHY_CLC_Q0_S
	.comm	_AR9285_CLCAL_REDO_THRESH,4,2   ; @AR9285_CLCAL_REDO_THRESH
	.comm	_AR9285_RF2G5,8,3               ; @AR9285_RF2G5
	.comm	_AR9285_RF2G5_IC50TX,4,2        ; @AR9285_RF2G5_IC50TX
	.comm	_AR9285_RF2G5_IC50TX_XE_SET,4,2 ; @AR9285_RF2G5_IC50TX_XE_SET
	.comm	_AR9285_RF2G5_IC50TX_SET,4,2    ; @AR9285_RF2G5_IC50TX_SET
	.no_dead_strip	_ar9285_hw_clc
.subsections_via_symbols
