	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ks8851_eeprom_claim
_ks8851_eeprom_claim:                   ## @ks8851_eeprom_claim
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_CCR_EEPROM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	addq	$4, %rdi
	callq	_mutex_lock
	movq	_KS_EEPCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EEPCR_EESA@GOTPCREL(%rip), %rax
	movq	_EEPCR_EECS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_ks8851_wrreg16
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CCR_EEPROM,4,2                 ## @CCR_EEPROM
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_KS_EEPCR,4,2                   ## @KS_EEPCR
	.comm	_EEPCR_EESA,4,2                 ## @EEPCR_EESA
	.comm	_EEPCR_EECS,4,2                 ## @EEPCR_EECS
	.no_dead_strip	_ks8851_eeprom_claim
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ks8851_eeprom_claim
_ks8851_eeprom_claim:                   ; @ks8851_eeprom_claim
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _CCR_EEPROM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CCR_EEPROM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x19, x0
	add	x0, x0, #4
	bl	_mutex_lock
Lloh3:
	adrp	x8, _KS_EEPCR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KS_EEPCR@GOTPAGEOFF]
Lloh5:
	adrp	x9, _EEPCR_EESA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _EEPCR_EESA@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	ldr	w8, [x9]
Lloh9:
	adrp	x9, _EEPCR_EECS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _EEPCR_EECS@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_ks8851_wrreg16
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _ENOENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_CCR_EEPROM,4,2                 ; @CCR_EEPROM
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_KS_EEPCR,4,2                   ; @KS_EEPCR
	.comm	_EEPCR_EESA,4,2                 ; @EEPCR_EESA
	.comm	_EEPCR_EECS,4,2                 ; @EEPCR_EECS
	.no_dead_strip	_ks8851_eeprom_claim
.subsections_via_symbols
