	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function helene_write_regs
_helene_write_regs:                     ## @helene_write_regs
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r12
	movl	%esi, -84(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_WRITE_REGSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	incl	%ebx
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%r14, -80(%rbp)
	leal	1(%r15), %ecx
	movl	%ecx, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	8(%r13), %eax
	movl	%eax, -64(%rbp)
	movslq	%ecx, %rax
	cmpq	%rax, %rbx
	jae	LBB0_2
## %bb.1:
	movq	(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movl	-84(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_E2BIG@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_4
LBB0_2:
	movq	%r13, %rdi
	movl	-84(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	movl	$1, %edx
	movq	%r12, %rcx
	movl	%r15d, %r8d
	callq	_helene_i2c_debug
	movl	%ebx, (%r14)
	addq	$4, %r14
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movq	(%r13), %rdi
	leaq	-80(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	xorl	%r12d, %r12d
	cmpl	$1, %eax
	cmovel	%eax, %ebx
	testl	%eax, %eax
	cmovsl	%eax, %ebx
	testl	%ebx, %ebx
	jns	LBB0_4
## %bb.3:
	movq	(%r13), %rdi
	movq	_KBUILD_MODNAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %ecx
	movl	-84(%rbp), %r8d                 ## 4-byte Reload
	movl	%r15d, %r9d
	xorl	%eax, %eax
	callq	_dev_warn
	movl	%ebx, %r12d
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_WRITE_REGSIZE,4,2          ## @MAX_WRITE_REGSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wr reg=%04x: len=%d vs %zu is too big!\n"

	.comm	_E2BIG,4,2                      ## @E2BIG
	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
L_.str.1:                               ## @.str.1
	.asciz	"%s: i2c wr failed=%d reg=%02x len=%d\n"

	.comm	_KBUILD_MODNAME,4,2             ## @KBUILD_MODNAME
	.no_dead_strip	_helene_write_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function helene_write_regs
_helene_write_regs:                     ; @helene_write_regs
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #32
	mov	x20, x3
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _MAX_WRITE_REGSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_WRITE_REGSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, #1
	lsl	x4, x8, #2
	mov	x9, x4
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x4, #15
	and	x9, x9, #0x7fffffff0
	sub	x23, x8, x9
	mov	sp, x23
	stur	x23, [x29, #-80]
	add	w3, w3, #1
	stp	w3, wzr, [x29, #-72]
	ldr	w8, [x0, #8]
	stur	w8, [x29, #-64]
	cmp	x4, w3, sxtw
	b.hs	LBB0_2
; %bb.1:
	ldr	x0, [x21]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_dev_warn
Lloh10:
	adrp	x8, _E2BIG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _E2BIG@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_5
LBB0_2:
	mov	x0, x21
	mov	x1, x19
	mov	w2, #1
	mov	x3, x22
	mov	x4, x20
	bl	_helene_i2c_debug
	str	w19, [x23], #4
	mov	x0, x23
	mov	x1, x22
	mov	x2, x20
	bl	_memcpy
	ldr	x0, [x21]
	sub	x1, x29, #80
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	mov	w8, #-1
	ccmp	w0, w8, #4, ne
Lloh13:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	csneg	w22, w0, w8, le
	tbnz	w22, #31, LBB0_4
; %bb.3:
	mov	w22, #0
	b	LBB0_5
LBB0_4:
	ldr	x0, [x21]
Lloh16:
	adrp	x8, _KBUILD_MODNAME@GOTPAGE
Lloh17:
	ldr	x8, [x8, _KBUILD_MODNAME@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	str	x20, [sp, #-16]!
	mov	x3, x22
	mov	x4, x19
	bl	_dev_warn
	add	sp, sp, #16
LBB0_5:
	ldur	x8, [x29, #-56]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x22
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_WRITE_REGSIZE,4,2          ; @MAX_WRITE_REGSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wr reg=%04x: len=%d vs %zu is too big!\n"

	.comm	_E2BIG,4,2                      ; @E2BIG
	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
l_.str.1:                               ; @.str.1
	.asciz	"%s: i2c wr failed=%d reg=%02x len=%d\n"

	.comm	_KBUILD_MODNAME,4,2             ; @KBUILD_MODNAME
	.no_dead_strip	_helene_write_regs
.subsections_via_symbols
