	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2400pci_init_eeprom
_rt2400pci_init_eeprom:                 ## @rt2400pci_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, %rbx
	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	%rbx, %rdi
	callq	_rt2x00mmio_register_read
	movq	_RT2460@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	movq	_CSR0_REVISION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	%r15, %rdx
	movl	%eax, %ecx
	callq	_rt2x00_set_chip
	movq	_RF2420@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	_RF2421@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rt2x00_rf
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movq	_EEPROM_ANTENNA_TX_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_get_field16
	movq	%rax, 16(%rbx)
	movq	_EEPROM_ANTENNA_RX_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_get_field16
	movq	%rax, 24(%rbx)
	movq	_ANTENNA_SW_DIVERSITY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, 16(%rbx)
	jne	LBB0_5
## %bb.4:
	movq	_ANTENNA_HW_DIVERSITY@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, 16(%rbx)
LBB0_5:
	cmpq	%rcx, %rax
	jne	LBB0_7
## %bb.6:
	movq	_ANTENNA_HW_DIVERSITY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
LBB0_7:
	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
	movq	%rbx, %rsi
	callq	___set_bit
LBB0_9:
	movq	_EEPROM_ANTENNA_RX_AGCVGC_TUNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2x00_get_field16
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_CAPABILITY_LINK_TUNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	___set_bit
	jmp	LBB0_11
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_rt2x00_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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	_RT2460,4,2                     ## @RT2460
	.comm	_CSR0_REVISION,4,2              ## @CSR0_REVISION
	.comm	_RF2420,4,2                     ## @RF2420
	.comm	_RF2421,4,2                     ## @RF2421
	.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	_ANTENNA_SW_DIVERSITY,8,3       ## @ANTENNA_SW_DIVERSITY
	.comm	_ANTENNA_HW_DIVERSITY,8,3       ## @ANTENNA_HW_DIVERSITY
	.comm	_EEPROM_ANTENNA_HARDWARE_RADIO,4,2 ## @EEPROM_ANTENNA_HARDWARE_RADIO
	.comm	_CAPABILITY_HW_BUTTON,4,2       ## @CAPABILITY_HW_BUTTON
	.comm	_EEPROM_ANTENNA_RX_AGCVGC_TUNING,4,2 ## @EEPROM_ANTENNA_RX_AGCVGC_TUNING
	.comm	_CAPABILITY_LINK_TUNING,4,2     ## @CAPABILITY_LINK_TUNING
	.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	_rt2400pci_init_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2400pci_init_eeprom
_rt2400pci_init_eeprom:                 ; @rt2400pci_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, _RT2460@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RT2460@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, _RF2420@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RF2420@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbnz	w0, LBB0_2
; %bb.1:
Lloh18:
	adrp	x8, _RF2421@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RF2421@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rt2x00_rf
	cbz	w0, LBB0_10
LBB0_2:
Lloh21:
	adrp	x8, _EEPROM_ANTENNA_TX_DEFAULT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EEPROM_ANTENNA_TX_DEFAULT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_get_field16
	str	x0, [x19, #16]
Lloh24:
	adrp	x8, _EEPROM_ANTENNA_RX_DEFAULT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EEPROM_ANTENNA_RX_DEFAULT@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_get_field16
	str	x0, [x19, #24]
	ldr	x10, [x19, #16]
Lloh27:
	adrp	x8, _ANTENNA_SW_DIVERSITY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ANTENNA_SW_DIVERSITY@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x8]
Lloh30:
	adrp	x8, _ANTENNA_HW_DIVERSITY@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ANTENNA_HW_DIVERSITY@GOTPAGEOFF]
	cmp	x10, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	x10, [x8]
	str	x10, [x19, #16]
LBB0_4:
	cmp	x0, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x8]
	str	x8, [x19, #24]
LBB0_6:
Lloh32:
	adrp	x8, _EEPROM_ANTENNA_HARDWARE_RADIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EEPROM_ANTENNA_HARDWARE_RADIO@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_get_field16
	cbz	x0, LBB0_8
; %bb.7:
Lloh35:
	adrp	x8, _CAPABILITY_HW_BUTTON@GOTPAGE
Lloh36:
	ldr	x8, [x8, _CAPABILITY_HW_BUTTON@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	mov	x1, x19
	bl	___set_bit
LBB0_8:
Lloh38:
	adrp	x8, _EEPROM_ANTENNA_RX_AGCVGC_TUNING@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EEPROM_ANTENNA_RX_AGCVGC_TUNING@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rt2x00_get_field16
	cbz	x0, LBB0_11
; %bb.9:
Lloh41:
	adrp	x8, _CAPABILITY_LINK_TUNING@GOTPAGE
Lloh42:
	ldr	x8, [x8, _CAPABILITY_LINK_TUNING@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	mov	x1, x19
	bl	___set_bit
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_rt2x00_err
Lloh46:
	adrp	x8, _ENODEV@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	neg	w0, w8
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
	.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 AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh44, Lloh45
	.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	_RT2460,4,2                     ; @RT2460
	.comm	_CSR0_REVISION,4,2              ; @CSR0_REVISION
	.comm	_RF2420,4,2                     ; @RF2420
	.comm	_RF2421,4,2                     ; @RF2421
	.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	_ANTENNA_SW_DIVERSITY,8,3       ; @ANTENNA_SW_DIVERSITY
	.comm	_ANTENNA_HW_DIVERSITY,8,3       ; @ANTENNA_HW_DIVERSITY
	.comm	_EEPROM_ANTENNA_HARDWARE_RADIO,4,2 ; @EEPROM_ANTENNA_HARDWARE_RADIO
	.comm	_CAPABILITY_HW_BUTTON,4,2       ; @CAPABILITY_HW_BUTTON
	.comm	_EEPROM_ANTENNA_RX_AGCVGC_TUNING,4,2 ; @EEPROM_ANTENNA_RX_AGCVGC_TUNING
	.comm	_CAPABILITY_LINK_TUNING,4,2     ; @CAPABILITY_LINK_TUNING
	.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	_rt2400pci_init_eeprom
.subsections_via_symbols
