	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_write_buf               ## -- Begin function as3722_write_buf
	.p2align	4, 0x90
_as3722_write_buf:                      ## @as3722_write_buf
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$96, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movl	$0, -96(%rbp)
	movq	_IIC_M_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	leaq	-100(%rbp), %rcx
	movq	%rcx, -80(%rbp)
	movl	$0, -72(%rbp)
	movl	$0, -64(%rbp)
	movq	_IIC_M_NOSTART@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -60(%rbp)
	movq	%rdx, -48(%rbp)
	movl	$0, -40(%rbp)
	movl	4(%rdi), %eax
	movl	%eax, -88(%rbp)
	movl	%eax, -56(%rbp)
	movl	%esi, -100(%rbp)
	movl	(%rdi), %edi
	leaq	-96(%rbp), %rsi
	movl	$2, %edx
	callq	_iicbus_transfer
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_device_printf
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_5
## %bb.4:
	addq	$96, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IIC_M_WR,4,2                   ## @IIC_M_WR
	.comm	_IIC_M_NOSTART,4,2              ## @IIC_M_NOSTART
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error when writing reg 0x%02X, rv: %d\n"

	.comm	_EIO,4,2                        ## @EIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_write_buf               ; -- Begin function as3722_write_buf
	.p2align	2
_as3722_write_buf:                      ; @as3722_write_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _IIC_M_WR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IIC_M_WR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	stp	wzr, w8, [sp, #8]
	add	x9, sp, #4
	str	x9, [sp, #24]
	str	wzr, [sp, #32]
	str	wzr, [sp, #40]
Lloh6:
	adrp	x9, _IIC_M_NOSTART@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IIC_M_NOSTART@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	x2, [sp, #56]
	str	wzr, [sp, #64]
	ldp	w0, w9, [x0]
	str	w9, [sp, #16]
	stp	w8, w9, [sp, #44]
	str	w1, [sp, #4]
	add	x1, sp, #8
	mov	w2, #2
	bl	_iicbus_transfer
	cbz	w0, LBB0_2
; %bb.1:
	mov	x3, x0
	ldr	w0, [x20]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_device_printf
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
LBB0_2:
	ldur	x8, [x29, #-24]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_IIC_M_WR,4,2                   ; @IIC_M_WR
	.comm	_IIC_M_NOSTART,4,2              ; @IIC_M_NOSTART
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error when writing reg 0x%02X, rv: %d\n"

	.comm	_EIO,4,2                        ; @EIO
.subsections_via_symbols
