	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x2_phy_set_gain_val
_mt76x2_phy_set_gain_val:               ## @mt76x2_phy_set_gain_val
	.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	%rdi, %r15
	movq	16(%rdi), %r13
	movq	24(%rdi), %rax
	movq	(%rax), %r12
	movq	8(%rax), %r14
	callq	_mt76x2_has_ext_lna
	movl	$406192128, %ebx                ## imm = 0x18360000
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	(%r15), %rax
	movq	_NL80211_CHAN_WIDTH_40@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$406192128, %eax                ## imm = 0x18360000
	movl	$507641856, %ebx                ## imm = 0x1E420000
	cmovll	%eax, %ebx
LBB0_2:
	subq	%r13, %r12
	subq	%r13, %r14
	movq	%r15, %rdi
	callq	_mt76x2_has_ext_lna
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	8(%r15), %rax
	movq	(%rax), %rax
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	(%r15), %rax
	movq	_NL80211_CHAN_WIDTH_40@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$255197184, %eax                ## imm = 0xF360000
	cmovll	%eax, %ebx
LBB0_5:
	orl	$248, %ebx
	movq	_AGC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$8, %esi
	callq	_MT_BBP
	movl	%eax, %r13d
	movq	_MT_BBP_AGC_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_FIELD_PREP
	orl	%ebx, %eax
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_mt76_wr
	movq	_AGC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$9, %esi
	callq	_MT_BBP
	movl	%eax, %r12d
	movq	_MT_BBP_AGC_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_FIELD_PREP
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	_mt76_wr
	movq	8(%r15), %rax
	movq	_IEEE80211_CHAN_RADAR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 8(%rax)
	je	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mt76x02_phy_dfs_adjust_agc     ## TAILCALL
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_CHAN_WIDTH_40,8,3      ## @NL80211_CHAN_WIDTH_40
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.comm	_AGC,4,2                        ## @AGC
	.comm	_MT_BBP_AGC_GAIN,4,2            ## @MT_BBP_AGC_GAIN
	.comm	_IEEE80211_CHAN_RADAR,4,2       ## @IEEE80211_CHAN_RADAR
	.no_dead_strip	_mt76x2_phy_set_gain_val
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x2_phy_set_gain_val
_mt76x2_phy_set_gain_val:               ; @mt76x2_phy_set_gain_val
	.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	x19, x0
	ldp	x9, x8, [x0, #16]
	ldp	x10, x8, [x8]
	sub	x21, x10, x9
	sub	x20, x8, x9
	bl	_mt76x2_has_ext_lna
	mov	w22, #406192128
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _NL80211_CHAN_WIDTH_40@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_CHAN_WIDTH_40@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #507641856
	csel	w22, w22, w8, lt
LBB0_2:
	mov	x0, x19
	bl	_mt76x2_has_ext_lna
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _NL80211_BAND_2GHZ@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _NL80211_CHAN_WIDTH_40@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NL80211_CHAN_WIDTH_40@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #255197184
	csel	w22, w8, w22, lt
LBB0_5:
	orr	w23, w22, #0xf8
Lloh9:
	adrp	x24, _AGC@GOTPAGE
Lloh10:
	ldr	x24, [x24, _AGC@GOTPAGEOFF]
	ldr	w0, [x24]
	mov	w1, #8
	bl	_MT_BBP
	mov	x22, x0
Lloh11:
	adrp	x25, _MT_BBP_AGC_GAIN@GOTPAGE
Lloh12:
	ldr	x25, [x25, _MT_BBP_AGC_GAIN@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	x1, x21
	bl	_FIELD_PREP
	orr	w2, w0, w23
	mov	x0, x19
	mov	x1, x22
	bl	_mt76_wr
	ldr	w0, [x24]
	mov	w1, #9
	bl	_MT_BBP
	mov	x21, x0
	ldr	w0, [x25]
	mov	x1, x20
	bl	_FIELD_PREP
	orr	w2, w0, w23
	mov	x0, x19
	mov	x1, x21
	bl	_mt76_wr
	ldr	x8, [x19, #8]
	ldr	w8, [x8, #8]
Lloh13:
	adrp	x9, _IEEE80211_CHAN_RADAR@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IEEE80211_CHAN_RADAR@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x19
	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
	b	_mt76x02_phy_dfs_adjust_agc
LBB0_7:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_CHAN_WIDTH_40,8,3      ; @NL80211_CHAN_WIDTH_40
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.comm	_AGC,4,2                        ; @AGC
	.comm	_MT_BBP_AGC_GAIN,4,2            ; @MT_BBP_AGC_GAIN
	.comm	_IEEE80211_CHAN_RADAR,4,2       ; @IEEE80211_CHAN_RADAR
	.no_dead_strip	_mt76x2_phy_set_gain_val
.subsections_via_symbols
