	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sp2_write_i2c
_sp2_write_i2c:                         ## @sp2_write_i2c
	.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	$184, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%esi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r13
	movq	8(%r13), %rbx
	leal	1(%r12), %eax
	movl	%eax, -224(%rbp)
	leaq	-192(%rbp), %rcx
	movq	%rcx, -216(%rbp)
	movl	$0, -208(%rbp)
	movl	(%r13), %ecx
	movl	%ecx, -204(%rbp)
	cmpl	$141, %eax
	jb	LBB0_2
## %bb.1:
	addq	$4, %r13
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%r14d, %edx
	movl	%r12d, %ecx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	movq	%rdi, %r15
	movl	%r14d, -192(%rbp)
	leaq	-188(%rbp), %rdi
	movq	%rdx, -200(%rbp)                ## 8-byte Spill
	movq	%rdx, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	leaq	-224(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_i2c_transfer
	cmpl	$1, %eax
	jne	LBB0_3
## %bb.6:
	movq	(%r15), %rdi
	addq	$4, %rdi
	movl	(%r13), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	movq	-200(%rbp), %r9                 ## 8-byte Reload
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_3:
	movl	%eax, %ebx
	addq	$4, %r13
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dev_err
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%ebx, %eax
	addq	$184, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i2c wr reg=%02x: len=%d is too big!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"i2c write error, reg = 0x%02x, status = %d\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"addr=0x%04x, reg = 0x%02x, data = %*ph\n"

	.no_dead_strip	_sp2_write_i2c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sp2_write_i2c
_sp2_write_i2c:                         ; @sp2_write_i2c
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #240
	.cfi_def_cfa_offset 240
	stp	x24, x23, [sp, #176]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #192]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #208]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #224]            ; 16-byte Folded Spill
	add	x29, sp, #224
	.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
	mov	x20, x3
	mov	x19, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x24, [x0]
	ldr	x23, [x24, #8]
	add	w9, w3, #1
	str	w9, [sp]
	add	x8, sp, #28
	str	x8, [sp, #8]
	str	wzr, [sp, #16]
	ldr	w10, [x24]
	str	w10, [sp, #20]
	cmp	w9, #141
	b.lo	LBB0_2
; %bb.1:
	add	x0, x24, #4
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x20
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	mov	x21, x2
	mov	x22, x0
	str	w19, [sp, #28]
	add	x0, x8, #4
	mov	x1, x2
	mov	x2, x20
	bl	_memcpy
	mov	x1, sp
	mov	x0, x23
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x22]
	add	x0, x8, #4
	ldr	w2, [x24]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x3, x19
	mov	x4, x20
	mov	x5, x21
	bl	_dev_dbg
	mov	w23, #0
	b	LBB0_7
LBB0_4:
	mov	x23, x0
	add	x0, x24, #4
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	mov	x3, x23
	bl	_dev_err
	tbnz	w23, #31, LBB0_7
; %bb.5:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_7:
	ldur	x8, [x29, #-56]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x23
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #176]            ; 16-byte Folded Reload
	add	sp, sp, #240
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i2c wr reg=%02x: len=%d is too big!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"i2c write error, reg = 0x%02x, status = %d\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"addr=0x%04x, reg = 0x%02x, data = %*ph\n"

	.no_dead_strip	_sp2_write_i2c
.subsections_via_symbols
