	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x2_read_rx_gain            ## -- Begin function mt76x2_read_rx_gain
	.p2align	4, 0x90
_mt76x2_read_rx_gain:                   ## @mt76x2_read_rx_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	8(%rdi), %r14
	movq	8(%r14), %rax
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_MT_EE_RF_2G_RX_HIGH_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mt76x02_eeprom_get
	sarl	$8, %eax
	jmp	LBB0_3
LBB0_2:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_mt76x2_get_5g_rx_gain
LBB0_3:
	movl	%eax, -56(%rbp)
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_mt76x2_set_rx_gain_group
	movq	8(%r14), %rsi
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %r15
	leaq	-52(%rbp), %r12
	movq	%rbx, %rdi
	movq	%r15, %rcx
	movq	%r12, %r8
	callq	_mt76x02_get_rx_gain
	movl	-56(%rbp), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_mt76x2_set_rssi_offset
	movl	-56(%rbp), %edx
	sarl	$8, %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_mt76x2_set_rssi_offset
	movzbl	-60(%rbp), %eax
	movl	-52(%rbp), %ecx
	movl	-48(%rbp), %edx
	shll	$8, %ecx
	movzwl	%cx, %ecx
	orl	%eax, %ecx
	movzbl	%dl, %eax
	shll	$16, %eax
	orl	%ecx, %eax
	movl	-44(%rbp), %ecx
	shll	$24, %ecx
	orl	%eax, %ecx
	movl	%ecx, (%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movq	%r14, %rcx
	callq	_mt76x02_get_lna_gain
	movl	%eax, %edi
	movl	$8, %esi
	callq	_mt76x02_sign_extend
	movl	%eax, 4(%rbx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.comm	_MT_EE_RF_2G_RX_HIGH_GAIN,4,2   ## @MT_EE_RF_2G_RX_HIGH_GAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x2_read_rx_gain            ; -- Begin function mt76x2_read_rx_gain
	.p2align	2
_mt76x2_read_rx_gain:                   ; @mt76x2_read_rx_gain
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x20, [x0, #8]
	ldr	x8, [x20, #8]
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_2
; %bb.1:
Lloh6:
	adrp	x8, _MT_EE_RF_2G_RX_HIGH_GAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_EE_RF_2G_RX_HIGH_GAIN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76x02_eeprom_get
	asr	w1, w0, #8
	b	LBB0_3
LBB0_2:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_mt76x2_get_5g_rx_gain
	mov	x1, x0
LBB0_3:
	str	w1, [sp, #4]
	mov	x0, x19
	bl	_mt76x2_set_rx_gain_group
	ldr	x1, [x20, #8]
	add	x2, sp, #4
	add	x3, sp, #8
	add	x4, sp, #12
	mov	x0, x19
	bl	_mt76x02_get_rx_gain
	ldr	w2, [sp, #4]
	mov	x0, x19
	mov	w1, #0
	bl	_mt76x2_set_rssi_offset
	ldr	w8, [sp, #4]
	asr	w2, w8, #8
	mov	x0, x19
	mov	w1, #1
	bl	_mt76x2_set_rssi_offset
	ldrb	w8, [sp, #8]
	ldp	w9, w10, [sp, #12]
	bfi	w8, w9, #8, #8
	bfi	w8, w10, #16, #8
	ldr	w9, [sp, #20]
	bfi	w8, w9, #24, #8
	str	w8, [x19]
	add	x1, sp, #8
	add	x2, sp, #12
	mov	x0, x19
	mov	x3, x20
	bl	_mt76x02_get_lna_gain
	mov	w1, #8
	bl	_mt76x02_sign_extend
	str	w0, [x19, #4]
	ldr	x8, [sp, #24]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_5:
	bl	___stack_chk_fail
	.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	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.comm	_MT_EE_RF_2G_RX_HIGH_GAIN,4,2   ; @MT_EE_RF_2G_RX_HIGH_GAIN
.subsections_via_symbols
