	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt61pci_config_lna_gain
_rt61pci_config_lna_gain:               ## @rt61pci_config_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	%rdi, %rbx
	movq	(%rsi), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_rt2x00_has_cap_external_lna_bg
	movq	%rax, %r14
	movq	_EEPROM_RSSI_OFFSET_BG_1@GOTPCREL(%rip), %r15
	movq	_EEPROM_RSSI_OFFSET_BG@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	callq	_rt2x00_has_cap_external_lna_a
	movq	%rax, %r14
	movq	_EEPROM_RSSI_OFFSET_A_1@GOTPCREL(%rip), %r15
	movq	_EEPROM_RSSI_OFFSET_A@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_eeprom_read
	movl	(%r15), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field16
	xorl	%ecx, %ecx
	testq	%r14, %r14
	movl	$14, %edx
	cmovel	%ecx, %edx
	subl	%eax, %edx
	movw	%dx, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.comm	_EEPROM_RSSI_OFFSET_BG,4,2      ## @EEPROM_RSSI_OFFSET_BG
	.comm	_EEPROM_RSSI_OFFSET_BG_1,4,2    ## @EEPROM_RSSI_OFFSET_BG_1
	.comm	_EEPROM_RSSI_OFFSET_A,4,2       ## @EEPROM_RSSI_OFFSET_A
	.comm	_EEPROM_RSSI_OFFSET_A_1,4,2     ## @EEPROM_RSSI_OFFSET_A_1
	.no_dead_strip	_rt61pci_config_lna_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt61pci_config_lna_gain
_rt61pci_config_lna_gain:               ; @rt61pci_config_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	x19, x0
	ldr	x8, [x1]
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _NL80211_BAND_2GHZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	bl	_rt2x00_has_cap_external_lna_bg
	mov	x20, x0
Lloh3:
	adrp	x21, _EEPROM_RSSI_OFFSET_BG_1@GOTPAGE
Lloh4:
	ldr	x21, [x21, _EEPROM_RSSI_OFFSET_BG_1@GOTPAGEOFF]
Lloh5:
	adrp	x8, _EEPROM_RSSI_OFFSET_BG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EEPROM_RSSI_OFFSET_BG@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	bl	_rt2x00_has_cap_external_lna_a
	mov	x20, x0
Lloh7:
	adrp	x21, _EEPROM_RSSI_OFFSET_A_1@GOTPAGE
Lloh8:
	ldr	x21, [x21, _EEPROM_RSSI_OFFSET_A_1@GOTPAGEOFF]
Lloh9:
	adrp	x8, _EEPROM_RSSI_OFFSET_A@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EEPROM_RSSI_OFFSET_A@GOTPAGEOFF]
LBB0_3:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_eeprom_read
	ldr	w1, [x21]
	bl	_rt2x00_get_field16
	cmp	x20, #0
	mov	w8, #14
	csel	w8, wzr, w8, eq
	sub	w8, w8, w0
	strh	w8, [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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.comm	_EEPROM_RSSI_OFFSET_BG,4,2      ; @EEPROM_RSSI_OFFSET_BG
	.comm	_EEPROM_RSSI_OFFSET_BG_1,4,2    ; @EEPROM_RSSI_OFFSET_BG_1
	.comm	_EEPROM_RSSI_OFFSET_A,4,2       ; @EEPROM_RSSI_OFFSET_A
	.comm	_EEPROM_RSSI_OFFSET_A_1,4,2     ; @EEPROM_RSSI_OFFSET_A_1
	.no_dead_strip	_rt61pci_config_lna_gain
.subsections_via_symbols
