	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x2_phy_channel_calibrate
_mt76x2_phy_channel_calibrate:          ## @mt76x2_phy_channel_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	movq	_NL80211_BAND_5GHZ@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	xorl	%r15d, %r15d
	cmpq	%r13, %r12
	sete	%r14b
	cmpl	$0, (%rdi)
	jne	LBB0_11
## %bb.1:
	movq	%rdi, %rbx
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	callq	_mt76x2_channel_silent
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	testq	%rax, %rax
	jne	LBB0_11
## %bb.2:
	cmpl	$0, 4(%rbx)
	jne	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_mt76x2_phy_tssi_init_cal
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
LBB0_4:
	testl	%ecx, %ecx
	jne	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_mt76x2_mac_stop
LBB0_6:
	movb	%r14b, %r15b
	cmpq	%r13, %r12
	jne	LBB0_8
## %bb.7:
	movq	_MCU_CAL_LC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mt76x02_mcu_calibrate
LBB0_8:
	movq	_MCU_CAL_TX_LOFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_mt76x02_mcu_calibrate
	movq	_MCU_CAL_TXIQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_mt76x02_mcu_calibrate
	movq	_MCU_CAL_RXIQC_FI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_mt76x02_mcu_calibrate
	movq	_MCU_CAL_TEMP_SENSOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mt76x02_mcu_calibrate
	movq	_MCU_CAL_TX_SHAPING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_mt76x02_mcu_calibrate
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_mt76x2_mac_resume
LBB0_10:
	movq	%rbx, %rdi
	callq	_mt76x2_apply_gain_adj
	movq	%rbx, %rdi
	callq	_mt76x02_edcca_init
	movl	$1, (%rbx)
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_5GHZ,8,3          ## @NL80211_BAND_5GHZ
	.comm	_MCU_CAL_LC,4,2                 ## @MCU_CAL_LC
	.comm	_MCU_CAL_TX_LOFT,4,2            ## @MCU_CAL_TX_LOFT
	.comm	_MCU_CAL_TXIQ,4,2               ## @MCU_CAL_TXIQ
	.comm	_MCU_CAL_RXIQC_FI,4,2           ## @MCU_CAL_RXIQC_FI
	.comm	_MCU_CAL_TEMP_SENSOR,4,2        ## @MCU_CAL_TEMP_SENSOR
	.comm	_MCU_CAL_TX_SHAPING,4,2         ## @MCU_CAL_TX_SHAPING
	.no_dead_strip	_mt76x2_phy_channel_calibrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x2_phy_channel_calibrate
_mt76x2_phy_channel_calibrate:          ; @mt76x2_phy_channel_calibrate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0, #8]
	ldr	x22, [x8]
Lloh0:
	adrp	x8, _NL80211_BAND_5GHZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NL80211_BAND_5GHZ@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	cmp	x22, x23
	cset	w21, eq
	ldr	w8, [x0]
	cbnz	w8, LBB0_9
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	bl	_mt76x2_channel_silent
	cbnz	x0, LBB0_9
; %bb.2:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_10
; %bb.3:
	cbz	w20, LBB0_11
LBB0_4:
	cmp	x22, x23
	b.ne	LBB0_6
LBB0_5:
Lloh3:
	adrp	x8, _MCU_CAL_LC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MCU_CAL_LC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_mt76x02_mcu_calibrate
LBB0_6:
Lloh6:
	adrp	x8, _MCU_CAL_TX_LOFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MCU_CAL_TX_LOFT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_mt76x02_mcu_calibrate
Lloh9:
	adrp	x8, _MCU_CAL_TXIQ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCU_CAL_TXIQ@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_mt76x02_mcu_calibrate
Lloh12:
	adrp	x8, _MCU_CAL_RXIQC_FI@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MCU_CAL_RXIQC_FI@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_mt76x02_mcu_calibrate
Lloh15:
	adrp	x8, _MCU_CAL_TEMP_SENSOR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MCU_CAL_TEMP_SENSOR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_mt76x02_mcu_calibrate
Lloh18:
	adrp	x8, _MCU_CAL_TX_SHAPING@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MCU_CAL_TX_SHAPING@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_mt76x02_mcu_calibrate
	cbnz	w20, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_mt76x2_mac_resume
LBB0_8:
	mov	x0, x19
	bl	_mt76x2_apply_gain_adj
	mov	x0, x19
	bl	_mt76x02_edcca_init
	mov	w8, #1
	str	w8, [x19]
LBB0_9:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x19
	bl	_mt76x2_phy_tssi_init_cal
	cbnz	w20, LBB0_4
LBB0_11:
	mov	x0, x19
	mov	w1, #0
	bl	_mt76x2_mac_stop
	cmp	x22, x23
	b.eq	LBB0_5
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_BAND_5GHZ,8,3          ; @NL80211_BAND_5GHZ
	.comm	_MCU_CAL_LC,4,2                 ; @MCU_CAL_LC
	.comm	_MCU_CAL_TX_LOFT,4,2            ; @MCU_CAL_TX_LOFT
	.comm	_MCU_CAL_TXIQ,4,2               ; @MCU_CAL_TXIQ
	.comm	_MCU_CAL_RXIQC_FI,4,2           ; @MCU_CAL_RXIQC_FI
	.comm	_MCU_CAL_TEMP_SENSOR,4,2        ; @MCU_CAL_TEMP_SENSOR
	.comm	_MCU_CAL_TX_SHAPING,4,2         ; @MCU_CAL_TX_SHAPING
	.no_dead_strip	_mt76x2_phy_channel_calibrate
.subsections_via_symbols
