	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_config_lna_gain
_rt2800_config_lna_gain:                ## @rt2800_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	(%rsi), %ebx
	movq	_EEPROM_LNA@GOTPCREL(%rip), %rax
	cmpl	$15, %ebx
	jge	LBB0_2
## %bb.1:
	movq	_EEPROM_LNA_BG@GOTPCREL(%rip), %rbx
	jmp	LBB0_11
LBB0_2:
	cmpl	$65, %ebx
	jae	LBB0_4
## %bb.3:
	movq	_EEPROM_LNA_A0@GOTPCREL(%rip), %rbx
	jmp	LBB0_11
LBB0_4:
	movq	_RT3593@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_rt
	cmpl	$128, %ebx
	ja	LBB0_8
## %bb.5:
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_EEPROM_EXT_LNA2_A1@GOTPCREL(%rip), %rbx
	movq	_EEPROM_EXT_LNA2@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_8:
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_EEPROM_EXT_LNA2_A2@GOTPCREL(%rip), %rbx
	movq	_EEPROM_EXT_LNA2@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_7:
	movq	_RT3883@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	movq	_EEPROM_EXT_LNA2@GOTPCREL(%rip), %rax
	cmoveq	_EEPROM_RSSI_BG2@GOTPCREL(%rip), %rax
	movq	_EEPROM_EXT_LNA2_A1@GOTPCREL(%rip), %rbx
	cmoveq	_EEPROM_RSSI_BG2_LNA_A1@GOTPCREL(%rip), %rbx
	jmp	LBB0_11
LBB0_10:
	movq	_RT3883@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_rt
	testq	%rax, %rax
	movq	_EEPROM_EXT_LNA2@GOTPCREL(%rip), %rax
	cmoveq	_EEPROM_RSSI_A2@GOTPCREL(%rip), %rax
	movq	_EEPROM_EXT_LNA2_A2@GOTPCREL(%rip), %rbx
	cmoveq	_EEPROM_RSSI_A2_LNA_A2@GOTPCREL(%rip), %rbx
LBB0_11:
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2800_eeprom_read
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field16
	movw	%ax, (%r14)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EEPROM_LNA,4,2                 ## @EEPROM_LNA
	.comm	_EEPROM_LNA_BG,4,2              ## @EEPROM_LNA_BG
	.comm	_EEPROM_LNA_A0,4,2              ## @EEPROM_LNA_A0
	.comm	_RT3593,4,2                     ## @RT3593
	.comm	_RT3883,4,2                     ## @RT3883
	.comm	_EEPROM_EXT_LNA2,4,2            ## @EEPROM_EXT_LNA2
	.comm	_EEPROM_EXT_LNA2_A1,4,2         ## @EEPROM_EXT_LNA2_A1
	.comm	_EEPROM_RSSI_BG2,4,2            ## @EEPROM_RSSI_BG2
	.comm	_EEPROM_RSSI_BG2_LNA_A1,4,2     ## @EEPROM_RSSI_BG2_LNA_A1
	.comm	_EEPROM_EXT_LNA2_A2,4,2         ## @EEPROM_EXT_LNA2_A2
	.comm	_EEPROM_RSSI_A2,4,2             ## @EEPROM_RSSI_A2
	.comm	_EEPROM_RSSI_A2_LNA_A2,4,2      ## @EEPROM_RSSI_A2_LNA_A2
	.no_dead_strip	_rt2800_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 rt2800_config_lna_gain
_rt2800_config_lna_gain:                ; @rt2800_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	w20, [x1]
	cmp	w20, #15
	b.ge	LBB0_2
; %bb.1:
Lloh0:
	adrp	x20, _EEPROM_LNA_BG@GOTPAGE
Lloh1:
	ldr	x20, [x20, _EEPROM_LNA_BG@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	cmp	w20, #65
	b.hs	LBB0_6
; %bb.3:
Lloh2:
	adrp	x20, _EEPROM_LNA_A0@GOTPAGE
Lloh3:
	ldr	x20, [x20, _EEPROM_LNA_A0@GOTPAGEOFF]
LBB0_4:
Lloh4:
	adrp	x21, _EEPROM_LNA@GOTPAGE
Lloh5:
	ldr	x21, [x21, _EEPROM_LNA@GOTPAGEOFF]
LBB0_5:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rt2800_eeprom_read
	ldr	w1, [x20]
	bl	_rt2x00_get_field16
	strh	w0, [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
LBB0_6:
Lloh6:
	adrp	x8, _RT3593@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RT3593@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
	cmp	w20, #128
	b.hi	LBB0_9
; %bb.7:
Lloh9:
	adrp	x20, _EEPROM_EXT_LNA2_A1@GOTPAGE
Lloh10:
	ldr	x20, [x20, _EEPROM_EXT_LNA2_A1@GOTPAGEOFF]
Lloh11:
	adrp	x21, _EEPROM_EXT_LNA2@GOTPAGE
Lloh12:
	ldr	x21, [x21, _EEPROM_EXT_LNA2@GOTPAGEOFF]
	cbnz	x0, LBB0_5
; %bb.8:
Lloh13:
	adrp	x8, _RT3883@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RT3883@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
Lloh16:
	adrp	x8, _EEPROM_RSSI_BG2@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EEPROM_RSSI_BG2@GOTPAGEOFF]
	cmp	x0, #0
	csel	x21, x8, x21, eq
Lloh18:
	adrp	x8, _EEPROM_RSSI_BG2_LNA_A1@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EEPROM_RSSI_BG2_LNA_A1@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh20:
	adrp	x20, _EEPROM_EXT_LNA2_A2@GOTPAGE
Lloh21:
	ldr	x20, [x20, _EEPROM_EXT_LNA2_A2@GOTPAGEOFF]
Lloh22:
	adrp	x21, _EEPROM_EXT_LNA2@GOTPAGE
Lloh23:
	ldr	x21, [x21, _EEPROM_EXT_LNA2@GOTPAGEOFF]
	cbnz	x0, LBB0_5
; %bb.10:
Lloh24:
	adrp	x8, _RT3883@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RT3883@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rt
Lloh27:
	adrp	x8, _EEPROM_RSSI_A2@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EEPROM_RSSI_A2@GOTPAGEOFF]
	cmp	x0, #0
	csel	x21, x8, x21, eq
Lloh29:
	adrp	x8, _EEPROM_RSSI_A2_LNA_A2@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EEPROM_RSSI_A2_LNA_A2@GOTPAGEOFF]
LBB0_11:
	csel	x20, x8, x20, eq
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_EEPROM_LNA,4,2                 ; @EEPROM_LNA
	.comm	_EEPROM_LNA_BG,4,2              ; @EEPROM_LNA_BG
	.comm	_EEPROM_LNA_A0,4,2              ; @EEPROM_LNA_A0
	.comm	_RT3593,4,2                     ; @RT3593
	.comm	_RT3883,4,2                     ; @RT3883
	.comm	_EEPROM_EXT_LNA2,4,2            ; @EEPROM_EXT_LNA2
	.comm	_EEPROM_EXT_LNA2_A1,4,2         ; @EEPROM_EXT_LNA2_A1
	.comm	_EEPROM_RSSI_BG2,4,2            ; @EEPROM_RSSI_BG2
	.comm	_EEPROM_RSSI_BG2_LNA_A1,4,2     ; @EEPROM_RSSI_BG2_LNA_A1
	.comm	_EEPROM_EXT_LNA2_A2,4,2         ; @EEPROM_EXT_LNA2_A2
	.comm	_EEPROM_RSSI_A2,4,2             ; @EEPROM_RSSI_A2
	.comm	_EEPROM_RSSI_A2_LNA_A2,4,2      ; @EEPROM_RSSI_A2_LNA_A2
	.no_dead_strip	_rt2800_config_lna_gain
.subsections_via_symbols
