	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2500pci_init_eeprom
_rt2500pci_init_eeprom:                 ## @rt2500pci_init_eeprom
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_EEPROM_ANTENNA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rt2x00_eeprom_read
	movq	%rax, %r14
	movq	_EEPROM_ANTENNA_RF_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_get_field16
	movq	%rax, %r15
	movq	_CSR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00mmio_register_read
	movq	_RT2560@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_CSR0_REVISION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_rt2x00_set_chip
	movq	_RF2522@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movq	_RF2523@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	jne	LBB0_7
## %bb.2:
	movq	_RF2524@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movq	_RF2525@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	_RF2525E@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	_RF5222@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movq	_EEPROM_ANTENNA_TX_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_get_field16
	movq	%rax, 32(%r12)
	movq	_EEPROM_ANTENNA_RX_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_get_field16
	movq	%rax, 24(%r12)
	movq	_EEPROM_ANTENNA_HARDWARE_RADIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_get_field16
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_CAPABILITY_HW_BUTTON@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r12), %rbx
	movq	%rbx, %rsi
	callq	___set_bit
	movq	_REQUIRE_DELAYED_RFKILL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	___set_bit
LBB0_9:
	movq	_EEPROM_NIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_eeprom_read
	movq	_EEPROM_NIC_DYN_BBP_TUNE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_rt2x00_get_field16
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	movq	_CAPABILITY_LINK_TUNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r12), %rsi
	callq	___set_bit
LBB0_11:
	movq	_EEPROM_CALIBRATE_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rt2x00_eeprom_read
	movq	_EEPROM_CALIBRATE_OFFSET_RSSI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_rt2x00_get_field16
	movq	%rax, (%r12)
	xorl	%eax, %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_rt2x00_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EEPROM_ANTENNA,4,2             ## @EEPROM_ANTENNA
	.comm	_EEPROM_ANTENNA_RF_TYPE,4,2     ## @EEPROM_ANTENNA_RF_TYPE
	.comm	_CSR0,4,2                       ## @CSR0
	.comm	_RT2560,4,2                     ## @RT2560
	.comm	_CSR0_REVISION,4,2              ## @CSR0_REVISION
	.comm	_RF2522,4,2                     ## @RF2522
	.comm	_RF2523,4,2                     ## @RF2523
	.comm	_RF2524,4,2                     ## @RF2524
	.comm	_RF2525,4,2                     ## @RF2525
	.comm	_RF2525E,4,2                    ## @RF2525E
	.comm	_RF5222,4,2                     ## @RF5222
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid RF chipset detected\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EEPROM_ANTENNA_TX_DEFAULT,4,2  ## @EEPROM_ANTENNA_TX_DEFAULT
	.comm	_EEPROM_ANTENNA_RX_DEFAULT,4,2  ## @EEPROM_ANTENNA_RX_DEFAULT
	.comm	_EEPROM_ANTENNA_HARDWARE_RADIO,4,2 ## @EEPROM_ANTENNA_HARDWARE_RADIO
	.comm	_CAPABILITY_HW_BUTTON,4,2       ## @CAPABILITY_HW_BUTTON
	.comm	_REQUIRE_DELAYED_RFKILL,4,2     ## @REQUIRE_DELAYED_RFKILL
	.comm	_EEPROM_NIC,4,2                 ## @EEPROM_NIC
	.comm	_EEPROM_NIC_DYN_BBP_TUNE,4,2    ## @EEPROM_NIC_DYN_BBP_TUNE
	.comm	_CAPABILITY_LINK_TUNING,4,2     ## @CAPABILITY_LINK_TUNING
	.comm	_EEPROM_CALIBRATE_OFFSET,4,2    ## @EEPROM_CALIBRATE_OFFSET
	.comm	_EEPROM_CALIBRATE_OFFSET_RSSI,4,2 ## @EEPROM_CALIBRATE_OFFSET_RSSI
	.comm	_EEPROM_ANTENNA_LED_MODE,4,2    ## @EEPROM_ANTENNA_LED_MODE
	.comm	_LED_MODE_ASUS,8,3              ## @LED_MODE_ASUS
	.comm	_LED_MODE_DEFAULT,8,3           ## @LED_MODE_DEFAULT
	.comm	_LED_MODE_TXRX_ACTIVITY,8,3     ## @LED_MODE_TXRX_ACTIVITY
	.comm	_LED_TYPE_ACTIVITY,4,2          ## @LED_TYPE_ACTIVITY
	.comm	_LED_TYPE_RADIO,4,2             ## @LED_TYPE_RADIO
	.no_dead_strip	_rt2500pci_init_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2500pci_init_eeprom
_rt2500pci_init_eeprom:                 ; @rt2500pci_init_eeprom
	.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
Lloh0:
	adrp	x8, _EEPROM_ANTENNA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EEPROM_ANTENNA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_rt2x00_eeprom_read
	mov	x20, x0
Lloh3:
	adrp	x8, _EEPROM_ANTENNA_RF_TYPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EEPROM_ANTENNA_RF_TYPE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_rt2x00_get_field16
	mov	x21, x0
Lloh6:
	adrp	x8, _CSR0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CSR0@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00mmio_register_read
Lloh9:
	adrp	x8, _RT2560@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RT2560@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
Lloh12:
	adrp	x8, _CSR0_REVISION@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CSR0_REVISION@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_rt2x00_get_field32
	mov	x3, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_rt2x00_set_chip
Lloh15:
	adrp	x8, _RF2522@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RF2522@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	w0, LBB0_6
; %bb.1:
Lloh18:
	adrp	x8, _RF2523@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RF2523@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	w0, LBB0_6
; %bb.2:
Lloh21:
	adrp	x8, _RF2524@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RF2524@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	w0, LBB0_6
; %bb.3:
Lloh24:
	adrp	x8, _RF2525@GOTPAGE
Lloh25:
	ldr	x8, [x8, _RF2525@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	w0, LBB0_6
; %bb.4:
Lloh27:
	adrp	x8, _RF2525E@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RF2525E@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	w0, LBB0_6
; %bb.5:
Lloh30:
	adrp	x8, _RF5222@GOTPAGE
Lloh31:
	ldr	x8, [x8, _RF5222@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbz	w0, LBB0_12
LBB0_6:
Lloh33:
	adrp	x8, _EEPROM_ANTENNA_TX_DEFAULT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EEPROM_ANTENNA_TX_DEFAULT@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_get_field16
	str	x0, [x19, #32]
Lloh36:
	adrp	x8, _EEPROM_ANTENNA_RX_DEFAULT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EEPROM_ANTENNA_RX_DEFAULT@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_get_field16
	str	x0, [x19, #24]
Lloh39:
	adrp	x8, _EEPROM_ANTENNA_HARDWARE_RADIO@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EEPROM_ANTENNA_HARDWARE_RADIO@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_get_field16
	cbz	x0, LBB0_8
; %bb.7:
Lloh42:
	adrp	x8, _CAPABILITY_HW_BUTTON@GOTPAGE
Lloh43:
	ldr	x8, [x8, _CAPABILITY_HW_BUTTON@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x8]
	add	x20, x19, #8
	mov	x1, x20
	bl	___set_bit
Lloh45:
	adrp	x8, _REQUIRE_DELAYED_RFKILL@GOTPAGE
Lloh46:
	ldr	x8, [x8, _REQUIRE_DELAYED_RFKILL@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
	mov	x1, x20
	bl	___set_bit
LBB0_8:
Lloh48:
	adrp	x8, _EEPROM_NIC@GOTPAGE
Lloh49:
	ldr	x8, [x8, _EEPROM_NIC@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_eeprom_read
Lloh51:
	adrp	x8, _EEPROM_NIC_DYN_BBP_TUNE@GOTPAGE
Lloh52:
	ldr	x8, [x8, _EEPROM_NIC_DYN_BBP_TUNE@GOTPAGEOFF]
Lloh53:
	ldr	w1, [x8]
	bl	_rt2x00_get_field16
	cbnz	x0, LBB0_10
; %bb.9:
Lloh54:
	adrp	x8, _CAPABILITY_LINK_TUNING@GOTPAGE
Lloh55:
	ldr	x8, [x8, _CAPABILITY_LINK_TUNING@GOTPAGEOFF]
Lloh56:
	ldr	w0, [x8]
	add	x1, x19, #8
	bl	___set_bit
LBB0_10:
Lloh57:
	adrp	x8, _EEPROM_CALIBRATE_OFFSET@GOTPAGE
Lloh58:
	ldr	x8, [x8, _EEPROM_CALIBRATE_OFFSET@GOTPAGEOFF]
Lloh59:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_eeprom_read
Lloh60:
	adrp	x8, _EEPROM_CALIBRATE_OFFSET_RSSI@GOTPAGE
Lloh61:
	ldr	x8, [x8, _EEPROM_CALIBRATE_OFFSET_RSSI@GOTPAGEOFF]
Lloh62:
	ldr	w1, [x8]
	bl	_rt2x00_get_field16
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
LBB0_11:
	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_12:
Lloh63:
	adrp	x1, l_.str@PAGE
Lloh64:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_rt2x00_err
Lloh65:
	adrp	x8, _ENODEV@GOTPAGE
Lloh66:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh67:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpAdd	Lloh63, Lloh64
	.cfi_endproc
                                        ; -- End function
	.comm	_EEPROM_ANTENNA,4,2             ; @EEPROM_ANTENNA
	.comm	_EEPROM_ANTENNA_RF_TYPE,4,2     ; @EEPROM_ANTENNA_RF_TYPE
	.comm	_CSR0,4,2                       ; @CSR0
	.comm	_RT2560,4,2                     ; @RT2560
	.comm	_CSR0_REVISION,4,2              ; @CSR0_REVISION
	.comm	_RF2522,4,2                     ; @RF2522
	.comm	_RF2523,4,2                     ; @RF2523
	.comm	_RF2524,4,2                     ; @RF2524
	.comm	_RF2525,4,2                     ; @RF2525
	.comm	_RF2525E,4,2                    ; @RF2525E
	.comm	_RF5222,4,2                     ; @RF5222
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid RF chipset detected\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EEPROM_ANTENNA_TX_DEFAULT,4,2  ; @EEPROM_ANTENNA_TX_DEFAULT
	.comm	_EEPROM_ANTENNA_RX_DEFAULT,4,2  ; @EEPROM_ANTENNA_RX_DEFAULT
	.comm	_EEPROM_ANTENNA_HARDWARE_RADIO,4,2 ; @EEPROM_ANTENNA_HARDWARE_RADIO
	.comm	_CAPABILITY_HW_BUTTON,4,2       ; @CAPABILITY_HW_BUTTON
	.comm	_REQUIRE_DELAYED_RFKILL,4,2     ; @REQUIRE_DELAYED_RFKILL
	.comm	_EEPROM_NIC,4,2                 ; @EEPROM_NIC
	.comm	_EEPROM_NIC_DYN_BBP_TUNE,4,2    ; @EEPROM_NIC_DYN_BBP_TUNE
	.comm	_CAPABILITY_LINK_TUNING,4,2     ; @CAPABILITY_LINK_TUNING
	.comm	_EEPROM_CALIBRATE_OFFSET,4,2    ; @EEPROM_CALIBRATE_OFFSET
	.comm	_EEPROM_CALIBRATE_OFFSET_RSSI,4,2 ; @EEPROM_CALIBRATE_OFFSET_RSSI
	.comm	_EEPROM_ANTENNA_LED_MODE,4,2    ; @EEPROM_ANTENNA_LED_MODE
	.comm	_LED_MODE_ASUS,8,3              ; @LED_MODE_ASUS
	.comm	_LED_MODE_DEFAULT,8,3           ; @LED_MODE_DEFAULT
	.comm	_LED_MODE_TXRX_ACTIVITY,8,3     ; @LED_MODE_TXRX_ACTIVITY
	.comm	_LED_TYPE_ACTIVITY,4,2          ; @LED_TYPE_ACTIVITY
	.comm	_LED_TYPE_RADIO,4,2             ; @LED_TYPE_RADIO
	.no_dead_strip	_rt2500pci_init_eeprom
.subsections_via_symbols
