	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_get_lna_gain           ## -- Begin function mt76x02_get_lna_gain
	.p2align	4, 0x90
_mt76x02_get_lna_gain:                  ## @mt76x02_get_lna_gain
	.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	%rcx, %r15
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	_MT_EE_NIC_CONF_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mt76x02_eeprom_get
	movq	_MT_EE_NIC_CONF_1_LNA_EXT_2G@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movl	$0, (%rbx)
LBB0_2:
	movq	_MT_EE_NIC_CONF_1_LNA_EXT_5G@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
LBB0_4:
	movq	(%r15), %rax
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.5:
	movl	8(%r15), %eax
	cmpl	$65, %eax
	jl	LBB0_9
## %bb.6:
	cmpl	$128, %eax
	ja	LBB0_8
## %bb.7:
	addq	$4, %r14
	jmp	LBB0_9
LBB0_8:
	addq	$8, %r14
LBB0_9:
	movq	%r14, %rbx
LBB0_10:
	movl	(%rbx), %ecx
	xorl	%eax, %eax
	cmpl	$255, %ecx
	cmovnel	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_EE_NIC_CONF_1,4,2           ## @MT_EE_NIC_CONF_1
	.comm	_MT_EE_NIC_CONF_1_LNA_EXT_2G,4,2 ## @MT_EE_NIC_CONF_1_LNA_EXT_2G
	.comm	_MT_EE_NIC_CONF_1_LNA_EXT_5G,4,2 ## @MT_EE_NIC_CONF_1_LNA_EXT_5G
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x02_get_lna_gain           ; -- Begin function mt76x02_get_lna_gain
	.p2align	2
_mt76x02_get_lna_gain:                  ; @mt76x02_get_lna_gain
	.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, x3
	mov	x19, x2
	mov	x20, x1
Lloh0:
	adrp	x8, _MT_EE_NIC_CONF_1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_EE_NIC_CONF_1@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mt76x02_eeprom_get
Lloh3:
	adrp	x8, _MT_EE_NIC_CONF_1_LNA_EXT_2G@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_EE_NIC_CONF_1_LNA_EXT_2G@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
	str	wzr, [x20]
LBB0_2:
Lloh6:
	adrp	x8, _MT_EE_NIC_CONF_1_LNA_EXT_5G@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_EE_NIC_CONF_1_LNA_EXT_5G@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #12
	bl	_memset
LBB0_4:
	ldr	x8, [x21]
Lloh9:
	adrp	x9, _NL80211_BAND_2GHZ@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.5:
	ldr	w8, [x21, #8]
	cmp	w8, #128
	add	x9, x19, #8
	add	x10, x19, #4
	csel	x9, x9, x10, hi
	cmp	w8, #65
	csel	x20, x19, x9, lt
LBB0_6:
	ldr	w8, [x20]
	cmp	w8, #255
	csel	w0, wzr, w8, eq
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_EE_NIC_CONF_1,4,2           ; @MT_EE_NIC_CONF_1
	.comm	_MT_EE_NIC_CONF_1_LNA_EXT_2G,4,2 ; @MT_EE_NIC_CONF_1_LNA_EXT_2G
	.comm	_MT_EE_NIC_CONF_1_LNA_EXT_5G,4,2 ; @MT_EE_NIC_CONF_1_LNA_EXT_5G
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
.subsections_via_symbols
