	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_aic_cal_continue
_ar9003_aic_cal_continue:               ## @ar9003_aic_cal_continue
	.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
	pushq	%rax
	.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, %r14
	callq	_ath9k_hw_common
	movq	%rax, %r12
	movl	16(%r14), %edi
	movq	_ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MS
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.3:
	movl	$10000, %ebx                    ## imm = 0x2710
	movq	_AR_PHY_AIC_CTRL_0_B1@GOTPCREL(%rip), %r15
	movq	_AR_PHY_AIC_CAL_ENABLE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_REG_READ
	testl	%eax, (%r13)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$100, %edi
	callq	_udelay
	decl	%ebx
	jne	LBB0_4
LBB0_6:
	movq	_AR_PHY_AIC_CTRL_0_B1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_REG_READ
	movq	_AR_PHY_AIC_CAL_ENABLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_MCI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_ath_dbg
	jmp	LBB0_19
LBB0_1:
	movq	_AIC_CAL_STATE_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	jmp	LBB0_20
LBB0_8:
	movq	_AR_PHY_AIC_SRAM_ADDR_B1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ATH_AIC_SRAM_CAL_OFFSET@GOTPCREL(%rip), %rax
	movq	_ATH_AIC_SRAM_AUTO_INCREMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_REG_WRITE
	movq	_ATH_AIC_MAX_BT_CHANNEL@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	jle	LBB0_15
## %bb.9:
	xorl	%r13d, %r13d
	movq	_AR_PHY_AIC_SRAM_DATA_B1@GOTPCREL(%rip), %r15
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, (%rcx,%r13,4)
	testl	%ebx, %ebx
	je	LBB0_15
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%r13
	movslq	(%r12), %rax
	cmpq	%rax, %r13
	jge	LBB0_15
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_REG_READ
	testb	$1, %al
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r14), %rcx
	cmpl	$0, (%rcx,%r13,4)
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	8(%r14)
	jmp	LBB0_13
LBB0_15:
	testl	%ebx, %ebx
	jne	LBB0_17
## %bb.16:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, 8(%r14)
	jge	LBB0_17
## %bb.18:
	movq	_AR_PHY_AIC_CTRL_0_B1@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_AR_PHY_AIC_CAL_ENABLE@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_REG_CLR_BIT
	movl	(%rbx), %esi
	movq	_AR_PHY_AIC_CAL_CH_VALID_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_REG_SET_BIT
	movl	(%rbx), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_REG_SET_BIT
	jmp	LBB0_19
LBB0_17:
	movq	%r14, %rdi
	callq	_ar9003_aic_cal_done
LBB0_19:
	movl	12(%r14), %eax
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN,4,2 ## @ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN
	.comm	_AIC_CAL_STATE_ERROR,4,2        ## @AIC_CAL_STATE_ERROR
	.comm	_AR_PHY_AIC_CTRL_0_B1,4,2       ## @AR_PHY_AIC_CTRL_0_B1
	.comm	_AR_PHY_AIC_CAL_ENABLE,4,2      ## @AR_PHY_AIC_CAL_ENABLE
	.comm	_MCI,4,2                        ## @MCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AIC cal is not done after 40ms"

	.comm	_AR_PHY_AIC_SRAM_ADDR_B1,4,2    ## @AR_PHY_AIC_SRAM_ADDR_B1
	.comm	_ATH_AIC_SRAM_CAL_OFFSET,4,2    ## @ATH_AIC_SRAM_CAL_OFFSET
	.comm	_ATH_AIC_SRAM_AUTO_INCREMENT,4,2 ## @ATH_AIC_SRAM_AUTO_INCREMENT
	.comm	_ATH_AIC_MAX_BT_CHANNEL,4,2     ## @ATH_AIC_MAX_BT_CHANNEL
	.comm	_AR_PHY_AIC_SRAM_DATA_B1,4,2    ## @AR_PHY_AIC_SRAM_DATA_B1
	.comm	_AR_PHY_AIC_CAL_CH_VALID_RESET,4,2 ## @AR_PHY_AIC_CAL_CH_VALID_RESET
	.no_dead_strip	_ar9003_aic_cal_continue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9003_aic_cal_continue
_ar9003_aic_cal_continue:               ; @ar9003_aic_cal_continue
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_ath9k_hw_common
	mov	x22, x0
	ldr	w0, [x19, #16]
Lloh0:
	adrp	x8, _ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_MS
	cbz	w0, LBB0_7
; %bb.1:
	mov	x21, x0
Lloh3:
	adrp	x23, _AR_PHY_AIC_CTRL_0_B1@GOTPAGE
Lloh4:
	ldr	x23, [x23, _AR_PHY_AIC_CTRL_0_B1@GOTPAGEOFF]
Lloh5:
	adrp	x24, _AR_PHY_AIC_CAL_ENABLE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _AR_PHY_AIC_CAL_ENABLE@GOTPAGEOFF]
	cbz	w20, LBB0_5
; %bb.2:
	mov	w25, #10000
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_REG_READ
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #100
	bl	_udelay
	subs	w25, w25, #1
	b.ne	LBB0_3
LBB0_5:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_REG_READ
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.6:
Lloh7:
	adrp	x8, _MCI@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MCI@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x2, l_.str@PAGE
Lloh11:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ath_dbg
	b	LBB0_19
LBB0_7:
Lloh12:
	adrp	x8, _AIC_CAL_STATE_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AIC_CAL_STATE_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	str	w0, [x19, #12]
	b	LBB0_20
LBB0_8:
Lloh15:
	adrp	x8, _AR_PHY_AIC_SRAM_ADDR_B1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AR_PHY_AIC_SRAM_ADDR_B1@GOTPAGEOFF]
Lloh17:
	adrp	x9, _ATH_AIC_SRAM_CAL_OFFSET@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ATH_AIC_SRAM_CAL_OFFSET@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	ldr	w8, [x9]
Lloh21:
	adrp	x9, _ATH_AIC_SRAM_AUTO_INCREMENT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ATH_AIC_SRAM_AUTO_INCREMENT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_REG_WRITE
Lloh24:
	adrp	x22, _ATH_AIC_MAX_BT_CHANNEL@GOTPAGE
Lloh25:
	ldr	x22, [x22, _ATH_AIC_MAX_BT_CHANNEL@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.9:
	mov	x25, #0
Lloh26:
	adrp	x26, _AR_PHY_AIC_SRAM_DATA_B1@GOTPAGE
Lloh27:
	ldr	x26, [x26, _AR_PHY_AIC_SRAM_DATA_B1@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	str	w0, [x8, x25, lsl #2]
	cbz	w20, LBB0_15
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x22]
	cmp	x25, x8
	b.ge	LBB0_15
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x19
	bl	_REG_READ
	tbz	w0, #0, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x19]
	ldr	w9, [x8, x25, lsl #2]
	cbnz	w9, LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w9, [x19, #8]
	add	w9, w9, #1
	str	w9, [x19, #8]
	b	LBB0_10
LBB0_15:
	cbnz	w20, LBB0_18
; %bb.16:
	ldr	w8, [x19, #8]
	cmp	w8, w21
	b.ge	LBB0_18
; %bb.17:
	ldr	w1, [x23]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_REG_CLR_BIT
	ldr	w1, [x23]
Lloh28:
	adrp	x8, _AR_PHY_AIC_CAL_CH_VALID_RESET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AR_PHY_AIC_CAL_CH_VALID_RESET@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_REG_SET_BIT
	ldr	w1, [x23]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_REG_SET_BIT
	b	LBB0_19
LBB0_18:
	mov	x0, x19
	bl	_ar9003_aic_cal_done
LBB0_19:
	ldr	w0, [x19, #12]
LBB0_20:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN,4,2 ; @ATH_MCI_CONFIG_AIC_CAL_NUM_CHAN
	.comm	_AIC_CAL_STATE_ERROR,4,2        ; @AIC_CAL_STATE_ERROR
	.comm	_AR_PHY_AIC_CTRL_0_B1,4,2       ; @AR_PHY_AIC_CTRL_0_B1
	.comm	_AR_PHY_AIC_CAL_ENABLE,4,2      ; @AR_PHY_AIC_CAL_ENABLE
	.comm	_MCI,4,2                        ; @MCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AIC cal is not done after 40ms"

	.comm	_AR_PHY_AIC_SRAM_ADDR_B1,4,2    ; @AR_PHY_AIC_SRAM_ADDR_B1
	.comm	_ATH_AIC_SRAM_CAL_OFFSET,4,2    ; @ATH_AIC_SRAM_CAL_OFFSET
	.comm	_ATH_AIC_SRAM_AUTO_INCREMENT,4,2 ; @ATH_AIC_SRAM_AUTO_INCREMENT
	.comm	_ATH_AIC_MAX_BT_CHANNEL,4,2     ; @ATH_AIC_MAX_BT_CHANNEL
	.comm	_AR_PHY_AIC_SRAM_DATA_B1,4,2    ; @AR_PHY_AIC_SRAM_DATA_B1
	.comm	_AR_PHY_AIC_CAL_CH_VALID_RESET,4,2 ; @AR_PHY_AIC_CAL_CH_VALID_RESET
	.no_dead_strip	_ar9003_aic_cal_continue
.subsections_via_symbols
