	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x0_eeprom_init             ## -- Begin function mt76x0_eeprom_init
	.p2align	4, 0x90
_mt76x0_eeprom_init:                    ## @mt76x0_eeprom_init
	.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
	callq	_mt76x0_load_eeprom
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movq	_MT_EE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mt76x02_eeprom_get
	movl	%eax, %r14d
	movl	%eax, %r15d
	sarl	$8, %r15d
	movq	_MT76X0U_EE_MAX_VER@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jle	LBB0_3
## %bb.2:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_warn
LBB0_3:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	callq	_dev_info
	movq	_MT_EE_MAC_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_mt76x02_mac_setaddr
	movq	%rbx, %rdi
	callq	_mt76x0_set_chip_cap
	movq	%rbx, %rdi
	callq	_mt76x0_set_freq_offset
	movq	%rbx, %rdi
	callq	_mt76x0_set_temp_offset
	xorl	%eax, %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_EE_VERSION,4,2              ## @MT_EE_VERSION
	.comm	_MT76X0U_EE_MAX_VER,4,2         ## @MT76X0U_EE_MAX_VER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: unsupported EEPROM version %02hhx\n"

L_.str.1:                               ## @.str.1
	.asciz	"EEPROM ver:%02hhx fae:%02hhx\n"

	.comm	_MT_EE_MAC_ADDR,8,3             ## @MT_EE_MAC_ADDR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mt76x0_eeprom_init             ; -- Begin function mt76x0_eeprom_init
	.p2align	2
_mt76x0_eeprom_init:                    ; @mt76x0_eeprom_init
	.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
	bl	_mt76x0_load_eeprom
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _MT_EE_VERSION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_EE_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mt76x02_eeprom_get
	mov	x20, x0
	asr	w21, w0, #8
Lloh3:
	adrp	x8, _MT76X0U_EE_MAX_VER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT76X0U_EE_MAX_VER@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w21, w8
	b.le	LBB0_3
; %bb.2:
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_warn
LBB0_3:
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	bl	_dev_info
	ldr	x8, [x19]
Lloh10:
	adrp	x9, _MT_EE_MAC_ADDR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MT_EE_MAC_ADDR@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	bl	_mt76x02_mac_setaddr
	mov	x0, x19
	bl	_mt76x0_set_chip_cap
	mov	x0, x19
	bl	_mt76x0_set_freq_offset
	mov	x0, x19
	bl	_mt76x0_set_temp_offset
	mov	w0, #0
LBB0_4:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_EE_VERSION,4,2              ; @MT_EE_VERSION
	.comm	_MT76X0U_EE_MAX_VER,4,2         ; @MT76X0U_EE_MAX_VER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: unsupported EEPROM version %02hhx\n"

l_.str.1:                               ; @.str.1
	.asciz	"EEPROM ver:%02hhx fae:%02hhx\n"

	.comm	_MT_EE_MAC_ADDR,8,3             ; @MT_EE_MAC_ADDR
.subsections_via_symbols
