	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_hw_tx_iq_cal_reload
_ar9003_hw_tx_iq_cal_reload:            ## @ar9003_hw_tx_iq_cal_reload
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r14
	movq	_MAX_MEASUREMENT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r12d
	movq	_AR9300_MAX_CHAINS@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	imulq	%r13, %r12
	leaq	(,%r12,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	shll	$2, %r12d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	callq	_memset
	cmpl	$2, (%rbx)
	jl	LBB0_5
## %bb.1:
	leaq	8(%r15), %rbx
	leaq	(,%r13,8), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	movq	_MAX_MEASUREMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movslq	%ecx, %rax
	addq	-64(%rbp), %rbx                 ## 8-byte Folded Reload
	cmpq	%rax, %r12
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_AR_PHY_TX_IQCAL_CORR_COEFF_B0
	movl	%eax, -8(%rbx,%r13,4)
	movl	%eax, -8(%rbx)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_AR_SREV_9485
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %edi
	callq	_AR_PHY_TX_IQCAL_CORR_COEFF_B1
	movl	%eax, -4(%rbx,%r13,4)
	movl	%eax, -4(%rbx)
	movl	%r12d, %edi
	callq	_AR_PHY_TX_IQCAL_CORR_COEFF_B2
	movl	%eax, (%rbx,%r13,4)
	movl	%eax, (%rbx)
	jmp	LBB0_4
LBB0_5:
	movq	_AR9300_MAX_CHAINS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_15
## %bb.6:
	shlq	$2, %r13
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_AR9300_MAX_CHAINS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %r15                 ## 8-byte Reload
LBB0_14:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	addq	$4, %r15
	cmpq	%rcx, %rbx
	jge	LBB0_15
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	btl	%ebx, %ecx
	jae	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r14), %rcx
	cmpl	$0, (%rcx,%rbx,4)
	jle	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %r12
	xorl	%r15d, %r15d
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=2
	movl	(%r12), %esi
	movl	(%rax), %edx
	movq	8(%r14), %rax
	movq	(%rax,%r15,8), %rax
	movl	(%rax,%rbx,4), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_REG_RMW_FIELD
	incq	%r15
	movq	(%r14), %rax
	movslq	(%rax,%rbx,4), %rax
	addq	%r13, %r12
	cmpq	%rax, %r15
	jge	LBB0_13
LBB0_10:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE@GOTPCREL(%rip), %rax
	testb	$1, %r15b
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	_AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_15:
	movq	_AR_PHY_TX_IQCAL_CONTROL_3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_REG_RMW_FIELD
	movq	_AR_PHY_RX_IQCAL_CORR_B0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_REG_RMW_FIELD
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_MEASUREMENT,4,2            ## @MAX_MEASUREMENT
	.comm	_AR9300_MAX_CHAINS,4,2          ## @AR9300_MAX_CHAINS
	.comm	_AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE,4,2 ## @AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE
	.comm	_AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE,4,2 ## @AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE
	.comm	_AR_PHY_TX_IQCAL_CONTROL_3,4,2  ## @AR_PHY_TX_IQCAL_CONTROL_3
	.comm	_AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN,4,2 ## @AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN
	.comm	_AR_PHY_RX_IQCAL_CORR_B0,4,2    ## @AR_PHY_RX_IQCAL_CORR_B0
	.comm	_AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN,4,2 ## @AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN
	.no_dead_strip	_ar9003_hw_tx_iq_cal_reload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_hw_tx_iq_cal_reload
_ar9003_hw_tx_iq_cal_reload:            ; @ar9003_hw_tx_iq_cal_reload
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	x22, [x0, #8]
Lloh3:
	adrp	x25, _MAX_MEASUREMENT@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MAX_MEASUREMENT@GOTPAGEOFF]
Lloh5:
	adrp	x9, _AR9300_MAX_CHAINS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AR9300_MAX_CHAINS@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh7:
	ldr	w26, [x9]
	mul	x8, x26, x8
	lsl	x9, x8, #2
	add	x10, x9, #15
	and	x12, x10, #0xfffffffffffffff0
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x20, x9, x12
	mov	sp, x20
	lsl	w2, w8, #2
	mov	x0, x20
	mov	w1, #0
	bl	_memset
	ldr	w8, [x25]
	lsl	x24, x26, #2
	cmp	w8, #1
	b.le	LBB0_5
; %bb.1:
	mov	x21, #0
	lsl	x26, x26, #3
	mov	x27, x20
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	ldr	w8, [x25]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	add	x27, x27, x26
	cmp	x21, w8, sxtw
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_AR_PHY_TX_IQCAL_CORR_COEFF_B0
	str	w0, [x27, x24]
	str	w0, [x27]
	mov	x0, x19
	bl	_AR_SREV_9485
	cbnz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_AR_PHY_TX_IQCAL_CORR_COEFF_B1
	add	x28, x27, x24
	str	w0, [x28, #4]
	str	w0, [x27, #4]
	mov	x0, x21
	bl	_AR_PHY_TX_IQCAL_CORR_COEFF_B2
	str	w0, [x28, #8]
	str	w0, [x27, #8]
	b	LBB0_2
LBB0_5:
Lloh10:
	adrp	x8, _AR9300_MAX_CHAINS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AR9300_MAX_CHAINS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.6:
	mov	x21, #0
Lloh13:
	adrp	x25, _AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE@GOTPAGE
Lloh14:
	ldr	x25, [x25, _AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE@GOTPAGEOFF]
Lloh15:
	adrp	x26, _AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE@GOTPAGE
Lloh16:
	ldr	x26, [x26, _AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #1
	add	x20, x20, #4
	cmp	x21, w8, sxtw
	b.ge	LBB0_13
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	ldr	w9, [x19]
	lsr	w9, w9, w21
	tbz	w9, #0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x9, [x22]
	ldr	w9, [x9, x21, lsl #2]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x27, #0
	mov	x28, x20
LBB0_11:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x28]
	tst	x27, #0x1
	csel	x8, x25, x26, eq
	ldr	w2, [x8]
	ldr	x8, [x22, #8]
	ldr	x8, [x8, x27, lsl #3]
	lsl	x23, x21, #2
	ldr	w3, [x8, x23]
	mov	x0, x19
	bl	_REG_RMW_FIELD
	add	x27, x27, #1
	ldr	x8, [x22]
	ldrsw	x8, [x8, x23]
	add	x28, x28, x24
	cmp	x27, x8
	b.lt	LBB0_11
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
Lloh17:
	adrp	x8, _AR9300_MAX_CHAINS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AR9300_MAX_CHAINS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	b	LBB0_7
LBB0_13:
Lloh20:
	adrp	x8, _AR_PHY_TX_IQCAL_CONTROL_3@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AR_PHY_TX_IQCAL_CONTROL_3@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_REG_RMW_FIELD
Lloh26:
	adrp	x8, _AR_PHY_RX_IQCAL_CORR_B0@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AR_PHY_RX_IQCAL_CORR_B0@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_REG_RMW_FIELD
	ldur	x8, [x29, #-88]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_MEASUREMENT,4,2            ; @MAX_MEASUREMENT
	.comm	_AR9300_MAX_CHAINS,4,2          ; @AR9300_MAX_CHAINS
	.comm	_AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE,4,2 ; @AR_PHY_TX_IQCAL_CORR_COEFF_00_COEFF_TABLE
	.comm	_AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE,4,2 ; @AR_PHY_TX_IQCAL_CORR_COEFF_01_COEFF_TABLE
	.comm	_AR_PHY_TX_IQCAL_CONTROL_3,4,2  ; @AR_PHY_TX_IQCAL_CONTROL_3
	.comm	_AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN,4,2 ; @AR_PHY_TX_IQCAL_CONTROL_3_IQCORR_EN
	.comm	_AR_PHY_RX_IQCAL_CORR_B0,4,2    ; @AR_PHY_RX_IQCAL_CORR_B0
	.comm	_AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN,4,2 ; @AR_PHY_RX_IQCAL_CORR_B0_LOOPBACK_IQCORR_EN
	.no_dead_strip	_ar9003_hw_tx_iq_cal_reload
.subsections_via_symbols
