	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function et8ek8_i2c_write_reg
_et8ek8_i2c_write_reg:                  ## @et8ek8_i2c_write_reg
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 4(%rdi)
	je	LBB0_1
## %bb.3:
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movq	_ET8EK8_REG_8BIT@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	je	LBB0_6
## %bb.4:
	movq	_ET8EK8_REG_16BIT@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	je	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_6:
	leaq	-40(%rbp), %r12
	leaq	-46(%rbp), %r9
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movl	%r14d, %ecx
	movq	%r12, %r8
	callq	_et8ek8_i2c_create_msg
	movl	4(%rbx), %edi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %r12d
	xorl	%eax, %eax
	testl	%r12d, %r12d
	jns	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	movq	%r15, %rcx
	movl	%r12d, %r8d
	callq	_dev_err
	movl	%r12d, %eax
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ET8EK8_REG_8BIT,8,3            ## @ET8EK8_REG_8BIT
	.comm	_ET8EK8_REG_16BIT,8,3           ## @ET8EK8_REG_16BIT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrote 0x%x to offset 0x%x error %d\n"

	.no_dead_strip	_et8ek8_i2c_write_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function et8ek8_i2c_write_reg
_et8ek8_i2c_write_reg:                  ; @et8ek8_i2c_write_reg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _ET8EK8_REG_8BIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ET8EK8_REG_8BIT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _ET8EK8_REG_16BIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ET8EK8_REG_16BIT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x1
	ccmp	x9, x1, #4, ne
	b.ne	LBB0_5
; %bb.2:
	mov	x20, x3
	mov	x19, x2
	mov	x21, x0
	add	x4, sp, #8
	add	x5, sp, #2
	bl	_et8ek8_i2c_create_msg
	ldr	w0, [x21, #4]
	add	x1, sp, #8
	mov	w2, #1
	bl	_i2c_transfer
	tbnz	w0, #31, LBB0_8
; %bb.3:
	mov	w22, #0
	b	LBB0_7
LBB0_4:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
	mov	x22, x0
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	mov	x4, x22
	bl	_dev_err
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ET8EK8_REG_8BIT,8,3            ; @ET8EK8_REG_8BIT
	.comm	_ET8EK8_REG_16BIT,8,3           ; @ET8EK8_REG_16BIT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrote 0x%x to offset 0x%x error %d\n"

	.no_dead_strip	_et8ek8_i2c_write_reg
.subsections_via_symbols
