	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9002_hw_setup_calibration
_ar9002_hw_setup_calibration:           ## @ar9002_hw_setup_calibration
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_ath9k_hw_common
	movq	%rax, %r14
	xorl	%edi, %edi
	callq	_AR_PHY_TIMING_CTRL4
	movq	_AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	(%rbx), %rcx
	movl	4(%rcx), %ecx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_REG_RMW_FIELD
	movq	(%rbx), %rax
	movl	(%rax), %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_2
## %bb.1:
	cltq
	leaq	l_switch.table.ar9002_hw_setup_calibration(%rip), %rcx
	movq	(%rcx,%rax,8), %rcx
	leaq	l_reltable.ar9002_hw_setup_calibration(%rip), %rdx
	movslq	(%rdx,%rax,4), %rbx
	addq	%rdx, %rbx
	movq	_AR_PHY_CALMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rcx), %edx
	movq	%r15, %rdi
	callq	_REG_WRITE
	movq	_CALIBRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_ath_dbg
LBB0_2:
	xorl	%edi, %edi
	callq	_AR_PHY_TIMING_CTRL4
	movq	_AR_PHY_TIMING_CTRL4_DO_CAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_REG_SET_BIT                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX,4,2 ## @AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX
	.comm	_AR_PHY_CALMODE,4,2             ## @AR_PHY_CALMODE
	.comm	_AR_PHY_CALMODE_IQ,4,2          ## @AR_PHY_CALMODE_IQ
	.comm	_CALIBRATE,4,2                  ## @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"starting IQ Mismatch Calibration\n"

	.comm	_AR_PHY_CALMODE_ADC_GAIN,4,2    ## @AR_PHY_CALMODE_ADC_GAIN
L_.str.1:                               ## @.str.1
	.asciz	"starting ADC Gain Calibration\n"

	.comm	_AR_PHY_CALMODE_ADC_DC_PER,4,2  ## @AR_PHY_CALMODE_ADC_DC_PER
L_.str.2:                               ## @.str.2
	.asciz	"starting ADC DC Calibration\n"

	.comm	_AR_PHY_TIMING_CTRL4_DO_CAL,4,2 ## @AR_PHY_TIMING_CTRL4_DO_CAL
	.no_dead_strip	_ar9002_hw_setup_calibration
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ar9002_hw_setup_calibration
l_switch.table.ar9002_hw_setup_calibration:
	.quad	_AR_PHY_CALMODE_IQ
	.quad	_AR_PHY_CALMODE_ADC_GAIN
	.quad	_AR_PHY_CALMODE_ADC_DC_PER

	.section	__TEXT,__const
	.p2align	2                               ## @reltable.ar9002_hw_setup_calibration
l_reltable.ar9002_hw_setup_calibration:
	.long	L_.str-l_reltable.ar9002_hw_setup_calibration
	.long	L_.str.1-l_reltable.ar9002_hw_setup_calibration
	.long	L_.str.2-l_reltable.ar9002_hw_setup_calibration

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar9002_hw_setup_calibration
_ar9002_hw_setup_calibration:           ; @ar9002_hw_setup_calibration
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_ath9k_hw_common
	mov	x20, x0
	mov	w0, #0
	bl	_AR_PHY_TIMING_CTRL4
	mov	x1, x0
Lloh0:
	adrp	x8, _AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	ldr	x8, [x21]
	ldr	w3, [x8, #4]
	mov	x0, x19
	bl	_REG_RMW_FIELD
	ldr	x8, [x21]
	ldr	w8, [x8]
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_2
; %bb.1:
	sbfiz	x8, x8, #3, #32
Lloh3:
	adrp	x9, l_switch.table.ar9002_hw_setup_calibration@PAGE
Lloh4:
	add	x9, x9, l_switch.table.ar9002_hw_setup_calibration@PAGEOFF
	ldr	x9, [x9, x8]
Lloh5:
	adrp	x10, l_switch.table.ar9002_hw_setup_calibration.3@PAGE
Lloh6:
	add	x10, x10, l_switch.table.ar9002_hw_setup_calibration.3@PAGEOFF
	ldr	x21, [x10, x8]
Lloh7:
	adrp	x8, _AR_PHY_CALMODE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AR_PHY_CALMODE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	ldr	w2, [x9]
	mov	x0, x19
	bl	_REG_WRITE
Lloh10:
	adrp	x8, _CALIBRATE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CALIBRATE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_ath_dbg
LBB0_2:
	mov	w0, #0
	bl	_AR_PHY_TIMING_CTRL4
	mov	x1, x0
Lloh13:
	adrp	x8, _AR_PHY_TIMING_CTRL4_DO_CAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AR_PHY_TIMING_CTRL4_DO_CAL@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_REG_SET_BIT
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX,4,2 ; @AR_PHY_TIMING_CTRL4_IQCAL_LOG_COUNT_MAX
	.comm	_AR_PHY_CALMODE,4,2             ; @AR_PHY_CALMODE
	.comm	_AR_PHY_CALMODE_IQ,4,2          ; @AR_PHY_CALMODE_IQ
	.comm	_CALIBRATE,4,2                  ; @CALIBRATE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"starting IQ Mismatch Calibration\n"

	.comm	_AR_PHY_CALMODE_ADC_GAIN,4,2    ; @AR_PHY_CALMODE_ADC_GAIN
l_.str.1:                               ; @.str.1
	.asciz	"starting ADC Gain Calibration\n"

	.comm	_AR_PHY_CALMODE_ADC_DC_PER,4,2  ; @AR_PHY_CALMODE_ADC_DC_PER
l_.str.2:                               ; @.str.2
	.asciz	"starting ADC DC Calibration\n"

	.comm	_AR_PHY_TIMING_CTRL4_DO_CAL,4,2 ; @AR_PHY_TIMING_CTRL4_DO_CAL
	.no_dead_strip	_ar9002_hw_setup_calibration
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ar9002_hw_setup_calibration
l_switch.table.ar9002_hw_setup_calibration:
	.quad	_AR_PHY_CALMODE_IQ
	.quad	_AR_PHY_CALMODE_ADC_GAIN
	.quad	_AR_PHY_CALMODE_ADC_DC_PER

	.p2align	3                               ; @switch.table.ar9002_hw_setup_calibration.3
l_switch.table.ar9002_hw_setup_calibration.3:
	.quad	l_.str
	.quad	l_.str.1
	.quad	l_.str.2

.subsections_via_symbols
