	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x2_eeprom_load
_mt76x2_eeprom_load:                    ## @mt76x2_eeprom_load
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_MT7662_EEPROM_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_mt76_eeprom_init
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	je	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	callq	_mt76x2_check_eeprom
	xorl	%r13d, %r13d
	testl	%eax, %eax
	sete	%r13b
	jmp	LBB0_5
LBB0_1:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_3:
	xorl	%r13d, %r13d
LBB0_5:
	movl	24(%r14), %edi
	movl	(%r12), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_devm_kzalloc
	movq	%rax, 8(%r14)
	movl	(%r12), %ecx
	movl	%ecx, 16(%r14)
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	movq	_MT_EE_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_mt76x02_get_efuse_data
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:
	testl	%r13d, %r13d
	jne	LBB0_14
## %bb.12:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_13:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_8:
	testl	%r13d, %r13d
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mt76x2_apply_cal_free_data
	jmp	LBB0_14
LBB0_10:
	movl	(%r14), %edi
	movl	(%r12), %edx
	movq	%r15, %rsi
	callq	_memcpy
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT7662_EEPROM_SIZE,4,2         ## @MT7662_EEPROM_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MT_EE_READ,4,2                 ## @MT_EE_READ
	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_mt76x2_eeprom_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x2_eeprom_load
_mt76x2_eeprom_load:                    ; @mt76x2_eeprom_load
	.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	x21, _MT7662_EEPROM_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MT7662_EEPROM_SIZE@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_mt76_eeprom_init
	tbnz	w0, #31, LBB0_13
; %bb.1:
	cbz	w0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_mt76x2_check_eeprom
	cmp	w0, #0
	cset	w22, eq
	b	LBB0_4
LBB0_3:
	mov	w22, #0
LBB0_4:
	ldr	w0, [x19, #24]
	ldr	w1, [x21]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_devm_kzalloc
	str	x0, [x19, #8]
	ldr	w3, [x21]
	str	w3, [x19, #16]
	cbz	x0, LBB0_8
; %bb.5:
	mov	x20, x0
Lloh5:
	adrp	x8, _MT_EE_READ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MT_EE_READ@GOTPAGEOFF]
Lloh7:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_mt76x02_get_efuse_data
	cbz	x0, LBB0_9
; %bb.6:
	cbz	w22, LBB0_11
; %bb.7:
	mov	w0, #0
	b	LBB0_13
LBB0_8:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
	cbz	w22, LBB0_14
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	bl	_mt76x2_apply_cal_free_data
	mov	w0, #0
	b	LBB0_13
LBB0_11:
Lloh10:
	adrp	x8, _ENOENT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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_14:
	ldr	w0, [x19]
	ldr	w2, [x21]
	mov	x1, x20
	bl	_memcpy
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_MT7662_EEPROM_SIZE,4,2         ; @MT7662_EEPROM_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MT_EE_READ,4,2                 ; @MT_EE_READ
	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_mt76x2_eeprom_load
.subsections_via_symbols
