	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lp8860_unlock_eeprom
_lp8860_unlock_eeprom:                  ## @lp8860_unlock_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	_LP8860_UNLOCK_EEPROM@GOTPCREL(%rip), %rax
	movl	4(%r14), %edi
	movq	_LP8860_EEPROM_UNLOCK@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.1:
	movq	_LP8860_EEPROM_CODE_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_2
## %bb.3:
	movl	4(%r14), %edi
	movl	(%r15), %esi
	movq	_LP8860_EEPROM_CODE_2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	testl	%eax, %eax
	jne	LBB0_2
## %bb.4:
	movl	4(%r14), %edi
	movl	(%r15), %esi
	movq	_LP8860_EEPROM_CODE_3@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_5
LBB0_2:
	movl	%eax, %ebx
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_7
LBB0_6:
	movq	_LP8860_LOCK_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
	movl	%eax, %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_LP8860_UNLOCK_EEPROM,4,2       ## @LP8860_UNLOCK_EEPROM
	.comm	_LP8860_EEPROM_UNLOCK,4,2       ## @LP8860_EEPROM_UNLOCK
	.comm	_LP8860_EEPROM_CODE_1,4,2       ## @LP8860_EEPROM_CODE_1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EEPROM Unlock failed\n"

	.comm	_LP8860_EEPROM_CODE_2,4,2       ## @LP8860_EEPROM_CODE_2
	.comm	_LP8860_EEPROM_CODE_3,4,2       ## @LP8860_EEPROM_CODE_3
	.comm	_LP8860_LOCK_EEPROM,4,2         ## @LP8860_LOCK_EEPROM
	.no_dead_strip	_lp8860_unlock_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lp8860_unlock_eeprom
_lp8860_unlock_eeprom:                  ; @lp8860_unlock_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	x20, x1
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x8, _LP8860_UNLOCK_EEPROM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LP8860_UNLOCK_EEPROM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w0, [x19, #4]
Lloh3:
	adrp	x21, _LP8860_EEPROM_UNLOCK@GOTPAGE
Lloh4:
	ldr	x21, [x21, _LP8860_EEPROM_UNLOCK@GOTPAGEOFF]
	ldr	w1, [x21]
	cmp	w8, w20
	b.ne	LBB0_5
; %bb.1:
Lloh5:
	adrp	x8, _LP8860_EEPROM_CODE_1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LP8860_EEPROM_CODE_1@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_regmap_write
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x19, #4]
	ldr	w1, [x21]
Lloh8:
	adrp	x8, _LP8860_EEPROM_CODE_2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LP8860_EEPROM_CODE_2@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_regmap_write
	cbz	w0, LBB0_7
LBB0_3:
	mov	x20, x0
LBB0_4:
	ldr	x0, [x19, #8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_6
LBB0_5:
Lloh13:
	adrp	x8, _LP8860_LOCK_EEPROM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LP8860_LOCK_EEPROM@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	bl	_regmap_write
	mov	x20, x0
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	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_7:
	ldr	w0, [x19, #4]
	ldr	w1, [x21]
Lloh16:
	adrp	x8, _LP8860_EEPROM_CODE_3@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LP8860_EEPROM_CODE_3@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	bl	_regmap_write
	mov	x20, x0
	cbnz	w0, LBB0_4
	b	LBB0_6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LP8860_UNLOCK_EEPROM,4,2       ; @LP8860_UNLOCK_EEPROM
	.comm	_LP8860_EEPROM_UNLOCK,4,2       ; @LP8860_EEPROM_UNLOCK
	.comm	_LP8860_EEPROM_CODE_1,4,2       ; @LP8860_EEPROM_CODE_1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EEPROM Unlock failed\n"

	.comm	_LP8860_EEPROM_CODE_2,4,2       ; @LP8860_EEPROM_CODE_2
	.comm	_LP8860_EEPROM_CODE_3,4,2       ; @LP8860_EEPROM_CODE_3
	.comm	_LP8860_LOCK_EEPROM,4,2         ; @LP8860_LOCK_EEPROM
	.no_dead_strip	_lp8860_unlock_eeprom
.subsections_via_symbols
